bboltcachestorage: delete links outside of cursor#5692
Merged
tonistiigi merged 1 commit intomoby:masterfrom Feb 6, 2025
Merged
bboltcachestorage: delete links outside of cursor#5692tonistiigi merged 1 commit intomoby:masterfrom
tonistiigi merged 1 commit intomoby:masterfrom
Conversation
Collaborator
Author
|
Needs a test. |
The `emptyBranchWithParents` method could accidentally leave link entries that shouldn't exist. When finding these links, deleting during the iteration can sometimes cause the cursor to jump entries that should be deleted. This changes the code path to delete the links outside of the iteration to avoid this. This is caused by a long-standing bug in bolt that can't be fixed easily. See etcd-io/bbolt#611 for details. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
65d23c6 to
f06c01d
Compare
Collaborator
Author
|
I attempted to test this by creating a result and then having a bunch of links with different digests point to the same source and target ids and wasn't able to trigger it with the original code. I'm not sure what would be a good way to reproduce this. This has only happened a few times in a very large database and I'm not sure how big of a concern this is. I've moved this from draft to open but I don't think I'll be able to create a test case to exercise this code since the theory on the cause is mostly theoretical from that one issue. |
tonistiigi
approved these changes
Feb 6, 2025
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.
The
emptyBranchWithParentsmethod could accidentally leave link entries that shouldn't exist. When finding these links, deleting during the iteration can sometimes cause the cursor to jump entries that should be deleted.This changes the code path to delete the links outside of the iteration to avoid this.
This is caused by a long-standing bug in bolt that can't be fixed easily. See etcd-io/bbolt#611 for details.