fix(storage migration): overwrite target blob if mismatch
if target blob already exists, migration will check the blob
if header is already with the targeted key (or no key if not ciphered) no need write
otherwise write the blob (that will convert any blob with no header into the correct version)
This commit is contained in:
@@ -173,6 +173,23 @@ impl BlobStorageBackend for AzureBlobBackend {
|
||||
})
|
||||
}
|
||||
|
||||
/// Atomic overwrite path used by `storage_rotate` and
|
||||
/// `storage_migration` when re-writing an already-present blob
|
||||
/// under a new head key/format. Trait default delegates to
|
||||
/// `put_blob_from_bytes` which `get_properties`-probes and
|
||||
/// silently skips — exactly wrong for the rotate/migrate use
|
||||
/// case (the whole point is to replace the existing bytes).
|
||||
/// Override delegates to the same unconditional PUT as
|
||||
/// `put_blob_from_bytes_unsynced` — Azure's PUT is durable on
|
||||
/// return, no separate sync barrier needed.
|
||||
fn put_blob_from_bytes_replace(
|
||||
&self,
|
||||
hash: &str,
|
||||
data: Bytes,
|
||||
) -> Pin<Box<dyn std::future::Future<Output = Result<u64, DomainError>> + Send + '_>> {
|
||||
self.put_blob_from_bytes_unsynced(hash, data)
|
||||
}
|
||||
|
||||
fn get_blob_stream(
|
||||
&self,
|
||||
hash: &str,
|
||||
|
||||
Reference in New Issue
Block a user