Skip to content

Commit 984a265

Browse files
committed
Fix issue with incremental repair using new repair methods (issue #71)
1 parent e1eea2d commit 984a265

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<dropwizard.version>0.7.1</dropwizard.version>
15-
<dropwizard.cassandra.version>4.0.0</dropwizard.cassandra.version>
15+
<dropwizard.cassandra.version>3.0.2</dropwizard.cassandra.version>
1616
<cassandra.version>2.2.7</cassandra.version>
1717
<cucumber.version>1.1.5</cucumber.version>
1818
</properties>

resource/cassandra-reaper-cassandra.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ cassandra:
4949
clusterName: "test"
5050
contactPoints: ["127.0.0.1"]
5151
keyspace: reaper_db
52+
queryOptions:
53+
consistencyLevel: LOCAL_QUORUM
54+
serialConsistencyLevel: SERIAL
5255

5356
autoScheduling:
5457
enabled: false

src/main/java/com/spotify/reaper/cassandra/JmxProxy.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,9 @@ public int triggerRepairPost2dot2(boolean fullRepair, RepairParallelism repairPa
478478
options.put(RepairOption.TRACE_KEY, Boolean.toString(Boolean.FALSE));
479479
options.put(RepairOption.COLUMNFAMILIES_KEY, StringUtils.join(columnFamilies, ","));
480480
//options.put(RepairOption.PULL_REPAIR_KEY, Boolean.FALSE);
481-
options.put(RepairOption.RANGES_KEY, beginToken.toString() + ":" + endToken.toString());
481+
if (fullRepair) {
482+
options.put(RepairOption.RANGES_KEY, beginToken.toString() + ":" + endToken.toString());
483+
}
482484

483485
//options.put(RepairOption.DATACENTERS_KEY, StringUtils.join(specificDataCenters, ","));
484486
//options.put(RepairOption.HOSTS_KEY, StringUtils.join(specificHosts, ","));

src/main/java/com/spotify/reaper/service/SegmentRunner.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,8 @@ long intensityBasedDelayMillis(double intensity) {
522522
long repairDuration = repairEnd - repairStart;
523523
long delay = (long) (repairDuration / intensity - repairDuration);
524524
LOG.debug("Scheduling next runner run() with delay {} ms", delay);
525-
return delay;
525+
return delay>0?delay:1;
526+
526527
} else {
527528
LOG.error("Segment {} returned with startTime {} and endTime {}. This should not happen."
528529
+ "Intensity cannot apply, so next run will start immediately.",

0 commit comments

Comments
 (0)