From ebd15690285b7e5f63941e06a16eed7ae3ed6d65 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Tue, 8 Sep 2020 10:35:06 +0200 Subject: [PATCH] Fix testMasterFailOverWithQueuedDeletes (#62062) (#62078) Fixing very rare corner case where the delete retry is slow. Closes #62031 --- .../org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java index d5fec93d3c3..538548fc9f0 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java @@ -476,6 +476,11 @@ public class ConcurrentSnapshotsIT extends AbstractSnapshotIntegTestCase { // rarely the master node fails over twice when shutting down the initial master and fails the transport listener assertThat(rex.repository(), is("_all")); assertThat(rex.getMessage(), endsWith("Failed to update cluster state during repository operation")); + } catch (SnapshotMissingException sme) { + // very rarely a master node fail-over happens at such a time that the client on the data-node sees a disconnect exception + // after the master has already started the delete, leading to the delete retry to run into a situation where the + // snapshot has already been deleted potentially + assertThat(sme.getSnapshotName(), is(firstSnapshot)); } } expectThrows(SnapshotException.class, snapshotThreeFuture::actionGet);