Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All cassandra's commit log functions and behaviour during flush

I'm using cassandra 2.2.1 and noticed that after nodetool flush commitlog files are not deleted (actually, may be some are, I didn't see, but commitlog dir is not empty).

  1. What is happening during nodetool flush or just regular flush? Are all commitlog files supposed to be deleted during this process?

  2. Is data from commitlog used only during node repair or also during flush?

like image 769
ka4eli Avatar asked Sep 17 '15 09:09

ka4eli


1 Answers

Commitlog files are pre-allocated and reused rather than deleted. This improves performance. See more information here.

The commitlog is used if a node goes down before a memtable has been flushed to an SSTable. This is done by replaying the commitlog to recreate the memtable. When you do a flush, then the space in the commitlog can be reclaimed and reused.

like image 77
Jim Meyer Avatar answered Nov 15 '22 11:11

Jim Meyer