Skip to content

Commit 3d14a39

Browse files
There must be at least one merge task blocked (#132496)
After triggering a force merge, there might still be other merge tasks running concurrently, so it is incorrect to assert a single merge is blocked in the test. Fix #131789 Co-authored-by: Patrick Doyle <[email protected]>
1 parent 7dbcd89 commit 3d14a39

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,6 @@ tests:
444444
- class: org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT
445445
method: test {p0=search/600_flattened_ignore_above/flattened ignore_above multi-value field}
446446
issue: https://github.com/elastic/elasticsearch/issues/131967
447-
- class: org.elasticsearch.index.engine.MergeWithLowDiskSpaceIT
448-
method: testRelocationWhileForceMerging
449-
issue: https://github.com/elastic/elasticsearch/issues/131789
450447
- class: org.elasticsearch.test.rest.yaml.MDPYamlTestSuiteIT
451448
method: test {yaml=mdp/10_basic/Index using shared data path}
452449
issue: https://github.com/elastic/elasticsearch/issues/132223

server/src/internalClusterTest/java/org/elasticsearch/index/engine/MergeWithLowDiskSpaceIT.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public void testForceMergeIsBlockedThenUnblocked() throws Exception {
196196
indexName,
197197
Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0).put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).build()
198198
);
199+
ensureGreen(indexName);
199200
// get current disk space usage (for all indices on the node)
200201
IndicesStatsResponse stats = indicesAdmin().prepareStats().clear().setStore(true).get();
201202
long usedDiskSpaceAfterIndexing = stats.getTotal().getStore().sizeInBytes();
@@ -286,6 +287,7 @@ public void testRelocationWhileForceMerging() throws Exception {
286287
indexName,
287288
Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0).put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).build()
288289
);
290+
ensureGreen(indexName);
289291
// get current disk space usage (for all indices on the node)
290292
IndicesStatsResponse stats = indicesAdmin().prepareStats().clear().setStore(true).get();
291293
long usedDiskSpaceAfterIndexing = stats.getTotal().getStore().sizeInBytes();
@@ -320,8 +322,8 @@ public void testRelocationWhileForceMerging() throws Exception {
320322
.getThreadPoolMergeExecutorService();
321323
TestTelemetryPlugin testTelemetryPlugin = getTelemetryPlugin(node1);
322324
assertBusy(() -> {
323-
// merge executor says merging is blocked due to insufficient disk space while there is a single merge task enqueued
324-
assertThat(threadPoolMergeExecutorService.getMergeTasksQueueLength(), equalTo(1));
325+
// merge executor says merging is blocked due to insufficient disk space
326+
assertThat(threadPoolMergeExecutorService.getMergeTasksQueueLength(), greaterThan(0));
325327
assertTrue(threadPoolMergeExecutorService.isMergingBlockedDueToInsufficientDiskSpace());
326328
// telemetry says that there are indeed some segments enqueued to be merged
327329
testTelemetryPlugin.collect();

0 commit comments

Comments
 (0)