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

Commitlog replay may fail if last mutation is within 4 bytes of end of segment

    XMLWordPrintableJSON

    Details

    • Severity:
      Normal

      Description

      Following CASSANDRA-9749 , stricter correctness checks on commitlog replay can incorrectly detect "corrupt segments" and stop commitlog replay (and potentially stop cassandra, depending on the configured policy). In CommitlogReplayer#replaySyncSection we try to read a 4 byte int serializedSize, and if it's 0 (which will happen due to zeroing when the segment was created), we continue on to the next segment. However, it appears that if a mutation is sized such that it ends with 1, 2, or 3 bytes remaining in the segment, we'll pass the isEOF on the while loop but fail to read the serializedSize int, and fail.

        Attachments

        1. whiteboard.png
          8.48 MB
          Jeff Jirsa

          Activity

            People

            • Assignee:
              jjirsa Jeff Jirsa
              Reporter:
              jjirsa Jeff Jirsa
              Authors:
              Jeff Jirsa
              Reviewers:
              Branimir Lambov
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: