From 4a79ccd3246409c699ef1ffc906d68106c3fbe2b Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Tue, 16 Jul 2019 12:20:52 +0200 Subject: [PATCH] Cleaner Exception Handling on Shard Delete (#44384) (#44407) * Follow up to #44165 * We should just catch all exceptions here and not return errors after the index-N update went through since a subsequent delete attempt by the user would fail with SnapshotMissingException since the snapshot now appears deleted. Also, `SnapshotException` isn't even thrown in the changed spot it seems in the first place and certainly not the only exception possible. --- .../repositories/blobstore/BlobStoreRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java index 9cbf0f09a7a..a63006f1d59 100644 --- a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java +++ b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java @@ -553,7 +553,7 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp for (int shardId = 0; shardId < indexMetaData.getNumberOfShards(); shardId++) { try { deleteShardSnapshot(repositoryData, indexId, new ShardId(indexMetaData.getIndex(), shardId), snapshotId); - } catch (SnapshotException ex) { + } catch (Exception ex) { final int finalShardId = shardId; logger.warn(() -> new ParameterizedMessage("[{}] failed to delete shard data for shard [{}][{}]", snapshotId, indexId.getName(), finalShardId), ex);