Skip to content

Commit 0c78109

Browse files
authored
Disable rebalancing in DataStreamLifecycleDownsampleDisruptionIT (#133036) (#133434)
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 (cherry picked from commit 7519de6) # Conflicts: # muted-tests.yml
1 parent c000e55 commit 0c78109

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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)