[Gluster-devel] cannot delete non-empty directory
David F. Robinson
david.robinson at corvidtec.com
Mon Feb 9 17:57:40 UTC 2015
> Yes. This will solve the issue you are facing now. After this Aegis
can be removed from the mount point.
Understood. Thanks for the clarification.
I looked at one of the zero length files in .glusterfs:
[root at gfs01bkp 54]# ls -al 2f54d764-6215-4dd0-bbcb-fef2bfedc7d8
---------T 2 rbhinge pme_ics 0 Jan 22 10:12
[root at gfs01bkp 54]# getfattr -d -m . -e text
# file: 2f54d764-6215-4dd0-bbcb-fef2bfedc7d8
> A dump of all the xattrs matching regex "trusted.glusterfs.*" should
list all the xattrs. The value of "trusted.glusterfs.dht.linkto" xattr
should give the destination subvolume.
> If the file is not present on the destination, then its a stale linkto
file pointing to non-existent file (on destination subvol) and it can be
> Otherwise they are valid and shouldn't be removed.
Looks like the first one I checked is a stale link.
> Again as shyam mentioned in previous mail  should've fixed the
issue (it is present in v3.6.0 and above). Not sure why we are seeing
this issue again.
Once you figure this out, do you or will you have some kind of tool to
go through and clean up all of these stale links? Or, would you just
leave them as they are?
------ Original Message ------
From: "Raghavendra Gowdappa" <rgowdapp at redhat.com>
To: "David F. Robinson" <david.robinson at corvidtec.com>
Cc: "Shyam" <srangana at redhat.com>; "Gluster Devel"
<gluster-devel at gluster.org>; gluster-users at gluster.org; "Susant Palai"
<spalai at redhat.com>
Sent: 2/9/2015 12:50:28 PM
Subject: Re: [Gluster-devel] cannot delete non-empty directory
>----- Original Message -----
>> From: "David F. Robinson" <david.robinson at corvidtec.com>
>> To: "Shyam" <srangana at redhat.com>, "Gluster Devel"
>><gluster-devel at gluster.org>, gluster-users at gluster.org, "Susant
>> Palai" <spalai at redhat.com>
>> Sent: Monday, February 9, 2015 10:55:44 PM
>> Subject: Re: [Gluster-devel] cannot delete non-empty directory
>> So, just to be sure before I do this, it is okay to do the following
>> I want to get rid of everything in the /old_shelf4/Aegis directory
>> rm -rf /data/brick*/homegfs_bkp/backup.0/old_shelf4/Aegis
>Yes. This will solve the issue you are facing now. After this Aegis can
>be removed from the mount point.
>> What happens to all of the files in the .glusterfs directory? Does
>> get rebuilt or do the links stay there for files that now no longer
>Links stay there for files that now no longer exist. This is not an
>issue except that we'll be loosing an inode (no data-blocks as file
>size was 0).
>> And, is this same issue what causes all of the broken links in
>> .glusterfs. See attached image for example. There appears to be a lot
>> of broken links the .glusterfs directories. Is this normal or does it
>> indicate another problem.
>There can be other issues which can result in links not getting deleted
>from .glusterfs directory. Current issue is not related to that.
>> Finally, if I search through the /data/brick* directories, should I
>> no entries of "-------T" permission files with zero length files? Do
>> need to clean all of these up somehow? A quick look at
>> /data/brick01bkp/homegfs_bkp/.glusterfs/2f/54 shows many of these
>> They look like
>> ---------T 3 rbhinge pme_ics 0 Jan 9 16:45
>> ---------T 2 rbhinge pme_ics 0 Jan 9 21:40
>> How do I find out what file these entries were pointing to?
>As shyam had mentioned in an earlier mail, these files represent dht
>"linkto" files. These are sort of metadata containing the name of the
>subvolume where actual file is stored (hence the name "link-to"). The
>destination to which this "linkto" is pointing is stored in xattrs. A
>dump of all the xattrs matching regex "trusted.glusterfs.*" should list
>all the xattrs. The value of "trusted.glusterfs.dht.linkto" xattr
>should give the destination subvolume. If the file is not present on
>the destination, then its a stale linkto file pointing to non-existent
>file (on destination subvol) and it can be removed. Otherwise they are
>valid and shouldn't be removed.
>Again as shyam mentioned in previous mail  should've fixed the issue
>(it is present in v3.6.0 and above). Not sure why we are seeing this
>> ------ Original Message ------
>> From: "Shyam" <srangana at redhat.com>
>> To: "David F. Robinson" <david.robinson at corvidtec.com>; "Gluster
>> <gluster-devel at gluster.org>; "gluster-users at gluster.org"
>> <gluster-users at gluster.org>; "Susant Palai" <spalai at redhat.com>
>> Sent: 2/9/2015 11:11:20 AM
>> Subject: Re: [Gluster-devel] cannot delete non-empty directory
>> >On 02/08/2015 12:19 PM, David F. Robinson wrote:
>> >>I am seeing these messsages after I delete large amounts of data
>> >>gluster 3.6.2.
>> >>cannot delete non-empty directory:
>> >>*_From the FUSE mount (as root), the directory shows up as empty:_*
>> >># pwd
>> >># ls -al
>> >>total 5
>> >>d--------- 2 root root 4106 Feb 6 13:55 .
>> >>drwxrws--- 3 601 dmiller 72 Feb 6 13:55 ..
>> >>However, when you look at the bricks, the files are still there
>> >>brick01bkp, all files are on brick02bkp). All of the files are
>> >>and have ------T permissions.
>> >These files are linkto files that are created by DHT, which
>> >mean the files were either renamed, or the brick layout changed (I
>> >suspect the former to be the cause).
>> >These files should have been deleted when the files that they point
>> >were deleted, looks like this did not happen.
>> >Can I get the following information for some of the files here,
>> >- getfattr -d -m . -e text <path to file on brick>
>> > - The output of trusted.glusterfs.dht.linkto xattr should state
>> >the real file belongs, in this case as there are only 2 bricks, it
>> >should be brick01bkp subvol
>> >- As the second brick is empty, we should be able to safely delete
>> >these files from the brick and proceed to do an rmdir on the mount
>> >point of the volume as the directory is now empty.
>> >- Please check, the one sub-directory that is showing up in this
>> >as well, "save1"
>> >>Any suggestions on how to fix this and how to prevent it from
>> >I believe there are renames happening here, possibly by the archive
>> >creator, one way to prevent the rename from creating a linkto file
>> >to use the DHT set parameter to set a pattern so that file name hash
>> >considers only the static part of the name.
>> >The set parameter is, cluster.extra-hash-regex.
>> >A link on a similar problem and how to use this set parameter (there
>> >few in the gluster forums) would be,
>> >Additionally, there is a bug here, the unlink of the file should
>> >cleaned up the linkto as well, so that all of the above is not
>> >required, we have noticed this with NFS and FUSE mounts (ref bugs,
>> >1117923, 1139992), and investigation is in progress on the same. We
>> >will step up the priority on this so that we have a clean fix that
>> >be used to prevent this in the future.
>> Gluster-devel mailing list
>> Gluster-devel at gluster.org
More information about the Gluster-devel