Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started



aravinth_chakravarthyr_173918 avatar image
aravinth_chakravarthyr_173918 asked Erick Ramirez edited

Why does commitlog replay result in CommitLogReadException?

I need an information why commit log replay error occurs with the following log

ERROR [main] 2020-01-23 12:51:16,810 - Ignoring commit log replay error

org.apache.cassandra.db.commitlog.CommitLogReadHandler$CommitLogReadException: Encountered bad header at position 291 of commit log /var/lib/cassandra/commitlog/CommitLog-600-1579614223044.log, with bad position but valid CRC

at org.apache.cassandra.db.commitlog.CommitLogSegmentReader$SegmentIterator.computeNext(

at org.apache.cassandra.db.commitlog.CommitLogSegmentReader$SegmentIterator.computeNext(



at org.apache.cassandra.db.commitlog.CommitLogReader.readCommitLogSegment(

at org.apache.cassandra.db.commitlog.CommitLogReader.readAllFiles(

at org.apache.cassandra.db.commitlog.CommitLogReplayer.replayFiles(

at org.apache.cassandra.db.commitlog.CommitLog.recoverFiles(

at org.apache.cassandra.db.commitlog.CommitLog.recoverSegmentsOnDisk(

at org.apache.cassandra.service.CassandraDaemon.setup(

at com.datastax.bdp.server.DseDaemon.setup(

at org.apache.cassandra.service.CassandraDaemon.activate(

at com.datastax.bdp.DseModule.main(

I guess it couldnot find some commitlog in the live commitlog directory for replay . Is that correct

Please give me a document / a view why this error occurs and what can be a possible solution for it

10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez commented

@aravinth_chakravarthyr_173918 The error you posted indicates that the commit log CommitLog-600-1579614223044.log is corrupt and cannot be read.

The most common causes for this issue are:

  • there is a hardware failure such as bad sectors on the disk
  • the server crashed while the filesystem was in the middle of syncing the file to disk
  • the Cassandra process got interrupted mid-transaction

or some variation of the causes I described. What was the reason you had to restart Cassandra -- was it an unexpected outage or failure?

In any case, the workaround is to move the file out of the commit log directory and start Cassandra. Once C* is up and running, you will need to run repairs on the node to pick up the missing mutations which did not get replayed from the corrupt commit log. Cheers!

2 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

The commit log directory file system was full and we extended the file system size and restarted it .

0 Likes 0 ·
Erick Ramirez avatar image Erick Ramirez ♦♦ aravinth_chakravarthyr_173918 ·

That means that the commitlog didn't get completely written to disk which is why it is unreadable. Just remove it and it should allow you to restart the node. Cheers!

0 Likes 0 ·