Skip to content

Commit

Permalink
Core: fix SerialMergeScheduler to trigger index throttling
Browse files Browse the repository at this point in the history
SerialMergeScheduler (deprecated but still accepted, and randomly
picked by tests) was failing to cause index throttling when merges
were falling behind.  This could then cause "Delete Index failed - not
acked" timeouts when it took more than 30 seconds to close the index.

Closes elastic#8405
  • Loading branch information
mikemccand committed Nov 9, 2014
1 parent 02a0d0c commit c07e0ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Expand Up @@ -56,7 +56,7 @@ public SerialMergeSchedulerProvider(ShardId shardId, @IndexSettings Settings ind

@Override
public int getMaxMerges() {
return 2;
return 1;
}

@Override
Expand Down Expand Up @@ -90,7 +90,7 @@ public void close() {

}

/** NOTE: subclasses TrackingCONCURRENTMergeScheduler, but we set max_merge_count = max_thread_count = 1 above */
/** NOTE: subclasses TrackingCONCURRENTMergeScheduler, but we set max_merge_count = 2 and max_thread_count = 1, above */
public static class CustomSerialMergeScheduler extends TrackingConcurrentMergeScheduler {

private final ShardId shardId;
Expand Down
Expand Up @@ -358,13 +358,9 @@ public void throttleStats() throws Exception {
//nodesStats = client().admin().cluster().prepareNodesStats().setIndices(true).get();
done = stats.getPrimaries().getIndexing().getTotal().getThrottleTimeInMillis() > 0;
if (System.currentTimeMillis() - start > 300*1000) { //Wait 5 minutes for throttling to kick in
break;
fail("index throttling didn't kick in after 5 minutes of intense merging");
}
}
stats = client().admin().indices().prepareStats().execute().actionGet();
if (done) {
assertThat(stats.getPrimaries().getIndexing().getTotal().getThrottleTimeInMillis(), greaterThan(0l));
}
}

@Test
Expand Down

0 comments on commit c07e0ae

Please sign in to comment.