3

Is it safe to run sstableverify against live sstables while Cassandra is running? After and while running sstableverify in a lab, I cannot find anything in any logs that would indicate a problem.

kalaolani
  • 323
  • 1
  • 16

2 Answers2

4

SSTables are immutable by nature, so you can work with them using the same user that runs Cassandra (see comment for explanation). If you want to prevent their disappearance because of compaction, you may take the snapshot that will create hard links to files (but don't forget to remove snapshot later).

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • 1
    A warning though, as of current versions (3.11) all offline sstable tools can cause serious issues if not run with the same user the C* process runs with. sstableverify may try to update the sstable_activity table, and write a commitlog which if ran with root the post flush process will choke on and cause no commitlogs to get deleted. Also if the bf or index settings change it may delete/recreate the relevent components which can result in files C* is unable to delete or delete file that is being mid-read from. – Chris Lohfink Feb 05 '18 at 22:57
  • Completely agree about it... Let me update answer – Alex Ott Feb 06 '18 at 08:26
  • Indeed, I have reproduced what Chris has described in my test lab. – kalaolani Feb 06 '18 at 19:55
2

Safe maybe... But, you may run into the disappearance of sstables, due to compaction (something else mabye), while running sstableverify. Use nodetool verify instead for live data. Use sstableverify for data on offline recovery systems to verify data.

kalaolani
  • 323
  • 1
  • 16