This repository was archived by the owner on Feb 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 880
rkt/image_gc: don't fail hard when unable to get some treestore IDs #2242
Merged
Conversation
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
34b230f
to
c57ad6e
Compare
@@ -83,7 +83,7 @@ func gcTreeStore(s *store.Store) error { | |||
defer keyLock.Close() | |||
referencedTreeStoreIDs, err := getReferencedTreeStoreIDs() | |||
if err != nil { | |||
return errwrap.Wrap(errors.New("cannot get referenced treestoreIDs"), err) | |||
stderr.PrintE("cannot get referenced treestoreIDs", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If err != nil
, referencedTreeStoreIDs
is nil, so the code below will call RemoveTreeStore
on too many images.
Shouldn't you do that change in the function getReferencedTreeStoreIDs()/walkPods()
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right
c57ad6e
to
fc9820c
Compare
In this version, |
If we can't get some treestoreIDs from the pods, those pods are in a broken state and we can remove the treestore (if not referenced by some other healthy pods). This avoids cases where treestores can't be removed because of damaged pods.
I should remember not to push code when I'm about to leave :) |
fc9820c
to
1640d65
Compare
LGTM |
iaguis
added a commit
that referenced
this pull request
Mar 7, 2016
rkt/image_gc: don't fail hard when unable to get some treestore IDs
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
If we can't get some treestoreIDs from the pods, those pods are in a
broken state and we can remove the treestore (if not referenced by some
other healthy pods).
This avoids cases where treestores can't be removed because of damaged
pods.
Fixes #2180