Skip to content

Commit ac49402

Browse files
committed
Disable rebalancing in DataStreamLifecycleDownsampleDisruptionIT
We were seeing test failures here due by the relocation of some shards taking more than 30 seconds. This happened after downsampling had already completed, causing the `ensureGreen` at the end of the test to time out. The Distributed Coordination team suggested disabling shard rebalancing in this test (among other things, which have already been implemented). Fixes #131394
1 parent 1235efc commit ac49402

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,6 @@ tests:
390390
- class: org.elasticsearch.packaging.test.DockerTests
391391
method: test130JavaHasCorrectOwnership
392392
issue: https://github.com/elastic/elasticsearch/issues/131369
393-
- class: org.elasticsearch.xpack.downsample.DataStreamLifecycleDownsampleDisruptionIT
394-
method: testDataStreamLifecycleDownsampleRollingRestart
395-
issue: https://github.com/elastic/elasticsearch/issues/131394
396393
- class: org.elasticsearch.packaging.test.DockerTests
397394
method: test072RunEsAsDifferentUserAndGroup
398395
issue: https://github.com/elastic/elasticsearch/issues/131412

x-pack/plugin/downsample/src/internalClusterTest/java/org/elasticsearch/xpack/downsample/DataStreamLifecycleDownsampleDisruptionIT.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.elasticsearch.action.downsample.DownsampleConfig;
1515
import org.elasticsearch.cluster.metadata.DataStreamLifecycle;
1616
import org.elasticsearch.cluster.metadata.IndexMetadata;
17+
import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider;
1718
import org.elasticsearch.cluster.service.ClusterService;
1819
import org.elasticsearch.common.settings.Settings;
1920
import org.elasticsearch.core.TimeValue;
@@ -34,9 +35,12 @@ public class DataStreamLifecycleDownsampleDisruptionIT extends DownsamplingInteg
3435

3536
@Override
3637
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
37-
Settings.Builder settings = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings));
38-
settings.put(DataStreamLifecycleService.DATA_STREAM_LIFECYCLE_POLL_INTERVAL, "1s");
39-
return settings.build();
38+
return Settings.builder()
39+
.put(super.nodeSettings(nodeOrdinal, otherSettings))
40+
.put(DataStreamLifecycleService.DATA_STREAM_LIFECYCLE_POLL_INTERVAL, "1s")
41+
// We disable shard rebalancing to avoid shard relocations timing out the `ensureGreen` call at the end of the test. See #131394
42+
.put(EnableAllocationDecider.CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), "none")
43+
.build();
4044
}
4145

4246
public void testDataStreamLifecycleDownsampleRollingRestart() throws Exception {
@@ -85,7 +89,7 @@ public void testDataStreamLifecycleDownsampleRollingRestart() throws Exception {
8589

8690
ensureDownsamplingStatus(targetIndex, IndexMetadata.DownsampleTaskStatus.SUCCESS, TimeValue.timeValueSeconds(120));
8791
ensureGreen(targetIndex);
88-
logger.info("-> Relocation has finished");
92+
logger.info("-> Index is green and downsampling completed successfully.");
8993
}
9094

9195
private void ensureDownsamplingStatus(String downsampledIndex, IndexMetadata.DownsampleTaskStatus expectedStatus, TimeValue timeout) {

0 commit comments

Comments
 (0)