question

judhviraj_177959 avatar image
judhviraj_177959 asked Erick Ramirez answered

Why are inodes not getting freed?

while cassandra is running and compaction is going on,commit logs files are getting deleted when Cassandra process is still using it and due to it inodes are not getting free. please help me how to fix this.

compaction
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

The commitlog segments generally get recycled and reused, not deleted, so the inodes for those segments don't get released.

For what it's worth, commitlogs are unrelated to compactions since those are a separate paths. When data is written to Cassandra, they go to the memtables and are persisted to commitlogs temporarily to protect against power outages or a server crash. When a memtable is flushed to disk (there are several ways this gets triggered), the corresponding commitlog segment gets purged of its contents and kept so it can be reused.

If you have commitlog archiving enabled, the commitlogs do not get released until they are archived successfully. You need to check that the archive script is working and that there is free space in the destination directory or the commitlogs will pile up.

Compaction on the other hand is a mechanism by which SSTables are merged and coalesced together into new SSTable files. If you run backups over your regularly, you will need to ensure that you are clearing snapshots you no longer require.

Snapshots create hardlinks to the original inodes. If you don't clear the snapshot, space will not get freed on the data directory since the inode is still in use. I've explained how snapshots are hardlinks work in this post if you're interested. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.