Bug 1326498

Summary: DHT: Provide mechanism to nuke a entire directory from a client (offloading the work to the bricks)
Product: Red Hat Gluster Storage Reporter: Shyamsundar <srangana>
Component: distributeAssignee: Shyamsundar <srangana>
Status: CLOSED ERRATA QA Contact: krishnaram Karthick <kramdoss>
Severity: high Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: annair, asrivast, avasudev, nbalacha, rabhat, rcyriac, rgowdapp, rhinduja, sankarshan, ssaha
Target Milestone: ---Keywords: ZStream
Target Release: RHGS 3.1.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.7.9-3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-23 05:17:11 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:
Bug Depends On:    
Bug Blocks: 1311817    

Description Shyamsundar 2016-04-12 19:58:34 UTC
Description of problem:
An rm -rf of a directory causes the client (say FUSE) to crawl through the entire directory structure and unlink files and remove directories underneath the directory that is being entirely removed. This is slow, and also has too many round trips.

As an admin shortcut for this removal process, it would be better to provide a mechanism whereby, a directory can be marked for deletion and removed from the name space, but acted upon by each individual brick. This can leverage the AFR janitor mechanism for the same purpose.

Comment 17 krishnaram Karthick 2016-05-16 06:16:06 UTC
verified the fix in build - glusterfs-server-3.7.9-4.el7rhgs.x86_64. The fix works as expected

Steps followed to verify:

1) created a distributed volume and created 1000 dirs and 1000 files under a directory say 'dir1'
2) From the gluster server, issued the following command
'setfattr -n glusterfs.dht.nuke -v "test" /mnt/dir-1'
3) After step 2 was completed, dir1 was not accessible immediately from the mountpoint
4) Validated if the entry was moved to '/bricks/brick*/dilbert/.glusterfs/landfill' and deleted eventually.

Moving the bug to verified.

Comment 19 errata-xmlrpc 2016-06-23 05:17:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1240