Skip to content

Commit d15d796

Browse files
Fix testMasterFailOverWithQueuedDeletes (elastic#62062)
Fixing very rare corner case where the delete retry is slow. Closes elastic#62031
1 parent 8ec4a76 commit d15d796

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,11 @@ public void testMasterFailOverWithQueuedDeletes() throws Exception {
476476
// rarely the master node fails over twice when shutting down the initial master and fails the transport listener
477477
assertThat(rex.repository(), is("_all"));
478478
assertThat(rex.getMessage(), endsWith("Failed to update cluster state during repository operation"));
479+
} catch (SnapshotMissingException sme) {
480+
// very rarely a master node fail-over happens at such a time that the client on the data-node sees a disconnect exception
481+
// after the master has already started the delete, leading to the delete retry to run into a situation where the
482+
// snapshot has already been deleted potentially
483+
assertThat(sme.getSnapshotName(), is(firstSnapshot));
479484
}
480485
}
481486
expectThrows(SnapshotException.class, snapshotThreeFuture::actionGet);

0 commit comments

Comments
 (0)