Fix SnapshotStatusApisIT (#56859) (#56861)

In the unlikely event that the data nodes started snapshotting the
shards already (and hence got blocked on the data blobs) before the
master has applied the cluster state to its own `SnapshotsService` on
the CS applier thread, we can get a `SnapshotMissingException` here which
breaks the busy assert loop so we have to deal with it explicitly.

Closes #56858
This commit is contained in:
Armin Braun 2020-05-16 21:50:25 +02:00 committed by GitHub
parent cac85a6f18
commit b9614558b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -106,9 +106,15 @@ public class SnapshotStatusApisIT extends AbstractSnapshotIntegTestCase {
logger.info("--> wait for data nodes to get blocked");
waitForBlockOnAnyDataNode("test-repo", TimeValue.timeValueMinutes(1));
assertBusy(() -> assertEquals(SnapshotsInProgress.State.STARTED, client.admin().cluster().snapshotsStatus(
new SnapshotsStatusRequest("test-repo", new String[]{"test-snap"})).actionGet().getSnapshots().get(0).getState()), 1L,
TimeUnit.MINUTES);
assertBusy(() -> {
try {
assertEquals(SnapshotsInProgress.State.STARTED, client.admin().cluster().snapshotsStatus(
new SnapshotsStatusRequest("test-repo", new String[]{"test-snap"})).actionGet().getSnapshots().get(0)
.getState());
} catch (SnapshotMissingException sme) {
throw new AssertionError(sme);
}
}, 1L, TimeUnit.MINUTES);
logger.info("--> unblock all data nodes");
unblockAllDataNodes("test-repo");