Skip to content

Commit bbaf4ce

Browse files
authored
Replace OpenFollowerIndexStep with OpenIndexStep (#67254)
1 parent 01dc45a commit bbaf4ce

File tree

4 files changed

+8
-201
lines changed

4 files changed

+8
-201
lines changed

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

Lines changed: 0 additions & 45 deletions
This file was deleted.

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public final class UnfollowAction implements LifecycleAction {
3232

3333
public static final String NAME = "unfollow";
3434
public static final String CCR_METADATA_KEY = "ccr";
35+
static final String OPEN_FOLLOWER_INDEX_STEP_NAME = "open-follower-index";
3536

3637
public UnfollowAction() {}
3738

@@ -42,15 +43,17 @@ public List<Step> toSteps(Client client, String phase, StepKey nextStepKey) {
4243
StepKey pauseFollowerIndex = new StepKey(phase, NAME, PauseFollowerIndexStep.NAME);
4344
StepKey closeFollowerIndex = new StepKey(phase, NAME, CloseFollowerIndexStep.NAME);
4445
StepKey unfollowFollowerIndex = new StepKey(phase, NAME, UnfollowFollowerIndexStep.NAME);
45-
StepKey openFollowerIndex = new StepKey(phase, NAME, OpenFollowerIndexStep.NAME);
46+
// maintaining the `open-follower-index` here (as opposed to {@link OpenIndexStep#NAME}) for BWC reasons (in case any managed
47+
// index is in the `open-follower-index` step at upgrade time
48+
StepKey openFollowerIndex = new StepKey(phase, NAME, OPEN_FOLLOWER_INDEX_STEP_NAME);
4649
StepKey waitForYellowStep = new StepKey(phase, NAME, WaitForIndexColorStep.NAME);
4750

4851
WaitForIndexingCompleteStep step1 = new WaitForIndexingCompleteStep(indexingComplete, waitForFollowShardTasks);
4952
WaitForFollowShardTasksStep step2 = new WaitForFollowShardTasksStep(waitForFollowShardTasks, pauseFollowerIndex, client);
5053
PauseFollowerIndexStep step3 = new PauseFollowerIndexStep(pauseFollowerIndex, closeFollowerIndex, client);
5154
CloseFollowerIndexStep step4 = new CloseFollowerIndexStep(closeFollowerIndex, unfollowFollowerIndex, client);
5255
UnfollowFollowerIndexStep step5 = new UnfollowFollowerIndexStep(unfollowFollowerIndex, openFollowerIndex, client);
53-
OpenFollowerIndexStep step6 = new OpenFollowerIndexStep(openFollowerIndex, waitForYellowStep, client);
56+
OpenIndexStep step6 = new OpenIndexStep(openFollowerIndex, waitForYellowStep, client);
5457
WaitForIndexColorStep step7 = new WaitForIndexColorStep(waitForYellowStep, nextStepKey, ClusterHealthStatus.YELLOW);
5558
return Arrays.asList(step1, step2, step3, step4, step5, step6, step7);
5659
}

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

Lines changed: 0 additions & 152 deletions
This file was deleted.

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.io.IOException;
1414
import java.util.List;
1515

16+
import static org.elasticsearch.xpack.core.ilm.UnfollowAction.OPEN_FOLLOWER_INDEX_STEP_NAME;
1617
import static org.hamcrest.Matchers.equalTo;
1718
import static org.hamcrest.Matchers.is;
1819
import static org.hamcrest.Matchers.notNullValue;
@@ -48,7 +49,7 @@ public void testToSteps() {
4849
StepKey expectedThirdStepKey = new StepKey(phase, UnfollowAction.NAME, PauseFollowerIndexStep.NAME);
4950
StepKey expectedFourthStepKey = new StepKey(phase, UnfollowAction.NAME, CloseFollowerIndexStep.NAME);
5051
StepKey expectedFifthStepKey = new StepKey(phase, UnfollowAction.NAME, UnfollowFollowerIndexStep.NAME);
51-
StepKey expectedSixthStepKey = new StepKey(phase, UnfollowAction.NAME, OpenFollowerIndexStep.NAME);
52+
StepKey expectedSixthStepKey = new StepKey(phase, UnfollowAction.NAME, OPEN_FOLLOWER_INDEX_STEP_NAME);
5253
StepKey expectedSeventhStepKey = new StepKey(phase, UnfollowAction.NAME, WaitForIndexColorStep.NAME);
5354

5455
WaitForIndexingCompleteStep firstStep = (WaitForIndexingCompleteStep) steps.get(0);
@@ -71,7 +72,7 @@ public void testToSteps() {
7172
assertThat(fifthStep.getKey(), equalTo(expectedFifthStepKey));
7273
assertThat(fifthStep.getNextStepKey(), equalTo(expectedSixthStepKey));
7374

74-
OpenFollowerIndexStep sixthStep = (OpenFollowerIndexStep) steps.get(5);
75+
OpenIndexStep sixthStep = (OpenIndexStep) steps.get(5);
7576
assertThat(sixthStep.getKey(), equalTo(expectedSixthStepKey));
7677
assertThat(sixthStep.getNextStepKey(), equalTo(expectedSeventhStepKey));
7778

0 commit comments

Comments
 (0)