2

We have an Apache Cassandra (version 3.11.4) cluster in production with 5-5 nodes in two DCs. We've just added the last two nodes recently and after the repairs has finished, we started the cleanup 2 days ago. The nodes are quite huge, /data has 2.8TB mounted disk space, Cassandra used around 48% of it before the cleanup. Cleanup finished (I don't think it broke, no errors in log, and nodetool compactionstats says 0 pending tasks) on the first node after ~14 hours and during the cleanup the disk usage increased up to 81% and since then never gone back. Will Cassandra clean it up and if yes, when, or do we have to do something manually? Actually we don't find any tmp files that could be removed manually, so we have no idea now. Did anyone met this usecase and has a solution?

Thanks in advance!

wecesjoska
  • 77
  • 7

1 Answers1

3

Check the old snapshots - most probably you had many snapshots (from backups, or truncated, or removed tables) that were a hard links to the files with data (and not consuming the space), and after nodetool cleanup, the data files were rewritten, and new files were created, while hard links still pointing to the original files, consuming the disk space. Use nodetool listsnapshots to get a list of existing snapshots, and nodetool clearsnapshot to remove not necessary snapshots.

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • what a simple solution! After removing the unnecessary snapshots, disk usage reduced to 40%.Thanks a lot for your help! :) – wecesjoska Jan 15 '21 at 12:08
  • 1
    Yeah, that’s one of the things that people often forget about, because snapshots are usually sitting without consuming the space, until tables are compacted – Alex Ott Jan 15 '21 at 12:09