Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: CHANGES.txt src/java/org/apache/cassandra/db/compaction/CompactionManager.java src/java/org/apache/cassandra/db/compaction/Scrubber.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/925e620b Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/925e620b Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/925e620b Branch: refs/heads/cassandra-2.2 Commit: 925e620b46b6d9f0e6ebd5dc32764a3cdfa647f5 Parents: 830137f 5c58af9 Author: Marcus Eriksson <marc...@apache.org> Authored: Mon Aug 3 14:52:44 2015 +0200 Committer: Marcus Eriksson <marc...@apache.org> Committed: Mon Aug 3 14:52:44 2015 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../org/apache/cassandra/db/compaction/CompactionManager.java | 6 +++--- src/java/org/apache/cassandra/db/compaction/Scrubber.java | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/925e620b/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index 9317659,de7cfa8..401f426 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -27,7 -9,12 +27,8 @@@ Merged from 2.1 * Fix clientutil jar and tests (CASSANDRA-9760) * (cqlsh) Allow the SSL protocol version to be specified through the config file or environment variables (CASSANDRA-9544) - * Remove repair snapshot leftover on startup (CASSANDRA-7357) - * Use random nodes for batch log when only 2 racks (CASSANDRA-8735) - * Ensure atomicity inside thrift and stream session (CASSANDRA-7757) Merged from 2.0: + * Don't cast expected bf size to an int (CASSANDRA-9959) - * Log when messages are dropped due to cross_node_timeout (CASSANDRA-9793) * checkForEndpointCollision fails for legitimate collisions (CASSANDRA-9765) * Complete CASSANDRA-8448 fix (CASSANDRA-9519) * Don't include auth credentials in debug log (CASSANDRA-9682) http://git-wip-us.apache.org/repos/asf/cassandra/blob/925e620b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/db/compaction/CompactionManager.java index 4038aa7,3cfbe43..5bac084 --- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java +++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java @@@ -805,8 -733,8 +805,8 @@@ public class CompactionManager implemen long totalkeysWritten = 0; - int expectedBloomFilterSize = Math.max(cfs.metadata.getMinIndexInterval(), - (int) (SSTableReader.getApproximateKeyCount(txn.originals()))); + long expectedBloomFilterSize = Math.max(cfs.metadata.getMinIndexInterval(), - SSTableReader.getApproximateKeyCount(sstableSet)); ++ SSTableReader.getApproximateKeyCount(txn.originals())); if (logger.isDebugEnabled()) logger.debug("Expected bloom filter size : {}", expectedBloomFilterSize); http://git-wip-us.apache.org/repos/asf/cassandra/blob/925e620b/src/java/org/apache/cassandra/db/compaction/Scrubber.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/db/compaction/Scrubber.java index 5a0b354,400df08..670c682 --- a/src/java/org/apache/cassandra/db/compaction/Scrubber.java +++ b/src/java/org/apache/cassandra/db/compaction/Scrubber.java @@@ -47,9 -43,8 +47,9 @@@ public class Scrubber implements Closea private final CompactionController controller; private final boolean isCommutative; + private final boolean isIndex; + private final boolean checkData; - private final int expectedBloomFilterSize; + private final long expectedBloomFilterSize; private final RandomAccessReader dataFile; private final RandomAccessReader indexFile; @@@ -117,10 -108,10 +117,10 @@@ // if there's any corruption in the -Data.db then rows can't be skipped over. but it's worth a shot. outputHandler.warn("Missing component: " + sstable.descriptor.filenameFor(Component.PRIMARY_INDEX)); } - + this.checkData = checkData && !this.isIndex; //LocalByPartitionerType does not support validation this.expectedBloomFilterSize = Math.max( cfs.metadata.getMinIndexInterval(), - hasIndexFile ? (int)(SSTableReader.getApproximateKeyCount(toScrub)) : 0); + hasIndexFile ? SSTableReader.getApproximateKeyCount(toScrub) : 0); // loop through each row, deserializing to check for damage. // we'll also loop through the index at the same time, using the position from the index to recover if the