Reject incremental repair requests combined with subrange repair

Patch by Ariel Weisberg; reviewed by marcuse for CASSANDRA-10422
This commit is contained in:
Ariel Weisberg 2015-10-29 12:36:32 -04:00 committed by Marcus Eriksson
parent 7e056fa270
commit a8e8a67306
3 changed files with 10 additions and 0 deletions

View File

@ -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)

View File

@ -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 {}",

View File

@ -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, "");
}
}