Michael Semb Wever created CASSANDRA-21613:
----------------------------------------------

             Summary: Report both checksums when a compressed chunk fails its 
checksum
                 Key: CASSANDRA-21613
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21613
             Project: Apache Cassandra
          Issue Type: Improvement
          Components: Feature/Compression
            Reporter: Michael Semb Wever
            Assignee: Michael Semb Wever


{{CorruptBlockException}} names the file, the chunk offset and the chunk length:

{code}
(/path/to/sstable-Data.db): corruption detected, chunk at 65536 of length 4096.
{code}

The message does not name the checksums, so an operator cannot tell a stored 
checksum that was never written, and so reads as zero, from a genuine mismatch. 
The two need different responses.

The patch adds the stored and the calculated checksum to the message, at the 
five sites that compare them: {{CompressedSequentialWriter.resetAndTruncate}} 
and the four chunk readers.

One of those sites also folded a short read of the checksum into the comparison:

{code:java}
if (channel.read(scratch, chunk.offset + chunk.length) != Integer.BYTES
    || scratch.getInt(0) != checksum)
    throw new CorruptBlockException(channel.filePath(), chunk);
{code}

A truncated file and a mismatched checksum reported as one fault. The patch 
separates them.

Patch: 
[mck/upstream/corrupt-block-checksums/trunk|https://github.com/thelastpickle/cassandra/tree/mck/upstream/corrupt-block-checksums/trunk]
Provenance: 
[1cce224756|https://github.com/datastax/cassandra/commit/1cce224756d11b9520e1a091bc9af1ae0fe50c9f]
 by Michael Marshall



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to