Fix Missing IgnoredUnavailable Flag in 7.x SLM Retention Task (#56616)

Without the flag we run into the situation where a broken repository (broken by some old 6.x
version of ES that is missing some snap-${uuid}.dat blobs fails to run the SLM retention task
since it always errors out).
This commit is contained in:
Armin Braun 2020-05-12 18:07:58 +02:00 committed by GitHub
parent 4240b97d0e
commit c104c9a11b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -270,6 +270,7 @@ public class SnapshotRetentionTask implements SchedulerEngine.Listener {
for (String repository : repositories) { for (String repository : repositories) {
client.admin().cluster() client.admin().cluster()
.prepareGetSnapshots(repository) .prepareGetSnapshots(repository)
.setIgnoreUnavailable(true)
.execute(ActionListener.wrap(resp -> { .execute(ActionListener.wrap(resp -> {
final Set<SnapshotState> retainableStates = final Set<SnapshotState> retainableStates =
new HashSet<>(Arrays.asList(SnapshotState.SUCCESS, SnapshotState.FAILED, SnapshotState.PARTIAL)); new HashSet<>(Arrays.asList(SnapshotState.SUCCESS, SnapshotState.FAILED, SnapshotState.PARTIAL));