Repository navigation
Fix azure append duplicate in PutContent - #6
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## datadog #6 +/- ##
========================================
Coverage 56.30% 56.30%
========================================
Files 117 117
Lines 8719 8719
========================================
Hits 4909 4909
Misses 3140 3140
Partials 670 670 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fricounet
force-pushed
the
fricounet/azure-append-duplicate
branch
from
June 5, 2026 09:15
4474f68 to
e3b15a8
Compare
Write PutContent objects as block blobs so Azure retries overwrite small objects instead of appending duplicate link contents. Delete legacy append-blob objects before uploading because Azure cannot replace an AppendBlob with a BlockBlob in place. Preserve zero-byte append compatibility and add Azure regression coverage for link-style content, legacy migration, and concurrent same-path writes.
Fricounet
force-pushed
the
fricounet/azure-append-duplicate
branch
from
June 5, 2026 09:22
e3b15a8 to
9c71104
Compare
Fricounet
marked this pull request as ready for review
June 5, 2026 09:37
zaymat
approved these changes
Jun 5, 2026
ecdatadog
approved these changes
Jun 5, 2026
| } | ||
|
|
||
| size = *props.ContentLength | ||
| if *props.BlobType == blob.BlobTypeBlockBlob && size == 0 { |
There was a problem hiding this comment.
As discussed together, with this case we are "just" accepting an new happy path : when the blob is empty, we accept that append it is in fact replacing it.
We need to focus when deploying that immutability of BlobTypeBlockBlob is not assumed in the code (for example in a cache)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Write PutContent objects as block blobs so Azure retries overwrite small objects instead of appending duplicate link contents. Delete legacy append-blob objects before uploading because Azure cannot replace an AppendBlob with a BlockBlob in place. Preserve zero-byte append compatibility and add Azure regression coverage for link-style content, legacy migration, and concurrent same-path writes.
The origin of the issue stems from distribution#4576 which implemented some changes from gitlab's container-registry. The issue is that in the gitlab changes, there was no modification of PutContent, which kept using an in-place update of BlockBlob instead of an AppendBlob while the distribution PR made the switch to AppendBlob.
Funnily this exact same issue had been fixed 10y ago by switching AppendBlob to BlockBlob at the time just like this PR is doing :D