-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Add check for empty directory to recycler #11934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add check for empty directory to recycler #11934
Conversation
Recycler should return an error when a recycled volume is not empty - another pod might have written some data into it. This directory should be recycled again (and Kubernetes will do that in few seconds).
576849f to
85ce222
Compare
|
[test] |
|
[test] |
1 similar comment
|
[test] |
|
[test] flake: #9767 |
|
Evaluated for origin test up to 85ce222 |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11547/) (Base Commit: 32c2948) |
|
@childsb, PTAL |
|
Is this still for 1.4? |
|
@ncdc yes please! |
|
This is a tricky PR. Code & design is great.. but there are filesystems that contain directories that are impossible to delete (.snapshot , .backup, etc..) All that to say, this is another problem with the recycler. There's no correct behavior for every FS type. |
What does |
|
I think it does not return error, but the directory is never deleted. lets see if rootfs knows. |
|
|
||
| // CheckEmpty returns error if specified directory is not empty. | ||
| func CheckEmpty(dir string) error { | ||
| return newWalker(func(path string, info os.FileInfo) error { |
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 there are directories with different fsid (e.g. snapshot volumes), ignore them.
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.
IMO, it's single NFS mount, ".snapshot" (or whatever is it called) won't have a different FSID.
|
[merge] |
|
Evaluated for origin merge up to 85ce222 |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13472/) (Base Commit: 708ea98) (Image: devenv-rhel7_5831) |
Recycler should return an error when a recycled volume is not empty - another pod might have written some data into it. This directory should be recycled again (and Kubernetes will do that in few seconds).
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1395271