Adds check to snapshot repository incompatible-snapshots blob to delete

a pre-existing one before attempting to overwrite it.
This commit is contained in:
Ali Beyad 2017-05-02 09:56:05 -04:00
parent 582b3c06b6
commit 1435c23df2
1 changed files with 3 additions and 0 deletions

View File

@ -728,6 +728,9 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp
}
bytes = bStream.bytes();
}
if (snapshotsBlobContainer.blobExists(INCOMPATIBLE_SNAPSHOTS_BLOB)) {
snapshotsBlobContainer.deleteBlob(INCOMPATIBLE_SNAPSHOTS_BLOB);
}
// write the incompatible snapshots blob
writeAtomic(INCOMPATIBLE_SNAPSHOTS_BLOB, bytes);
}