5

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?

ka4eli
  • 5,294
  • 3
  • 23
  • 43

1 Answers1

6

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.

Jim Meyer
  • 9,275
  • 1
  • 24
  • 49
  • so, just to be sure, during regular flush commitlog is not used at all, and exists **only** for critical situations, right? – ka4eli Sep 17 '15 at 11:55
  • 2
    Correct. If data is successfully flushed then the information in the commitlog corresponding to the flush is simply discarded. – Jim Meyer Sep 17 '15 at 12:01