Repository navigation
registry/storage/swift: detect and fix outdated container listings - #1605
Merged
RichardScothern merged 1 commit intoApr 8, 2016
Merged
RichardScothern merged 1 commit into
RichardScothern merged 1 commit into
Conversation
Signed-off-by: Stefan Majewsky <[email protected]>
Current coverage is
|
|
good work @majewsky LGTM |
This was referenced Apr 20, 2016
3 tasks done
6 of 7 tasks
thaJeztah
pushed a commit
to thaJeztah/distribution
that referenced
this pull request
Apr 22, 2021
…tdated-container-listings registry/storage/swift: detect and fix outdated container listings
thaJeztah
pushed a commit
to thaJeztah/distribution
that referenced
this pull request
Jan 19, 2022
…tdated-container-listings registry/storage/swift: detect and fix outdated container listings
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.
After #1578, this is the second product of my investigations on errors with my team's internal Registry. Similar errors are tracked here as #1013 and #1539 aka moby/moby#21290.
During load tests, I especially saw the same error ("digest invalid: provided digest did not match uploaded content") as @tdooner in #1013:
After updating our test registry from v2.3.0 to a recent master (especially containing my previous fix #1578), these errors turned into "blob upload invalid" with an additional message "upload resumed at wrong offset":
I put the registry behind a mitmproxy and inspected the sequence of API calls to Swift that led to this error. The problem was an outdated container listing: Whenever a single layer segment is uploaded during a
docker push, the blob writer is resumed by enumerating all the segments that have already been written (using a container listing). When the container listing is not up-to-date (which sometimes happens when Swift is under high load or when single storage nodes become temporarily unresponsive), too few segments are seen and the blob writer is resumed at the wrong offset.I extended
getAllSegmentsto recognize incomplete container listings, with the usual cost of only one additionalHEADcall (which is usually very fast). I also applied a similar treatment toStatfor good measure.To verify my changes, I re-ran my Registry load test (consisting of 10 workers each doing
docker push && docker pullwith randomly generated images) and did not see a single worker fail for over an hour whereas I would usually see around 4-6 failures within an hour. I also saw several debug messages (not included in this patch) indicating that the new code paths were indeed taken./cc @lebauce
The fineprint: Please do not consider #1013 and/or #1539 fixed by this. I'm fixing some eventual-consistency-related problems with the Swift driver (esp. those which I could reliably reproduce in a testing environment), not all of them.