Merge branch cassandra-2.2 into cassandra-3.0
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/73ca0e1e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/73ca0e1e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/73ca0e1e Branch: refs/heads/cassandra-3.0 Commit: 73ca0e1e131bdf14177c026a60f19e33c379ffd4 Parents: 41f3b96 b3ac793 Author: Benjamin Lerer <b.le...@gmail.com> Authored: Tue Apr 10 09:54:27 2018 +0200 Committer: Benjamin Lerer <b.le...@gmail.com> Committed: Tue Apr 10 09:57:43 2018 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../compress/CompressedRandomAccessReader.java | 58 ++++++++++---------- 2 files changed, 30 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/73ca0e1e/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index 7917712,5221b1e..1564fa3 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,52 -1,12 +1,53 @@@ -2.2.13 - * CQL fromJson(null) throws NullPointerException (CASSANDRA-13891) - * Fix query pager DEBUG log leak causing hit in paged reads throughput (CASSANDRA-14318) +3.0.17 + * Handle incompletely written hint descriptors during startup (CASSANDRA-14080) + * Handle repeat open bound from SRP in read repair (CASSANDRA-14330) + * Use zero as default score in DynamicEndpointSnitch (CASSANDRA-14252) + * Respect max hint window when hinting for LWT (CASSANDRA-14215) + * Adding missing WriteType enum values to v3, v4, and v5 spec (CASSANDRA-13697) + * Don't regenerate bloomfilter and summaries on startup (CASSANDRA-11163) + * Fix NPE when performing comparison against a null frozen in LWT (CASSANDRA-14087) + * Log when SSTables are deleted (CASSANDRA-14302) + * Fix batch commitlog sync regression (CASSANDRA-14292) + * Write to pending endpoint when view replica is also base replica (CASSANDRA-14251) + * Chain commit log marker potential performance regression in batch commit mode (CASSANDRA-14194) + * Fully utilise specified compaction threads (CASSANDRA-14210) + * Pre-create deletion log records to finish compactions quicker (CASSANDRA-12763) +Merged from 2.2: * Backport circleci yaml (CASSANDRA-14240) Merged from 2.1: + * Check checksum before decompressing data (CASSANDRA-14284) * CVE-2017-5929 Security vulnerability in Logback warning in NEWS.txt (CASSANDRA-14183) -2.2.12 + +3.0.16 + * Fix unit test failures in ViewComplexTest (CASSANDRA-14219) + * Add MinGW uname check to start scripts (CASSANDRA-12940) + * Protect against overflow of local expiration time (CASSANDRA-14092) + * Use the correct digest file and reload sstable metadata in nodetool verify (CASSANDRA-14217) + * Handle failure when mutating repaired status in Verifier (CASSANDRA-13933) + * Close socket on error during connect on OutboundTcpConnection (CASSANDRA-9630) + * Set encoding for javadoc generation (CASSANDRA-14154) + * Fix index target computation for dense composite tables with dropped compact storage (CASSANDRA-14104) + * Improve commit log chain marker updating (CASSANDRA-14108) + * Extra range tombstone bound creates double rows (CASSANDRA-14008) + * Fix SStable ordering by max timestamp in SinglePartitionReadCommand (CASSANDRA-14010) + * Accept role names containing forward-slash (CASSANDRA-14088) + * Optimize CRC check chance probability calculations (CASSANDRA-14094) + * Fix cleanup on keyspace with no replicas (CASSANDRA-13526) + * Fix updating base table rows with TTL not removing materialized view entries (CASSANDRA-14071) + * Reduce garbage created by DynamicSnitch (CASSANDRA-14091) + * More frequent commitlog chained markers (CASSANDRA-13987) + * Fix serialized size of DataLimits (CASSANDRA-14057) + * Add flag to allow dropping oversized read repair mutations (CASSANDRA-13975) + * Fix SSTableLoader logger message (CASSANDRA-14003) + * Fix repair race that caused gossip to block (CASSANDRA-13849) + * Tracing interferes with digest requests when using RandomPartitioner (CASSANDRA-13964) + * Add flag to disable materialized views, and warnings on creation (CASSANDRA-13959) + * Don't let user drop or generally break tables in system_distributed (CASSANDRA-13813) + * Provide a JMX call to sync schema with local storage (CASSANDRA-13954) + * Mishandling of cells for removed/dropped columns when reading legacy files (CASSANDRA-13939) + * Deserialise sstable metadata in nodetool verify (CASSANDRA-13922) +Merged from 2.2: * Fix the inspectJvmOptions startup check (CASSANDRA-14112) * Fix race that prevents submitting compaction for a table when executor is full (CASSANDRA-13801) * Rely on the JVM to handle OutOfMemoryErrors (CASSANDRA-13006) http://git-wip-us.apache.org/repos/asf/cassandra/blob/73ca0e1e/src/java/org/apache/cassandra/io/compress/CompressedRandomAccessReader.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/io/compress/CompressedRandomAccessReader.java index 9658316,0fc96ed..2dbb013 --- a/src/java/org/apache/cassandra/io/compress/CompressedRandomAccessReader.java +++ b/src/java/org/apache/cassandra/io/compress/CompressedRandomAccessReader.java @@@ -19,11 -19,13 +19,10 @@@ package org.apache.cassandra.io.compres import java.io.*; import java.nio.ByteBuffer; -import java.nio.MappedByteBuffer; -import java.util.Map; -import java.util.TreeMap; import java.util.concurrent.ThreadLocalRandom; -import java.util.zip.Adler32; - +import java.util.zip.Checksum; - import java.util.function.Supplier; +import com.google.common.annotations.VisibleForTesting; import com.google.common.primitives.Ints; import org.apache.cassandra.io.FSReadError; @@@ -116,6 -115,18 +115,20 @@@ public class CompressedRandomAccessRead compressed.flip(); buffer.clear(); - if (metadata.parameters.getCrcCheckChance() > ThreadLocalRandom.current().nextDouble()) ++ if (getCrcCheckChance() >= 1d || ++ getCrcCheckChance() > ThreadLocalRandom.current().nextDouble()) + { - FBUtilities.directCheckSum(checksum, compressed); ++ metadata.checksumType.update(checksum, (compressed)); + + if (checksum(chunk) != (int) checksum.getValue()) + throw new CorruptBlockException(getPath(), chunk); + + // reset checksum object back to the original (blank) state + checksum.reset(); ++ + compressed.rewind(); + } + try { metadata.compressor().uncompress(compressed, buffer); @@@ -179,25 -176,9 +179,10 @@@ buffer.clear(); - try - { - metadata.compressor().uncompress(compressedChunk, buffer); - } - catch (IOException e) - { - throw new CorruptBlockException(getPath(), chunk, e); - } - finally - { - buffer.flip(); - } - - if (metadata.parameters.getCrcCheckChance() > ThreadLocalRandom.current().nextDouble()) + if (getCrcCheckChance() >= 1d || + getCrcCheckChance() > ThreadLocalRandom.current().nextDouble()) { - compressedChunk.position(chunkOffset).limit(chunkOffset + chunk.length); - - FBUtilities.directCheckSum(checksum, compressedChunk); + metadata.checksumType.update( checksum, compressedChunk); compressedChunk.limit(compressedChunk.capacity()); if (compressedChunk.getInt() != (int) checksum.getValue()) @@@ -205,6 -186,21 +190,21 @@@ // reset checksum object back to the original (blank) state checksum.reset(); + + compressedChunk.position(chunkOffset).limit(chunkOffset + chunk.length); + } + + try + { + metadata.compressor().uncompress(compressedChunk, buffer); + } + catch (IOException e) + { - throw new CorruptBlockException(getPath(), chunk); ++ throw new CorruptBlockException(getPath(), chunk, e); + } + finally + { + buffer.flip(); } // buffer offset is always aligned --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org