Skip to content

Commit 4751a13

Browse files
Merge branch '9.0' into backport-90-fix-129149
2 parents 1c73381 + f71608f commit 4751a13

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,6 @@ tests:
279279
- class: org.elasticsearch.packaging.test.DockerTests
280280
method: test010Install
281281
issue: https://github.com/elastic/elasticsearch/issues/125680
282-
- class: org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceDiskSpaceTests
283-
method: testUnavailableBudgetBlocksNewMergeTasksFromStartingExecution
284-
issue: https://github.com/elastic/elasticsearch/issues/129148
285282
- class: org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceTests
286283
method: testIORateIsAdjustedForAllRunningMergeTasks
287284
issue: https://github.com/elastic/elasticsearch/issues/129531

server/src/test/java/org/elasticsearch/index/engine/ThreadPoolMergeExecutorServiceDiskSpaceTests.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ public void testUnavailableBudgetBlocksNewMergeTasksFromStartingExecution() thro
841841
when(mergeTask2.schedule()).thenReturn(RUN);
842842
boolean task1Runs = randomBoolean();
843843
long currentAvailableBudget = expectedAvailableBudget.get();
844+
// the over-budget here can be larger than the total initial available budget
844845
long overBudget = randomLongBetween(currentAvailableBudget + 1L, currentAvailableBudget + 100L);
845846
long underBudget = randomLongBetween(0L, currentAvailableBudget);
846847
if (task1Runs) {
@@ -876,11 +877,18 @@ public void testUnavailableBudgetBlocksNewMergeTasksFromStartingExecution() thro
876877
// update the expected budget given that one task now finished
877878
expectedAvailableBudget.set(expectedAvailableBudget.get() + completedMergeTask.estimatedRemainingMergeSize());
878879
}
879-
// let the test finish cleanly
880-
assertBusy(() -> {
881-
assertThat(threadPoolMergeExecutorService.getDiskSpaceAvailableForNewMergeTasks(), is(aHasMoreSpace ? 112_500L : 103_000L));
882-
assertThat(threadPoolMergeExecutorService.allDone(), is(true));
883-
});
880+
assertBusy(
881+
() -> assertThat(
882+
threadPoolMergeExecutorService.getDiskSpaceAvailableForNewMergeTasks(),
883+
is(aHasMoreSpace ? 112_500L : 103_000L)
884+
)
885+
);
886+
// let the test finish cleanly (some tasks can be over budget even if all the other tasks finished running)
887+
aFileStore.totalSpace = Long.MAX_VALUE;
888+
bFileStore.totalSpace = Long.MAX_VALUE;
889+
aFileStore.usableSpace = Long.MAX_VALUE;
890+
bFileStore.usableSpace = Long.MAX_VALUE;
891+
assertBusy(() -> assertThat(threadPoolMergeExecutorService.allDone(), is(true)));
884892
}
885893
if (setThreadPoolMergeSchedulerSetting) {
886894
assertWarnings(

x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/AutoscalingStorageIntegTestCase.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings;
1515
import org.elasticsearch.common.settings.Settings;
1616
import org.elasticsearch.datastreams.DataStreamsPlugin;
17+
import org.elasticsearch.index.engine.ThreadPoolMergeExecutorService;
1718
import org.elasticsearch.plugins.Plugin;
1819
import org.elasticsearch.xpack.autoscaling.LocalStateAutoscaling;
1920
import org.elasticsearch.xpack.autoscaling.action.GetAutoscalingCapacityAction;
@@ -39,7 +40,10 @@ protected Settings nodeSettings(final int nodeOrdinal, final Settings otherSetti
3940
builder.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), LOW_WATERMARK_BYTES + "b")
4041
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), HIGH_WATERMARK_BYTES + "b")
4142
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING.getKey(), "0b")
42-
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING.getKey(), "0ms");
43+
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING.getKey(), "0ms")
44+
// the periodicity for the checker for the available disk space as well as the merge tasks' aborting status
45+
// the default of 5 seconds might timeout some tests
46+
.put(ThreadPoolMergeExecutorService.INDICES_MERGE_DISK_CHECK_INTERVAL_SETTING.getKey(), "100ms");
4347
return builder.build();
4448
}
4549

0 commit comments

Comments
 (0)