Skip to content

Commit

Permalink
Set segment count per node to consistent value across defaults and do…
Browse files Browse the repository at this point in the history
…cs (#1477)

* Set segment count per node to consistent value across defaults and docs
Per #1192
the default should be 64.  So, set that everywhere, including docs

* Also fix test that assumed 16-segment default

* Properly fix computeGlobalSegmentCount256TokenPerNodeTest
After reading the actual function, this makes more sense as a fix.

* Also fix computeGlobalSegmentCountSingleTokenPerNodeTest
  • Loading branch information
SesquipedalianDefenestrator authored Mar 11, 2024
1 parent 7ced912 commit d439ad9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/docs/configuration/reaper_specific/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ <h3 id="scheduledaysbetween"><code>scheduleDaysBetween</code></h3>
<!-- raw HTML omitted -->
<h3 id="segmentcountpernode"><code>segmentCountPerNode</code></h3>
<p>Type: <em>Integer</em></p>
<p>Default: <em>16</em></p>
<p>Default: <em>64</em></p>
<p>Defines the default amount of repair segments to create for newly registered Cassandra repair runs, for each node in the cluster. When running a repair run by Reaper, each segment is repaired separately by the Reaper process, until all the segments in a token ring are repaired. The count might be slightly off the defined value, as clusters residing in multiple data centers require additional small token ranges in addition to the expected. This value can be overwritten when executing a repair run via Reaper.</p>
<p>In a 10 nodes cluster, setting a value of 20 segments per node will generate a repair run that splits the work into 200 token subranges. This number can vary due to vnodes (before 1.2.0, Reaper cannot create a segment with multiple token ranges, so the number of segments will be at least the total number of vnodes in the cluster). As Reaper tries to size segments evenly, the presence of very small token ranges can lead to have more segments than expected.</p>
<!-- raw HTML omitted -->
Expand Down
2 changes: 1 addition & 1 deletion src/docs/content/docs/configuration/reaper_specific.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Defines the amount of days to wait between scheduling new repairs. The value con

Type: *Integer*

Default: *16*
Default: *64*

Defines the default amount of repair segments to create for newly registered Cassandra repair runs, for each node in the cluster. When running a repair run by Reaper, each segment is repaired separately by the Reaper process, until all the segments in a token ring are repaired. The count might be slightly off the defined value, as clusters residing in multiple data centers require additional small token ranges in addition to the expected. This value can be overwritten when executing a repair run via Reaper.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public final class RepairRunService {

public static final Splitter COMMA_SEPARATED_LIST_SPLITTER
= Splitter.on(',').trimResults(CharMatcher.anyOf(" ()[]\"'")).omitEmptyStrings();
public static final int DEFAULT_SEGMENT_COUNT_PER_NODE = 16;
public static final int DEFAULT_SEGMENT_COUNT_PER_NODE = 64;

private static final Logger LOG = LoggerFactory.getLogger(RepairRunService.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void computeGlobalSegmentCountSingleTokenPerNodeTest() {
endpointToRange.put("node2", Lists.newArrayList());
endpointToRange.put("node3", Lists.newArrayList());

assertEquals(48, RepairRunService.computeGlobalSegmentCount(0, endpointToRange));
assertEquals(192, RepairRunService.computeGlobalSegmentCount(0, endpointToRange));
}

@Test
Expand All @@ -206,7 +206,7 @@ public void computeGlobalSegmentCount256TokenPerNodeTest() {
endpointToRange.put("node2", Lists.newArrayList());
endpointToRange.put("node3", Lists.newArrayList());

assertEquals(48, RepairRunService.computeGlobalSegmentCount(0, endpointToRange));
assertEquals(192, RepairRunService.computeGlobalSegmentCount(0, endpointToRange));
}

@Test
Expand Down

0 comments on commit d439ad9

Please sign in to comment.