Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ protected Settings nodeSettings() {
.put(ThreadPoolMergeScheduler.USE_THREAD_POOL_MERGE_SCHEDULER_SETTING.getKey(), true)
// when there are more threads than scheduler(s)' concurrency capacity, excess merges will be backlogged
// alternatively, when scheduler(s)' concurrency capacity exceeds the executor's thread count, excess merges will be enqueued
.put(EsExecutors.NODE_PROCESSORS_SETTING.getKey(), MERGE_SCHEDULER_MAX_CONCURRENCY + randomFrom(-2, -1, 0, 1, 2))
.put(
EsExecutors.NODE_PROCESSORS_SETTING.getKey(),
Math.min(MERGE_SCHEDULER_MAX_CONCURRENCY + randomFrom(-2, -1, 0, 1, 2), Runtime.getRuntime().availableProcessors())
)
.build();
}

Expand All @@ -87,6 +90,7 @@ class TestInternalEngine extends org.elasticsearch.index.engine.InternalEngine {
super(engineConfig);
}

@Override
protected ElasticsearchMergeScheduler createMergeScheduler(
ShardId shardId,
IndexSettings indexSettings,
Expand Down Expand Up @@ -257,7 +261,7 @@ public void testMergingFallsBehindAndThenCatchesUp() throws Exception {
assertBusy(() -> {
// wait for merges to enqueue or backlog
assertThat(testEnginePlugin.enqueuedMergesSet.size(), greaterThanOrEqualTo(testEnginePlugin.waitMergesEnqueuedCount));
}, 1, TimeUnit.MINUTES);
}, 10, TimeUnit.MINUTES);
// finish up indexing
indexingDone.set(true);
for (Thread indexingThread : indexingThreads) {
Expand All @@ -273,7 +277,7 @@ public void testMergingFallsBehindAndThenCatchesUp() throws Exception {
assertThat(testEnginePlugin.runningMergesSet.size(), is(0));
assertThat(testEnginePlugin.enqueuedMergesSet.size(), is(0));
testEnginePlugin.mergeExecutorServiceReference.get().allDone();
}, 1, TimeUnit.MINUTES);
}, 10, TimeUnit.MINUTES);
// indices stats says that no merge is currently running (meaning merging did catch up)
IndicesStatsResponse indicesStatsResponse = client().admin().indices().prepareStats("index").setMerge(true).get();
long currentMergeCount = indicesStatsResponse.getIndices().get("index").getPrimaries().merge.getCurrent();
Expand Down