Fix content store bug when already exists#2642
Merged
estesp merged 2 commits intocontainerd:masterfrom Sep 14, 2018
Merged
Conversation
e956d53 to
2d30907
Compare
2d30907 to
15b3d0a
Compare
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
d919dd8 to
e303e4d
Compare
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
e303e4d to
6875d3d
Compare
Member
|
LGTM |
1 similar comment
Member
|
LGTM |
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.
I found a bug in the content store which was causing a race condition in some cases in setting labels. The main issue is that the
Commitwas not consistently returning an already exists error. The local store implementation had an incorrect error check sinceos.Renamedoes not return an exists error. The metadata implementation was only checking this condition when the local store returned the error, allowing the newCommitto overwrite data for an existing blob. This was leading to labels getting stripped allowing a garbage collection while a blob was getting read due to another object attempting to create the same blob. This problem showed up in the case where the expected value of the blob is not known beforehand, not allowing us to either skip the Write+Commit or lease the existing object.Also fixed the content service to properly translate the error to GRPC.
This needs to be backported.