Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark node seen task as successful #106502

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public void testShardStatusStaysCompleteAfterNodeLeaves() throws Exception {
* Similar to the previous test, but ensures that the status stays at `COMPLETE` when the node is offline when the shutdown is
* registered. This may happen if {@link NodeSeenService} isn't working as expected.
*/
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/76689")
public void testShardStatusStaysCompleteAfterNodeLeavesIfRegisteredWhileNodeOffline() throws Exception {
assumeTrue("must be on a snapshot build of ES to run in order for the feature flag to be set", Build.current().isSnapshot());
final String nodeToRestartName = internalCluster().startNode();
Expand All @@ -88,11 +87,12 @@ public Settings onNodeStopped(String nodeName) throws Exception {
});

internalCluster().stopNode(nodeToRestartName);
putNodeShutdown(nodeToRestartId, SingleNodeShutdownMetadata.Type.REMOVE, null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to have a call to putNodeShutdown here and in the onNodeStopped callback? Aren't we just shutting it down once?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that was not intended

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in eb7e612


NodesInfoResponse nodes = clusterAdmin().prepareNodesInfo().clear().get();
assertThat(nodes.getNodes().size(), equalTo(1));

assertNodeShutdownStatus(nodeToRestartId, COMPLETE);
assertBusy(() -> { assertNodeShutdownStatus(nodeToRestartId, COMPLETE); });
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public ClusterState execute(BatchExecutionContext<SetSeenNodesShutdownTask> batc
var nodesNotPreviouslySeen = new HashSet<>();
for (final var taskContext : batchExecutionContext.taskContexts()) {
nodesNotPreviouslySeen.addAll(taskContext.getTask().nodesNotPreviouslySeen());
taskContext.success(() -> {});
}

var nodes = initialState.nodes();
Expand Down