<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Xavi,<div class=""><br class=""><div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">Hi Stefan,</div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 18, 2022 at 10:34 AM Stefan Solbrig <<a href="mailto:stefan.solbrig@ur.de" class="">stefan.solbrig@ur.de</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class="">Hi Xavi,<div class=""><br class=""></div><div class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 17, 2022 at 1:03 PM Stefan Solbrig <<a href="mailto:stefan.solbrig@ur.de" target="_blank" class="">stefan.solbrig@ur.de</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear all,<br class="">
<br class="">
I was doing some testing regarding to GlusterFS link files (as they are created by a "move" operation). According to this document: <a href="https://www.gluster.org/glusterfs-algorithms-distribution/" rel="noreferrer" target="_blank" class="">https://www.gluster.org/glusterfs-algorithms-distribution/</a> If a link file is missing, it should be created after accessing the file.<br class="">
However, I don't see this behaviour. If I delete (by hand) a link file on the brick, the file is still accessible, but the link file is never recreated. I can do an "open" or a "stat" on the file without getting an error, but the link file is not created.<br class="">
Is this the intended behaviour? Or am I misunderstanding the above mentioned document?<br class=""></blockquote><div class=""><br class=""></div><div class="">You shouldn't access or modify the backend filesystems manually, you can accidentally create unexpected problems if you don't fully understand what you are doing.</div><div class=""><br class=""></div><div class="">That said, most probably the access to the file is still working because Gluster is using its cached information to locate the file. If the client mount is restarted, probably the file won't be accessible anymore unless you disable the "lookup-optimize" option (and this should recreate the link file).</div><div class=""><br class=""></div><div class="">Regards,</div><div class=""><br class=""></div><div class="">Xavi</div></div></div></div></blockquote><br class=""></div><div class="">Thanks for the quick reply! Maybe I should explain better my motivation for the above mentioned experiments. I have a large production system running GlusterFS with almost 5 PB of data (in approx 100G of inodes). It's a distributed-only system (no sharding, not dispersed). In this system, the users sometimes experience the problem that they cannot delete a seemingly empty directory. The cause of this problem is, that the directory contains leftover link files, i.e. dht link files where the target is gone. I haven't identified yet why this happens and I don't have a method to provoke this error (otherwise I would have mentioned it on this list already.)</div></div></div></blockquote><div class=""><br class=""></div><div class=""><div class="">What version of Gluster are you using ? if I remember correctly, there was a fix in 3.10.2 (and some other following patches) to delete stale link files when deleting empty directories to avoid precisely this problem. Recently there have also been some patches to avoid leaving some of those stale entries.</div><div class=""><br class=""></div><div class="">If you are still using 3.x I would recommend you to upgrade to a newer version, which have many issues already fixed.</div></div></div></div></div></blockquote><div><br class=""></div><div>I'm using 9.4 for the servers but my client (fuse) is still on 6.0. I know that's not optimal and I hope to change this soon, migrating everything to 9.6</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class=""><div class=""> <br class=""></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class=""><div class=""><div class=""> But my quick & dirty fix is, to delete these leftover link files by hand. (These leftover link files are not being cleaned up by a "rebalance".) </div></div></div></blockquote><div class=""><br class=""></div><div class="">If you only remove the file, you are leaving some data behind that should also be removed. Each file is associated with an entry inside .glusterfs/xx/yy in the brick, called gfid. This entry has the format of an uuid and can be determined by reading (in hex) the "trusted.gfid" xattr of the file you are going to delete:<br class=""></div><div class=""><br class=""></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class="gmail_quote"><div class=""><font face="monospace" class=""># getfattr -n trusted.gfid -e hex <file></font></div></div></blockquote><div class="gmail_quote"><div class=""><br class=""></div><div class="">If you manually remove files, you should also remove the gfid</div></div></div></div></blockquote><div><br class=""></div>Yes, I'm aware of these files. Once I remove the (named) link file, the .glusterfs/xx/yy/.... will be the ones that have zero size and no other hard link. As far as I understand, every file on the bricks has a hard link to .glusterfs/xx/yy/... with the full name representing its gfid. I tend to remove these as well.<br class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class=""><div class=""><div class=""><br class=""></div><div class="">The reason for my experiments with link files is: what happens if for some reason I accidentally delete a link file where the target still exists?</div><div class=""><br class=""></div><div class="">In the experiments (not on the production system) I also tried umounting and remounting the system, and I already tried setting "loopup-optmize = off". It doesn't affect the outcome of the experiments.</div></div></div></blockquote><div class=""><br class=""></div><div class="">If after remounting the volume you are still able to access the file but the link file is not created, then it means that it's not needed. Maybe it was one of those stale link files.</div></div></div></div></blockquote><div><br class=""></div><div>Not really... This was the case of the experiment, where I tried to delete the link file and the corresponding .glusterfs/x/yy, stopped the volume, umounted, restarted the volume, remounted, but the link file is still not being recreated.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class="">Can you give me one example of those link files (I need the name) and the trusted.glusterfs.dht xattr of the parent directory from all bricks ?</div><div class=""><br class=""></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class="gmail_quote"><div class=""><font face="monospace" class=""># getfattr -n trusted.glusterfs.dht -e hex <path/to/directory></font></div></div></blockquote><div class="gmail_quote"><div class=""><br class=""></div><div class="">Regards,</div><div class=""><br class=""></div><div class="">Xavi</div></div></div></div></blockquote><div><br class=""></div>Here's one of the stale files:<br class=""></div><div><br class=""></div><div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">[root@glubs-01 testvol]# getfattr -d -m. -e hex /gl/lv1lucuma/glurchbrick/scratch/analysis/CLS/N302/N302r001/run11/XMLOUT/N302r001n631_sto100.out.xml</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">getfattr: Removing leading '/' from absolute path names</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># file: gl/lv1lucuma/glurchbrick/scratch/analysis/CLS/N302/N302r001/run11/XMLOUT/N302r001n631_sto100.out.xml</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">trusted.gfid=0x6155412f6ade4009bcb92d839c2ad8b3</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">trusted.gfid2path.428e23fc0d37fc71=0x33343536636634622d336436642d346331622d386331622d6662616466643266356239302f4e333032723030316e3633315f73746f3130302e6f75742e786d6c</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">trusted.glusterfs.dht.linkto=0x676c757263682d636c69656e742d3900</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">trusted.pgfid.3456cf4b-3d6d-4c1b-8c1b-fbadfd2f5b90=0x00000001</span></div></div><div><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 247, 212);" class=""><br class=""></span></div><div>And here is the trusted.glusterfs.dht of the top level directory of each brick:</div><div><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 247, 212);" class=""><br class=""></span></div><div><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 247, 212);" class="">trusted.glusterfs.dht=0x0888f55900000000b9ec78f7c58cd403</span></div><div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212); min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000e59527f2f148c5e9<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212); min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000c58cd404ce451686<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212); min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000f148c5eafa0f7a9c<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212); min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000ce451687d6fd5909<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 247, 212); min-height: 13px;" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f5590000000008e8c7fe11af7cb0<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000d6fd590ae29ce547<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000209640c72c05d3e5<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">trusted.glusterfs.dht=0x0888f55900000000e29ce548e419069c</div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000e419069de59527f1<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000fa0f7a9dfb8b9bf1<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000fb8b9bf2fd07bd46<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000fd07bd47fe83de9b<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000fe83de9cffffffff<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f5590000000000000000017c2154<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000017c215502f842a9<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f5590000000002f842aa047463fe<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000047463ff05f08553<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f5590000000005f08554076ca6a8<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000076ca6a908e8c7fd<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">trusted.glusterfs.dht=0x0888f5590000000011af7cb1132b9e05</div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000132b9e0614a7bf5a<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f5590000000014a7bf5b1623e0af<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f559000000001623e0b017a35fb5<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f5590000000017a35fb6191f810a<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000191f810b1a9f0010<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f559000000001a9f00111c1b2165<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f559000000001c1b21661d9aa06b<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f559000000001d9aa06c1f16c1c0<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f559000000001f16c1c1209640c6<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f559000000002c05d3e62d81f53a<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">trusted.glusterfs.dht=0x0888f559000000002d81f53b509f7813</div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f55900000000509f781473bcfaec<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">trusted.glusterfs.dht=0x0888f5590000000073bcfaed96da7dc5</div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 13px;" class="">trusted.glusterfs.dht=0x0888f5590000000096da7dc6b9ec78f6<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div></span></div></span></div></span></div></span></div></div></div><div><br class=""></div>Thank you a lot!</div><div class="">-Stefan</div><div class=""><br class=""></div></body></html>