Issue 7570: Check existance of container before creation attempt

This commit is contained in:
Hari Bhaskaran 2022-07-20 09:40:49 -07:00
parent a7469b925b
commit 3aec508aec

View File

@ -333,7 +333,10 @@ Future<Void> BackupContainerAzureBlobStore::create() {
TraceEvent(SevDebug, "BCAzureBlobStoreCreateContainer").detail("ContainerName", containerName); TraceEvent(SevDebug, "BCAzureBlobStoreCreateContainer").detail("ContainerName", containerName);
Future<Void> createContainerFuture = Future<Void> createContainerFuture =
asyncTaskThread.execAsync([containerName = this->containerName, client = this->client] { asyncTaskThread.execAsync([containerName = this->containerName, client = this->client] {
waitAzureFuture(client->create_container(containerName), "create_container"); auto outcome = client->get_container_properties(containerName).get();
if (!outcome.success()) {
waitAzureFuture(client->create_container(containerName), "create_container");
}
return Void(); return Void();
}); });
Future<Void> encryptionSetupFuture = usesEncryption() ? encryptionSetupComplete() : Void(); Future<Void> encryptionSetupFuture = usesEncryption() ? encryptionSetupComplete() : Void();