Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-1119

detect incomplete commitlogheader

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 0.6.3, 0.7 beta 1
    • None
    • None
    • Low

    Description

      Kelvin reported:

      I just came across a corrupted CL file. Here's the stacktrace when starting the server:
      Listening for transport dt_socket at address: 8888
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:160)
      Caused by: java.io.EOFException
      at java.io.RandomAccessFile.readInt(RandomAccessFile.java:725)
      at java.io.RandomAccessFile.readLong(RandomAccessFile.java:758)
      at org.apache.cassandra.db.commitlog.CommitLogHeader.readCommitLogHeader(CommitLogHeader.java:145)
      at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:181)
      at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:167)
      at org.apache.cassandra.thrift.CassandraDaemon.setup(CassandraDaemon.java:95)
      at org.apache.cassandra.thrift.CassandraDaemon.init(CassandraDaemon.java:142)
      ... 5 more

      He added that the segment is only 6 bytes long, indicating that the header was never completely written. CLH should catch that EOF and skip the segment when replay is attempted.

      Attachments

        1. 0002-trunk-1119.patch
          4 kB
          Matthew F. Dennis
        2. 0002-cassandra-0.6-1119.patch
          4 kB
          Matthew F. Dennis
        3. 0001-trunk-1119.patch
          4 kB
          Matthew F. Dennis
        4. 0001-cassandra-0.6-1119.patch
          4 kB
          Matthew F. Dennis

        Activity

          People

            mdennis Matthew F. Dennis
            jbellis Jonathan Ellis
            Matthew F. Dennis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: