From 3f71772cd29a0544f56130ebcefaa9e375685cd2 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Mon, 25 Sep 2017 20:35:27 +0200 Subject: [PATCH] Azure snapshots can not be restored anymore (#26778) While working on #26751 and doing some manual integration testing I found that this #22858 removed an important line of our code: `AzureRepository` overrides default `initializeSnapshot` method which creates metadata files and do other stuff. But with PR #22858, I wrote: ```java @Override public void initializeSnapshot(SnapshotId snapshotId, List indices, MetaData clusterMetadata) { if (blobStore.doesContainerExist(blobStore.container()) == false) { throw new IllegalArgumentException("The bucket [" + blobStore.container() + "] does not exist. Please create it before " + " creating an azure snapshot repository backed by it."); } } ``` instead of ```java @Override public void initializeSnapshot(SnapshotId snapshotId, List indices, MetaData clusterMetadata) { if (blobStore.doesContainerExist(blobStore.container()) == false) { throw new IllegalArgumentException("The bucket [" + blobStore.container() + "] does not exist. Please create it before " + " creating an azure snapshot repository backed by it."); } super.initializeSnapshot(snapshotId, indices, clusterMetadata); } ``` As we never call `super.initializeSnapshot(...)` files are not created and we can't restore what we saved. Closes #26777. --- .../org/elasticsearch/repositories/azure/AzureRepository.java | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepository.java b/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepository.java index 6da00283382..8069400f02d 100644 --- a/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepository.java +++ b/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepository.java @@ -157,6 +157,7 @@ public class AzureRepository extends BlobStoreRepository { throw new IllegalArgumentException("The bucket [" + blobStore.container() + "] does not exist. Please create it before " + " creating an azure snapshot repository backed by it."); } + super.initializeSnapshot(snapshotId, indices, clusterMetadata); } @Override