Skip to content

Commit addab1b

Browse files
committed
Azure snapshots can not be restored anymore
While working on elastic#26751 and doing some manual integration testing I found that this elastic#22858 removed an important line of our code: `AzureRepository` overrides default `initializeSnapshot` method which creates metadata files and do other stuff. But with PR elastic#22858, I wrote: ```java @OverRide public void initializeSnapshot(SnapshotId snapshotId, List<IndexId> 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<IndexId> 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 elastic#26777.
1 parent 324ee8c commit addab1b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ public void initializeSnapshot(SnapshotId snapshotId, List<IndexId> indices, Met
157157
throw new IllegalArgumentException("The bucket [" + blobStore.container() + "] does not exist. Please create it before " +
158158
" creating an azure snapshot repository backed by it.");
159159
}
160+
super.initializeSnapshot(snapshotId, indices, clusterMetadata);
160161
}
161162

162163
@Override

0 commit comments

Comments
 (0)