Skip to content

Commit 61bd21c

Browse files
authored
Fix shutdown-metadata-related flakiness in SnapshotStressTestsIT (#109049)
We must not mark the master for shutdown since this triggers a master failover, and we must keep all the blocks in place until the mark/unmark sequence is complete. Also adds some logging around shutdown metadata manipulation. Found while investigating #108907 although this doesn't fix that issue.
1 parent 3f205f2 commit 61bd21c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStressTestsIT.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,12 @@ private void startNodeShutdownMarker() {
11891189

11901190
final var clusterService = cluster.getCurrentMasterNodeInstance(ClusterService.class);
11911191

1192+
if (node.nodeName.equals(clusterService.localNode().getName())) {
1193+
return;
1194+
}
1195+
1196+
logger.info("--> marking [{}] for removal", node);
1197+
11921198
SubscribableListener
11931199

11941200
.<Void>newForked(
@@ -1252,12 +1258,15 @@ public void onFailure(Exception e) {
12521258
@Override
12531259
public void clusterStateProcessed(ClusterState initialState, ClusterState newState) {
12541260
l.onResponse(null);
1261+
logger.info("--> unmarked [{}] for removal", node);
12551262
}
12561263
}
12571264
)
12581265
)
12591266

1260-
.addListener(mustSucceed(ignored -> startNodeShutdownMarker()));
1267+
.addListener(
1268+
ActionListener.releaseAfter(mustSucceed(ignored -> startNodeShutdownMarker()), localReleasables.transfer())
1269+
);
12611270

12621271
rerun = false;
12631272
} finally {

0 commit comments

Comments
 (0)