cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ariel Weisberg (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-9265) Add checksum to saved cache files
Date Wed, 12 Aug 2015 21:12:46 GMT


Ariel Weisberg commented on CASSANDRA-9265:

Coverity flagged this. I don't think it is an issue. It looks like ChecksummedRandomAccessReader
closes the channel proxy in its close method. It's stored by the superclass constructor until

[~danchia] do you mind taking a look and confirming that I am right?

*** CID 1315737:  Exceptional resource leaks  (RESOURCE_LEAK)
55 in,
49         }
51         public static ChecksummedRandomAccessReader open(File file,
File crcFile) throws IOException
52         {
53             ChannelProxy channel = new ChannelProxy(file);
54             RandomAccessReader crcReader =;
>>>     CID 1315737:  Exceptional resource leaks  (RESOURCE_LEAK)
>>>     Variable "channel" going out of scope leaks the resource it refers to.
55             DataIntegrityMetadata.ChecksumValidator validator = new
DataIntegrityMetadata.ChecksumValidator(new Adler32(),
58             return new ChecksummedRandomAccessReader(file, channel,
59         }

** CID 1315736:  Null pointer dereferences  (NULL_RETURNS)
/src/java/org/apache/cassandra/db/ 710 in

> Add checksum to saved cache files
> ---------------------------------
>                 Key: CASSANDRA-9265
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Ariel Weisberg
>            Assignee: Daniel Chia
>             Fix For: 2.2.1, 3.0 beta 1
>         Attachments: 0001-Add-checksum-to-saved-cache-files-CASSANDRA-9265.patch, 0002-trunk-CASSANDRA-9265.patch
> Saved caches are not covered by a checksum. We should at least emit a checksum. My suggestion
is a large checksum of the whole file (convenient offline validation), and then smaller per
record checksums after each record is written (possibly a subset of the incrementally maintained
larger checksum).
> I wouldn't go for anything fancy to try to recover from corruption since it is just a
saved cache. If corruption is detected while reading I would just have it bail out. I would
rather have less code to review and test in this instance.

This message was sent by Atlassian JIRA

View raw message