Bug 1395160

Summary: recycler pods fails on NFS with undeletable .snapshot folders
Product: OpenShift Container Platform Reporter: Javier Ramirez <javier.ramirez>
Component: RFEAssignee: Bradley Childs <bchilds>
Status: CLOSED WONTFIX QA Contact: Xiaoli Tian <xtian>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3.1CC: aos-bugs, bchilds, bvincell, eparis, erjones, jkaur, jokerman, mmccomas, swatt
Target Milestone: ---Flags: erjones: needinfo? (bchilds)
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-09 16:35:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Javier Ramirez 2016-11-15 10:07:46 UTC
Description of problem:
When PVs are mounted via NFS and the volumes have a .snapdhot dir for the smapshots of the NAS Volume the pod recycler doesnt work - because it can not delete the .snapshot file. Is it possible to exclude the .snapshot directory?

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Have an nfs PV with some .snapshot dir
2. Pod recycler will fail
3.

Actual results:
Pod recycle fails

Expected results:
1. Have a way to exclude this .snapshot directory


Additional info:
Upstream issue reported at : 
https://github.com/openshift/origin/issues/8721

Comment 2 Eric Paris 2016-11-16 13:36:14 UTC
I am calling this a feature request because the recycler, by design, deletes all of the files in a volume before it declares it ready for the next user. It does not know that on some filers or some filesystems there may be magic files or directories which do not contain user data and which might not need to be cleaned up. The recycler needs to delete everything before it can have any confidence that data is not leaking between users.

In this case there is a magic directory `.snapshot` which can be safely left from one user of the volume to another. For us to create some form of 'delete everything except' exclusion configuration is a feature request.

As we are deprecating the recycler entirely and suggest moving to dynamic provisioning with `Deleted` reclaimPolicy I'm not sure we will ever do it, however this should be a RFE to be considered and prioritized.

Alternatively I believe one should be able to create their own custom recycle pod with the necessary logic to ignore .snapshot.

Comment 3 Javier Ramirez 2016-11-16 15:23:16 UTC
(In reply to Eric Paris from comment #2)
> I am calling this a feature request because the recycler, by design, deletes
> all of the files in a volume before it declares it ready for the next user.
> It does not know that on some filers or some filesystems there may be magic
> files or directories which do not contain user data and which might not need
> to be cleaned up. The recycler needs to delete everything before it can have
> any confidence that data is not leaking between users.
> 
> In this case there is a magic directory `.snapshot` which can be safely left
> from one user of the volume to another. For us to create some form of
> 'delete everything except' exclusion configuration is a feature request.
> 
> As we are deprecating the recycler entirely and suggest moving to dynamic
> provisioning with `Deleted` reclaimPolicy I'm not sure we will ever do it,
> however this should be a RFE to be considered and prioritized.
> 
> Alternatively I believe one should be able to create their own custom
> recycle pod with the necessary logic to ignore .snapshot.

Hello Eric, where can I find information about how to do this?

Comment 4 Eric Paris 2016-11-16 20:59:15 UTC
Basically, one would to create a container, which takes as an argument the directory which needs to be cleaned and does the needful.

We do this in:
https://github.com/openshift/origin/blob/master/pkg/cmd/recycle/*.go

And create the container by:
https://github.com/openshift/origin/blob/master/images/recycler/Dockerfile

I've not seen it done...

Comment 5 Dan McPherson 2016-11-23 20:08:14 UTC
*** Bug 1397968 has been marked as a duplicate of this bug. ***

Comment 7 Steve Watt 2017-02-09 16:35:24 UTC
With the advent of dynamic provisioning, the recycler has been deprecated.