Repository navigation
Conversation
|
Workflow [PR], commit [1209bcf] Summary: ✅
AI ReviewSummaryThis PR fixes the Findings❌ Blockers
Final VerdictChanges requested: the native Azure copy path still violates the range-copy contract for LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 88/111 (79.28%) · Uncovered code |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 86/111 (77.48%) · Uncovered code |
d0bdc3d to
73159d0
Compare
1b809ba to
0a1193d
Compare
0a1193d to
a55e304
Compare
a55e304 to
1209bcf
Compare
| if (settings->use_native_copy) | ||
| /// Server-side CopyFromUri copies the whole source blob, so native copy is valid only for a | ||
| /// full-object copy; a ranged copy (offset > 0) must go via read+write. | ||
| if (settings->use_native_copy && offset == 0) |
There was a problem hiding this comment.
copyAzureBlobStorageFile still treats offset == 0 as “whole object”, but this helper's contract and the Azure backup caller both allow arbitrary [start_pos, start_pos + length) ranges. BackupWriterAzureBlobStorage::copyFileFromDisk forwards start_pos and length directly (src/Backups/BackupIO_AzureBlobStorage.cpp:214-226), so a prefix copy with start_pos == 0 && length < source_size still enters CopyFromUri here and copies the entire source blob into the destination.
BackupWriterS3::copyFileFromDisk fixed this exact invariant by checking whole_object = (start_pos == 0) && (length == source_size) before taking the native-copy path (src/Backups/BackupIO_S3.cpp:589-604). Azure needs the same distinction: either thread source_size into copyAzureBlobStorageFile and gate native copy on size == source_size, or make the whole-object/range decision in BackupWriterAzureBlobStorage::copyFileFromDisk before calling this helper. As written, prefix-only Azure-to-Azure backup copies are still corruptible.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Object file sizes14 object files changed (+261.44 KiB total), 0 added.
737 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units16 translation units recompiled, 68 s compile time in total, 16 of them have a recent master baseline. |
| "Will attempt to copy using read & write. source container = {} blob = {} and destination container = {} blob = {}", | ||
| e.what(), src_container_for_logging, src_blob, dest_container_for_logging, dest_blob); | ||
| } | ||
| else if (e.StatusCode == Azure::Core::Http::HttpStatusCode::Forbidden) |
There was a problem hiding this comment.
Can we elaborate a bit on the log message, as to why this error is usually seen. Like for Unauthorized I had added this "Copy operation has thrown unauthorized access error, which indicates that the storage account of the source & destination are not the same."
Maybe we can add something similar to Forbidden & AuthenticationException too, wdyt ?
|
Dear @SmitaRKulkarni, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
|
Fixed at #114975 |
Problem. A ranged Azure copy corrupts the destination — native
CopyFromUricopies the whole source blob (ignoring offset/size) and the single-part read+write fallback reads from byte 0 — and a transient 403/auth after the server-side copy starts spawns a second writer to the same blob. Failure scenario:Fix. Gate native copy on
offset==0; seek the fallback viaLimitSeekableReadBuffer(offset, total_size); only start the copy in the guarded block and poll the same operation on transient errors (no mechanism switch); retry the read+write upload writes through the shared retry helper.Changes.
IO/AzureBlobStorage/copyAzureBlobStorageFile:offset==0native-copy gate; seek the single-part fallback; poll-same-operation on transient errors; retry upload writes.tests/integration/{test_backup_restore_azure_blob_storage,test_backup_restore_s3}: incremental Log-family / ranged-copy regression tests.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed a ranged Azure Blob Storage copy corrupting the destination during incremental backups: server-side native copy ignored the requested offset and size, and the single-part read-and-write fallback read from the start of the source. Native copy is now used only for a full-object copy, the fallback seeks to the correct offset, and a transient error after a server-side copy has started no longer starts a second writer to the destination.