What happens when a Cassandra node restarts, and how does commit log replay ensure durability?
Last updated
Every write is appended to the on-disk commit log before being acknowledged, and also applied to the in-RAM memtable, which is lost on a crash.
On restart the node replays commit log segments to rebuild unflushed memtable data. Segments already flushed to SSTables are discarded, so only unflushed mutations replay.
The node also reloads SSTables and rejoins via gossip, catching up on missed writes through hinted handoff and repair.
- https://aicassindra.com/blogs/cassandra/cassandra_commit_log.html
- https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlHowDataWritten.html
- http://distributeddatastore.blogspot.com/2021/05/commit-log.html
- https://cassandra.apache.org/_/blog/Learn-How-CommitLog-Works-in-Apache-Cassandra.html
- https://medium.com/@iayushpandey/understanding-cassandras-storage-engine-sstables-memtables-and-commit-logs-9f634aaadf1d
- https://axonops.com/docs/data-platforms/cassandra/architecture/storage-engine/commitlog/
- https://cassandra.apache.org/doc/stable/cassandra/architecture/storage-engine.html
- https://app.studyraid.com/en/read/17135/607438/commit-log-and-memory-table-operations