Merge branch 'cassandra-3.0' into trunk
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a214e182 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a214e182 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a214e182 Branch: refs/heads/trunk Commit: a214e18284217884c2f5c4a80b9550e3b650da47 Parents: 3f97744 3483418 Author: Aleksey Yeschenko <[email protected]> Authored: Tue Aug 30 16:55:27 2016 +0100 Committer: Aleksey Yeschenko <[email protected]> Committed: Tue Aug 30 16:55:27 2016 +0100 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../cassandra/repair/messages/RepairOption.java | 6 +++++- .../cassandra/service/StorageService.java | 2 +- .../repair/messages/RepairOptionTest.java | 20 ++++++++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a214e182/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index cad06bf,5349c14..6b1acb5 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -63,49 -8,12 +63,50 @@@ Merged from 3.0 * Disk failure policy should not be invoked on out of space (CASSANDRA-12385) * Calculate last compacted key on startup (CASSANDRA-6216) * Add schema to snapshot manifest, add USING TIMESTAMP clause to ALTER TABLE statements (CASSANDRA-7190) +Merged from 2.2: + * Fail repair on non-existing table (CASSANDRA-12279) ++ * Enable repair -pr and -local together (fix regression of CASSANDRA-7450) (CASSANDRA-12522) + + +3.8, 3.9 + * Fix value skipping with counter columns (CASSANDRA-11726) + * Fix nodetool tablestats miss SSTable count (CASSANDRA-12205) + * Fixed flacky SSTablesIteratedTest (CASSANDRA-12282) + * Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348) + * cqlsh: Fix handling of $$-escaped strings (CASSANDRA-12189) + * Fix SSL JMX requiring truststore containing server cert (CASSANDRA-12109) + * RTE from new CDC column breaks in flight queries (CASSANDRA-12236) + * Fix hdr logging for single operation workloads (CASSANDRA-12145) + * Fix SASI PREFIX search in CONTAINS mode with partial terms (CASSANDRA-12073) + * Increase size of flushExecutor thread pool (CASSANDRA-12071) + * Partial revert of CASSANDRA-11971, cannot recycle buffer in SP.sendMessagesToNonlocalDC (CASSANDRA-11950) + * Upgrade netty to 4.0.39 (CASSANDRA-12032, CASSANDRA-12034) + * Improve details in compaction log message (CASSANDRA-12080) + * Allow unset values in CQLSSTableWriter (CASSANDRA-11911) + * Chunk cache to request compressor-compatible buffers if pool space is exhausted (CASSANDRA-11993) + * Remove DatabaseDescriptor dependencies from SequentialWriter (CASSANDRA-11579) + * Move skip_stop_words filter before stemming (CASSANDRA-12078) + * Support seek() in EncryptedFileSegmentInputStream (CASSANDRA-11957) + * SSTable tools mishandling LocalPartitioner (CASSANDRA-12002) + * When SEPWorker assigned work, set thread name to match pool (CASSANDRA-11966) + * Add cross-DC latency metrics (CASSANDRA-11596) + * Allow terms in selection clause (CASSANDRA-10783) + * Add bind variables to trace (CASSANDRA-11719) + * Switch counter shards' clock to timestamps (CASSANDRA-9811) + * Introduce HdrHistogram and response/service/wait separation to stress tool (CASSANDRA-11853) + * entry-weighers in QueryProcessor should respect partitionKeyBindIndexes field (CASSANDRA-11718) + * Support older ant versions (CASSANDRA-11807) + * Estimate compressed on disk size when deciding if sstable size limit reached (CASSANDRA-11623) + * cassandra-stress profiles should support case sensitive schemas (CASSANDRA-11546) + * Remove DatabaseDescriptor dependency from FileUtils (CASSANDRA-11578) + * Faster streaming (CASSANDRA-9766) + * Add prepared query parameter to trace for "Execute CQL3 prepared query" session (CASSANDRA-11425) + * Add repaired percentage metric (CASSANDRA-11503) + * Add Change-Data-Capture (CASSANDRA-8844) +Merged from 3.0: * Fix clean interval not sent to commit log for empty memtable flush (CASSANDRA-12436) * Fix potential resource leak in RMIServerSocketFactoryImpl (CASSANDRA-12331) - * Backport CASSANDRA-12002 (CASSANDRA-12177) * Make sure compaction stats are updated when compaction is interrupted (CASSANDRA-12100) - * Fix potential bad messaging service message for paged range reads - within mixed-version 3.x clusters (CASSANDRA-12249) * Change commitlog and sstables to track dirty and clean intervals (CASSANDRA-11828) * NullPointerException during compaction on table with static columns (CASSANDRA-12336) * Fixed ConcurrentModificationException when reading metrics in GraphiteReporter (CASSANDRA-11823) http://git-wip-us.apache.org/repos/asf/cassandra/blob/a214e182/src/java/org/apache/cassandra/repair/messages/RepairOption.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/repair/messages/RepairOption.java index 1f34973,44a1e57..ced6e43 --- a/src/java/org/apache/cassandra/repair/messages/RepairOption.java +++ b/src/java/org/apache/cassandra/repair/messages/RepairOption.java @@@ -217,11 -208,7 +217,11 @@@ public class RepairOptio { throw new IllegalArgumentException("Too many job threads. Max is " + MAX_JOB_THREADS); } + if (!dataCenters.isEmpty() && !hosts.isEmpty()) + { + throw new IllegalArgumentException("Cannot combine -dc and -hosts options."); + } - if (primaryRange && (!dataCenters.isEmpty() || !hosts.isEmpty())) + if (primaryRange && ((!dataCenters.isEmpty() && !option.isInLocalDCOnly()) || !hosts.isEmpty())) { throw new IllegalArgumentException("You need to run primary range repair on all nodes in the cluster."); } http://git-wip-us.apache.org/repos/asf/cassandra/blob/a214e182/src/java/org/apache/cassandra/service/StorageService.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a214e182/test/unit/org/apache/cassandra/repair/messages/RepairOptionTest.java ---------------------------------------------------------------------- diff --cc test/unit/org/apache/cassandra/repair/messages/RepairOptionTest.java index 665a0b7,27eff56..29d9756 --- a/test/unit/org/apache/cassandra/repair/messages/RepairOptionTest.java +++ b/test/unit/org/apache/cassandra/repair/messages/RepairOptionTest.java @@@ -110,25 -100,26 +110,45 @@@ public class RepairOptionTes } @Test + public void testPrWithLocalParseOptions() + { - DatabaseDescriptor.forceStaticInitialization(); ++ DatabaseDescriptor.daemonInitialization(); + + Map<String, String> options = new HashMap<>(); + options.put(RepairOption.PARALLELISM_KEY, "parallel"); + options.put(RepairOption.PRIMARY_RANGE_KEY, "true"); + options.put(RepairOption.INCREMENTAL_KEY, "false"); + options.put(RepairOption.COLUMNFAMILIES_KEY, "cf1,cf2,cf3"); + options.put(RepairOption.DATACENTERS_KEY, "datacenter1"); + + RepairOption option = RepairOption.parse(options, Murmur3Partitioner.instance); + assertTrue(option.isPrimaryRange()); + + Set<String> expectedDCs = new HashSet<>(3); + expectedDCs.add("datacenter1"); + assertEquals(expectedDCs, option.getDataCenters()); + } + + @Test + public void testPullRepairParseOptions() + { + Map<String, String> options = new HashMap<>(); + + options.put(RepairOption.PULL_REPAIR_KEY, "true"); + assertParseThrowsIllegalArgumentExceptionWithMessage(options, "Pull repair can only be performed between two hosts"); + + options.put(RepairOption.HOSTS_KEY, "127.0.0.1,127.0.0.2,127.0.0.3"); + assertParseThrowsIllegalArgumentExceptionWithMessage(options, "Pull repair can only be performed between two hosts"); + + options.put(RepairOption.HOSTS_KEY, "127.0.0.1,127.0.0.2"); + assertParseThrowsIllegalArgumentExceptionWithMessage(options, "Token ranges must be specified when performing pull repair"); + + options.put(RepairOption.RANGES_KEY, "0:10"); + RepairOption option = RepairOption.parse(options, Murmur3Partitioner.instance); + assertTrue(option.isPullRepair()); + } + + @Test public void testIncrementalRepairWithSubrangesIsNotGlobal() throws Exception { RepairOption ro = RepairOption.parse(ImmutableMap.of(RepairOption.INCREMENTAL_KEY, "true", RepairOption.RANGES_KEY, "42:42"),
