From 7f5befd95e19badf8b911df5c28a08613b0a9cd0 Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Sun, 13 Apr 2014 19:20:50 -0400 Subject: [PATCH] Add Partial snapshot state Currently even if some shards of the snapshot are not snapshotted successfully, the snapshot is still marked as "SUCCESS". Users may miss the fact the there are shard failures present in the snapshot and think that snapshot was completed. This change adds a new snapshot state "PARTIAL" that provides a quick indication that the snapshot was only partially successful. Closes #5792 --- .../TransportSnapshotsStatusAction.java | 3 ++ .../blobstore/BlobStoreRepository.java | 6 +++- .../blobstore/BlobStoreSnapshot.java | 11 ++++++- .../snapshots/RestoreService.java | 2 +- .../snapshots/SnapshotState.java | 32 ++++++++++++++++--- .../DedicatedClusterSnapshotRestoreTests.java | 2 +- .../SharedClusterSnapshotRestoreTests.java | 1 + 7 files changed, 48 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java index cec4be35376..cdb5a67b8b2 100644 --- a/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java +++ b/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java @@ -206,6 +206,9 @@ public class TransportSnapshotsStatusAction extends TransportMasterNodeOperation state = SnapshotMetaData.State.FAILED; break; case SUCCESS: + case PARTIAL: + // Translating both PARTIAL and SUCCESS to SUCCESS for now + // TODO: add the differentiation on the metadata level in the next major release state = SnapshotMetaData.State.SUCCESS; break; default: diff --git a/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java b/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java index 554789241f5..f5119aa0c92 100644 --- a/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java +++ b/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java @@ -312,7 +312,11 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent