Skip to content

Commit 84664e8

Browse files
authored
Expose master timeout for ILM actions (elastic#51130) (elastic#51348)
This change exposes master timeout to ILM steps through global dynamic setting. All currently implemented steps make use of this setting as well. Closes elastic#44136
1 parent acf84b6 commit 84664e8

33 files changed

+272
-172
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AsyncActionStep.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import org.elasticsearch.cluster.ClusterState;
1010
import org.elasticsearch.cluster.ClusterStateObserver;
1111
import org.elasticsearch.cluster.metadata.IndexMetaData;
12+
import org.elasticsearch.common.unit.TimeValue;
13+
14+
import java.util.Objects;
1215

1316
/**
1417
* Performs an action which must be performed asynchronously because it may take time to complete.
@@ -26,6 +29,16 @@ protected Client getClient() {
2629
return client;
2730
}
2831

32+
//visible for testing
33+
void setClient(Client client){
34+
this.client = client;
35+
}
36+
37+
public static TimeValue getMasterTimeout(ClusterState clusterState){
38+
Objects.requireNonNull(clusterState, "cannot determine master timeout when cluster state is null");
39+
return LifecycleSettings.LIFECYCLE_STEP_MASTER_TIMEOUT_SETTING.get(clusterState.metaData().settings());
40+
}
41+
2942
public boolean indexSurvives() {
3043
return true;
3144
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AsyncWaitStep.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import org.elasticsearch.client.Client;
99
import org.elasticsearch.cluster.metadata.IndexMetaData;
10+
import org.elasticsearch.common.unit.TimeValue;
1011
import org.elasticsearch.common.xcontent.ToXContentObject;
1112

1213
/**
@@ -28,11 +29,11 @@ protected Client getClient() {
2829
return client;
2930
}
3031

31-
public abstract void evaluateCondition(IndexMetaData indexMetaData, Listener listener);
32+
public abstract void evaluateCondition(IndexMetaData indexMetaData, Listener listener, TimeValue masterTimeout);
3233

3334
public interface Listener {
3435

35-
void onResponse(boolean conditionMet, ToXContentObject infomationContext);
36+
void onResponse(boolean conditionMet, ToXContentObject informationContext);
3637

3738
void onFailure(Exception e);
3839
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CloseFollowerIndexStep.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ void performDuringNoSnapshot(IndexMetaData indexMetaData, ClusterState currentCl
3333
}
3434

3535
if (indexMetaData.getState() == IndexMetaData.State.OPEN) {
36-
CloseIndexRequest closeIndexRequest = new CloseIndexRequest(followerIndex);
36+
CloseIndexRequest closeIndexRequest = new CloseIndexRequest(followerIndex)
37+
.masterNodeTimeout(getMasterTimeout(currentClusterState));
3738
getClient().admin().indices().close(closeIndexRequest, ActionListener.wrap(
3839
r -> {
3940
assert r.isAcknowledged() : "close index response is not acknowledged";

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public DeleteStep(StepKey key, StepKey nextStepKey, Client client) {
2424
@Override
2525
public void performDuringNoSnapshot(IndexMetaData indexMetaData, ClusterState currentState, Listener listener) {
2626
getClient().admin().indices()
27-
.delete(new DeleteIndexRequest(indexMetaData.getIndex().getName()),
27+
.delete(new DeleteIndexRequest(indexMetaData.getIndex().getName()).masterNodeTimeout(getMasterTimeout(currentState)),
2828
ActionListener.wrap(response -> listener.onResponse(true), listener::onFailure));
2929
}
3030

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/FreezeStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public FreezeStep(StepKey key, StepKey nextStepKey, Client client) {
2525
@Override
2626
public void performDuringNoSnapshot(IndexMetaData indexMetaData, ClusterState currentState, Listener listener) {
2727
getClient().admin().indices().execute(FreezeIndexAction.INSTANCE,
28-
new FreezeRequest(indexMetaData.getIndex().getName()),
28+
new FreezeRequest(indexMetaData.getIndex().getName()).masterNodeTimeout(getMasterTimeout(currentState)),
2929
ActionListener.wrap(response -> listener.onResponse(true), listener::onFailure));
3030
}
3131
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecycleSettings.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class LifecycleSettings {
2020
public static final String LIFECYCLE_ORIGINATION_DATE = "index.lifecycle.origination_date";
2121
public static final String LIFECYCLE_PARSE_ORIGINATION_DATE = "index.lifecycle.parse_origination_date";
2222
public static final String LIFECYCLE_HISTORY_INDEX_ENABLED = "index.lifecycle.history_index_enabled";
23+
public static final String LIFECYCLE_STEP_MASTER_TIMEOUT = "index.lifecycle.step.master_timeout";
2324

2425
public static final String SLM_HISTORY_INDEX_ENABLED = "slm.history_index_enabled";
2526
public static final String SLM_RETENTION_SCHEDULE = "slm.retention_schedule";
@@ -38,7 +39,9 @@ public class LifecycleSettings {
3839
false, Setting.Property.Dynamic, Setting.Property.IndexScope);
3940
public static final Setting<Boolean> LIFECYCLE_HISTORY_INDEX_ENABLED_SETTING = Setting.boolSetting(LIFECYCLE_HISTORY_INDEX_ENABLED,
4041
true, Setting.Property.NodeScope);
41-
42+
public static final Setting<TimeValue> LIFECYCLE_STEP_MASTER_TIMEOUT_SETTING =
43+
Setting.positiveTimeSetting(LIFECYCLE_STEP_MASTER_TIMEOUT, TimeValue.timeValueSeconds(30), Setting.Property.Dynamic,
44+
Setting.Property.NodeScope);
4245

4346
public static final Setting<Boolean> SLM_HISTORY_INDEX_ENABLED_SETTING = Setting.boolSetting(SLM_HISTORY_INDEX_ENABLED, true,
4447
Setting.Property.NodeScope);

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/OpenFollowerIndexStep.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ final class OpenFollowerIndexStep extends AsyncActionStep {
2424
public void performAction(IndexMetaData indexMetaData, ClusterState currentClusterState,
2525
ClusterStateObserver observer, Listener listener) {
2626
if (indexMetaData.getState() == IndexMetaData.State.CLOSE) {
27-
OpenIndexRequest request = new OpenIndexRequest(indexMetaData.getIndex().getName());
27+
OpenIndexRequest request = new OpenIndexRequest(indexMetaData.getIndex().getName())
28+
.masterNodeTimeout(getMasterTimeout(currentClusterState));
2829
getClient().admin().indices().open(request, ActionListener.wrap(
2930
r -> {
3031
assert r.isAcknowledged() : "open index response is not acknowledged";

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverStep.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ public void performAction(IndexMetaData indexMetaData, ClusterState currentClust
7070
}
7171

7272
// Calling rollover with no conditions will always roll over the index
73-
RolloverRequest rolloverRequest = new RolloverRequest(rolloverAlias, null);
73+
RolloverRequest rolloverRequest = new RolloverRequest(rolloverAlias, null)
74+
.masterNodeTimeout(getMasterTimeout(currentClusterState));
7475
// We don't wait for active shards when we perform the rollover because the
7576
// {@link org.elasticsearch.xpack.core.ilm.WaitForActiveShardsStep} step will do so
7677
rolloverRequest.setWaitForActiveShards(ActiveShardCount.NONE);

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SegmentCountStep.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.elasticsearch.cluster.routing.ShardRouting;
1818
import org.elasticsearch.common.ParseField;
1919
import org.elasticsearch.common.Strings;
20+
import org.elasticsearch.common.unit.TimeValue;
2021
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
2122
import org.elasticsearch.common.xcontent.ToXContentObject;
2223
import org.elasticsearch.common.xcontent.XContentBuilder;
@@ -48,7 +49,7 @@ public int getMaxNumSegments() {
4849
}
4950

5051
@Override
51-
public void evaluateCondition(IndexMetaData indexMetaData, Listener listener) {
52+
public void evaluateCondition(IndexMetaData indexMetaData, Listener listener, TimeValue masterTimeout) {
5253
getClient().admin().indices().segments(new IndicesSegmentsRequest(indexMetaData.getIndex().getName()),
5354
ActionListener.wrap(response -> {
5455
IndexSegments idxSegments = response.getIndices().get(indexMetaData.getIndex().getName());

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetSingleNodeAllocateStep.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public void performAction(IndexMetaData indexMetaData, ClusterState clusterState
8484
Settings settings = Settings.builder()
8585
.put(IndexMetaData.INDEX_ROUTING_REQUIRE_GROUP_SETTING.getKey() + "_id", nodeId.get()).build();
8686
UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest(indexMetaData.getIndex().getName())
87+
.masterNodeTimeout(getMasterTimeout(clusterState))
8788
.settings(settings);
8889
getClient().admin().indices().updateSettings(updateSettingsRequest,
8990
ActionListener.wrap(response -> listener.onResponse(true), listener::onFailure));

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrinkSetAliasStep.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public void performDuringNoSnapshot(IndexMetaData indexMetaData, ClusterState cu
3838
// get target shrink index
3939
String targetIndexName = shrunkIndexPrefix + index;
4040
IndicesAliasesRequest aliasesRequest = new IndicesAliasesRequest()
41+
.masterNodeTimeout(getMasterTimeout(currentState))
4142
.addAliasAction(IndicesAliasesRequest.AliasActions.removeIndex().index(index))
4243
.addAliasAction(IndicesAliasesRequest.AliasActions.add().index(targetIndexName).alias(index));
4344
// copy over other aliases from original index

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrinkStep.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public void performAction(IndexMetaData indexMetaData, ClusterState currentState
5757
.build();
5858

5959
String shrunkenIndexName = shrunkIndexPrefix + indexMetaData.getIndex().getName();
60-
ResizeRequest resizeRequest = new ResizeRequest(shrunkenIndexName, indexMetaData.getIndex().getName());
60+
ResizeRequest resizeRequest = new ResizeRequest(shrunkenIndexName, indexMetaData.getIndex().getName())
61+
.masterNodeTimeout(getMasterTimeout(currentState));
6162
resizeRequest.getTargetIndexRequest().settings(relevantTargetSettings);
6263

6364
getClient().admin().indices().resizeIndex(resizeRequest, ActionListener.wrap(response -> {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/UpdateSettingsStep.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ public boolean isRetryable() {
3535

3636
@Override
3737
public void performAction(IndexMetaData indexMetaData, ClusterState currentState, ClusterStateObserver observer, Listener listener) {
38-
UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest(indexMetaData.getIndex().getName()).settings(settings);
38+
UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest(indexMetaData.getIndex().getName())
39+
.masterNodeTimeout(getMasterTimeout(currentState))
40+
.settings(settings);
3941
getClient().admin().indices().updateSettings(updateSettingsRequest,
4042
ActionListener.wrap(response -> listener.onResponse(true), listener::onFailure));
4143
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStep.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.elasticsearch.cluster.metadata.IndexMetaData;
1111
import org.elasticsearch.common.ParseField;
1212
import org.elasticsearch.common.Strings;
13+
import org.elasticsearch.common.unit.TimeValue;
1314
import org.elasticsearch.common.xcontent.ToXContentObject;
1415
import org.elasticsearch.common.xcontent.XContentBuilder;
1516
import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus;
@@ -32,7 +33,7 @@ final class WaitForFollowShardTasksStep extends AsyncWaitStep {
3233
}
3334

3435
@Override
35-
public void evaluateCondition(IndexMetaData indexMetaData, Listener listener) {
36+
public void evaluateCondition(IndexMetaData indexMetaData, Listener listener, TimeValue masterTimeout) {
3637
Map<String, String> customIndexMetadata = indexMetaData.getCustomData(CCR_METADATA_KEY);
3738
if (customIndexMetadata == null) {
3839
listener.onResponse(true, null);

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForNoFollowersStep.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.elasticsearch.client.Client;
1616
import org.elasticsearch.cluster.metadata.IndexMetaData;
1717
import org.elasticsearch.common.ParseField;
18+
import org.elasticsearch.common.unit.TimeValue;
1819
import org.elasticsearch.common.xcontent.ToXContentObject;
1920
import org.elasticsearch.common.xcontent.XContentBuilder;
2021

@@ -42,7 +43,7 @@ public class WaitForNoFollowersStep extends AsyncWaitStep {
4243
}
4344

4445
@Override
45-
public void evaluateCondition(IndexMetaData indexMetaData, Listener listener) {
46+
public void evaluateCondition(IndexMetaData indexMetaData, Listener listener, TimeValue masterTimeout) {
4647
IndicesStatsRequest request = new IndicesStatsRequest();
4748
request.clear();
4849
String indexName = indexMetaData.getIndex().getName();

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStep.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public boolean isRetryable() {
4848
}
4949

5050
@Override
51-
public void evaluateCondition(IndexMetaData indexMetaData, Listener listener) {
51+
public void evaluateCondition(IndexMetaData indexMetaData, Listener listener, TimeValue masterTimeout) {
5252
String rolloverAlias = RolloverAction.LIFECYCLE_ROLLOVER_ALIAS_SETTING.get(indexMetaData.getSettings());
5353

5454
if (Strings.isNullOrEmpty(rolloverAlias)) {
@@ -113,7 +113,7 @@ public void evaluateCondition(IndexMetaData indexMetaData, Listener listener) {
113113
"index [%s] is not the write index for alias [%s]", indexMetaData.getIndex().getName(), rolloverAlias)));
114114
}
115115

116-
RolloverRequest rolloverRequest = new RolloverRequest(rolloverAlias, null);
116+
RolloverRequest rolloverRequest = new RolloverRequest(rolloverAlias, null).masterNodeTimeout(masterTimeout);
117117
rolloverRequest.dryRun(true);
118118
if (maxAge != null) {
119119
rolloverRequest.addMaxIndexAgeCondition(maxAge);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
package org.elasticsearch.xpack.core.ilm;
7+
8+
import org.elasticsearch.action.ActionListener;
9+
import org.elasticsearch.action.ActionRequest;
10+
import org.elasticsearch.action.ActionResponse;
11+
import org.elasticsearch.action.ActionType;
12+
import org.elasticsearch.action.support.master.MasterNodeRequest;
13+
import org.elasticsearch.cluster.ClusterName;
14+
import org.elasticsearch.cluster.ClusterState;
15+
import org.elasticsearch.cluster.metadata.IndexMetaData;
16+
import org.elasticsearch.cluster.metadata.MetaData;
17+
import org.elasticsearch.common.settings.Settings;
18+
import org.elasticsearch.common.unit.TimeValue;
19+
import org.elasticsearch.test.client.NoOpClient;
20+
import org.elasticsearch.threadpool.TestThreadPool;
21+
import org.elasticsearch.threadpool.ThreadPool;
22+
import org.junit.After;
23+
import org.junit.Before;
24+
25+
import static org.elasticsearch.xpack.core.ilm.LifecycleSettings.LIFECYCLE_STEP_MASTER_TIMEOUT;
26+
import static org.hamcrest.Matchers.equalTo;
27+
28+
public abstract class AbstractStepMasterTimeoutTestCase<T extends AsyncActionStep> extends AbstractStepTestCase<T> {
29+
30+
protected ThreadPool pool;
31+
32+
@Before
33+
public void setupThreadPool() {
34+
pool = new TestThreadPool("timeoutTestPool");
35+
}
36+
37+
@After
38+
public void shutdownThreadPool() {
39+
pool.shutdownNow();
40+
}
41+
42+
public void testMasterTimeout() {
43+
checkMasterTimeout(TimeValue.timeValueSeconds(30),
44+
ClusterState.builder(ClusterName.DEFAULT).metaData(MetaData.builder().build()).build());
45+
checkMasterTimeout(TimeValue.timeValueSeconds(10),
46+
ClusterState.builder(ClusterName.DEFAULT)
47+
.metaData(MetaData.builder()
48+
.persistentSettings(Settings.builder().put(LIFECYCLE_STEP_MASTER_TIMEOUT, "10s").build())
49+
.build())
50+
.build());
51+
}
52+
53+
private void checkMasterTimeout(TimeValue timeValue, ClusterState currentClusterState) {
54+
T instance = createRandomInstance();
55+
instance.setClient(new NoOpClient(pool) {
56+
@Override
57+
protected <Request extends ActionRequest, Response extends ActionResponse> void doExecute(ActionType<Response> action,
58+
Request request,
59+
ActionListener<Response> listener) {
60+
if (request instanceof MasterNodeRequest) {
61+
assertThat(((MasterNodeRequest<?>) request).masterNodeTimeout(), equalTo(timeValue));
62+
}
63+
}
64+
});
65+
instance.performAction(getIndexMetaData(), currentClusterState, null, new AsyncActionStep.Listener() {
66+
@Override
67+
public void onResponse(boolean complete) {
68+
69+
}
70+
71+
@Override
72+
public void onFailure(Exception e) {
73+
74+
}
75+
});
76+
}
77+
78+
protected abstract IndexMetaData getIndexMetaData();
79+
80+
public static ClusterState emptyClusterState() {
81+
return ClusterState.builder(ClusterName.DEFAULT).build();
82+
}
83+
}

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/AbstractStepTestCase.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
*/
66
package org.elasticsearch.xpack.core.ilm;
77

8+
import org.elasticsearch.common.unit.TimeValue;
89
import org.elasticsearch.test.ESTestCase;
910
import org.elasticsearch.test.EqualsHashCodeTestUtils;
1011
import org.elasticsearch.xpack.core.ilm.Step.StepKey;
1112

1213
public abstract class AbstractStepTestCase<T extends Step> extends ESTestCase {
1314

1415
protected static final int NUMBER_OF_TEST_RUNS = 20;
16+
protected static final TimeValue MASTER_TIMEOUT = TimeValue.timeValueSeconds(30);
1517

1618
protected abstract T createRandomInstance();
1719
protected abstract T mutateInstance(T instance);

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/CloseFollowerIndexStepTests.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,20 @@
2323
import static org.hamcrest.Matchers.nullValue;
2424
import static org.hamcrest.Matchers.sameInstance;
2525

26-
public class CloseFollowerIndexStepTests extends AbstractStepTestCase<CloseFollowerIndexStep> {
26+
public class CloseFollowerIndexStepTests extends AbstractStepMasterTimeoutTestCase<CloseFollowerIndexStep> {
2727

28-
public void testCloseFollowingIndex() {
29-
IndexMetaData indexMetadata = IndexMetaData.builder("follower-index")
28+
@Override
29+
protected IndexMetaData getIndexMetaData() {
30+
return IndexMetaData.builder("follower-index")
3031
.settings(settings(Version.CURRENT).put(LifecycleSettings.LIFECYCLE_INDEXING_COMPLETE, "true"))
3132
.putCustom(CCR_METADATA_KEY, Collections.emptyMap())
3233
.numberOfShards(1)
3334
.numberOfReplicas(0)
3435
.build();
36+
}
37+
38+
public void testCloseFollowingIndex() {
39+
IndexMetaData indexMetadata = getIndexMetaData();
3540

3641
Client client = Mockito.mock(Client.class);
3742
AdminClient adminClient = Mockito.mock(AdminClient.class);
@@ -51,7 +56,7 @@ public void testCloseFollowingIndex() {
5156
Boolean[] completed = new Boolean[1];
5257
Exception[] failure = new Exception[1];
5358
CloseFollowerIndexStep step = new CloseFollowerIndexStep(randomStepKey(), randomStepKey(), client);
54-
step.performAction(indexMetadata, null, null, new AsyncActionStep.Listener() {
59+
step.performAction(indexMetadata, emptyClusterState(), null, new AsyncActionStep.Listener() {
5560
@Override
5661
public void onResponse(boolean complete) {
5762
completed[0] = complete;
@@ -67,12 +72,7 @@ public void onFailure(Exception e) {
6772
}
6873

6974
public void testCloseFollowingIndexFailed() {
70-
IndexMetaData indexMetadata = IndexMetaData.builder("follower-index")
71-
.settings(settings(Version.CURRENT).put(LifecycleSettings.LIFECYCLE_INDEXING_COMPLETE, "true"))
72-
.putCustom(CCR_METADATA_KEY, Collections.emptyMap())
73-
.numberOfShards(1)
74-
.numberOfReplicas(0)
75-
.build();
75+
IndexMetaData indexMetadata = getIndexMetaData();
7676

7777
// Mock pause follow api call:
7878
Client client = Mockito.mock(Client.class);
@@ -93,7 +93,7 @@ public void testCloseFollowingIndexFailed() {
9393
Boolean[] completed = new Boolean[1];
9494
Exception[] failure = new Exception[1];
9595
CloseFollowerIndexStep step = new CloseFollowerIndexStep(randomStepKey(), randomStepKey(), client);
96-
step.performAction(indexMetadata, null, null, new AsyncActionStep.Listener() {
96+
step.performAction(indexMetadata, emptyClusterState(), null, new AsyncActionStep.Listener() {
9797
@Override
9898
public void onResponse(boolean complete) {
9999
completed[0] = complete;

0 commit comments

Comments
 (0)