8000 rkt/image_gc: don't fail hard when unable to get some treestore IDs by iaguis · Pull Request #2242 · rkt/rkt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

rkt/image_gc: don't fail hard when unable to get some treestore IDs #2242

Merged
merged 1 commit into from
Mar 7, 2016

Conversation

iaguis
Copy link
Member
@iaguis iaguis commented Mar 1, 2016

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

@iaguis iaguis added this to the v1.2.0 milestone Mar 1, 2016
@iaguis iaguis force-pushed the iaguis/treestore-gc branch 2 times, most recently from 34b230f to c57ad6e Compare March 1, 2016 15:27
@@ -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)
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right

@alban
Copy link
Member
alban commented Mar 3, 2016

In this version, walkErr is never assigned, so testing walkErr != nil is not needed.

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.
@iaguis
Copy link
Member Author
iaguis commented Mar 4, 2016

In this version, walkErr is never assigned, so testing walkErr != nil is not needed.

I should remember not to push code when I'm about to leave :)

@iaguis iaguis force-pushed the iaguis/treestore-gc branch from fc9820c to 1640d65 Compare March 4, 2016 10:36
@alban
Copy link
Member
alban commented Mar 7, 2016

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
@iaguis iaguis merged commit e2c3011 into rkt:master Mar 7, 2016
@alban alban mentioned this pull request Mar 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0