Repository: cassandra Updated Branches: refs/heads/cassandra-3.1 36e767714 -> 798a7a8fe
Reject incremental repair requests combined with subrange repair Patch by Ariel Weisberg; reviewed by marcuse for CASSANDRA-10422 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a8e8a673 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a8e8a673 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a8e8a673 Branch: refs/heads/cassandra-3.1 Commit: a8e8a67306c0b26b8fe9c74a1fb00bacfa224cf7 Parents: 7e056fa Author: Ariel Weisberg <ariel.weisb...@datastax.com> Authored: Thu Oct 29 12:36:32 2015 -0400 Committer: Marcus Eriksson <marc...@apache.org> Committed: Tue Nov 17 09:57:15 2015 +0100 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/service/StorageService.java | 3 +++ .../org/apache/cassandra/service/StorageServiceServerTest.java | 6 ++++++ 3 files changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8e8a673/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 2eeda94..b6b394a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.1.12 + * Reject incremental repair with subrange repair (CASSANDRA-10422) * Add a nodetool command to refresh size_estimates (CASSANDRA-9579) * Shutdown compaction in drain to prevent leak (CASSANDRA-10079) * Invalidate cache after stream receive task is completed (CASSANDRA-10341) http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8e8a673/src/java/org/apache/cassandra/service/StorageService.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index 665ce3a..03c1960 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -2830,6 +2830,9 @@ public class StorageService extends NotificationBroadcasterSupport implements IE public int forceRepairRangeAsync(String beginToken, String endToken, String keyspaceName, boolean isSequential, boolean isLocal, boolean fullRepair, String... columnFamilies) { + if (!fullRepair) + throw new IllegalArgumentException("Incremental repair can't be requested with subrange repair because " + + "each subrange repair would generate an anti-compacted table"); Collection<Range<Token>> repairingRange = createRepairRangeFrom(beginToken, endToken); logger.info("starting user-requested repair of range {} for keyspace {} and column families {}", http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8e8a673/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java b/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java index dd25b35..564239b 100644 --- a/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java +++ b/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java @@ -508,4 +508,10 @@ public class StorageServiceServerTest repairRangeFrom = StorageService.instance.createRepairRangeFrom("2000", "2000"); assert repairRangeFrom.size() == 0; } + + @Test(expected=IllegalArgumentException.class) + public void testIncrementalRepairWithSubrangesThrows() throws Exception + { + StorageService.instance.forceRepairRangeAsync("", "", "", true, true, false, ""); + } }