[Gluster-users] glusterfs missing files on ls

elvinas.piliponis at barclays.com elvinas.piliponis at barclays.com
Tue Jun 4 11:18:19 UTC 2013


Hello,

I have had similar situation with file not listed in the ls directory listing but still available on Gluster if referred directly. It ended up a as split brain situation. After I have cleared splitbrain , files have appeared. It seems that splitbrain can occur on directory entry also, not just the file.


Here is my script to fix splitbrain on replica pairs. I am using client and server on each node. If your client is some other machine, then stat command should be executed on client host.

WARNINIG! Script does not attempt to VALIDATE correctness of replica copy. So if you run it on replica server containing wrong copy, resulting file in the volume will be bad also.

--------------
gluster volume heal VOLUME info split-brain | grep "FILENAME" | awk '{print $3}' | sort -r | uniq > /tmp/splitbrain

for f in $(cat /tmp/splitbrain); do
    BRICK=/mnt/STORE_VOL/brick/
    SBFILE="$f"
    GFID=""
    if [ -f ${BRICK}${SBFILE} -o -d ${BRICK}${SBFILE} ]; then
        GFID=$(getfattr -n trusted.gfid --absolute-names -e hex ${BRICK}${SBFILE} | grep 0x | cut -d'x' -f2)
    else
        echo "WARNING! ${BRICK}${SBFILE} not found. Skipping"
    fi
    if [ -f ${BRICK}/.glusterfs/${GFID:0:2}/${GFID:2:2}/${GFID:0:8}-${GFID:8:4}-${GFID:12:4}-${GFID:16:4}-${GFID:20:12} ]; then
        echo "Removing ${BRICK}/.glusterfs/${GFID:0:2}/${GFID:2:2}/${GFID:0:8}-${GFID:8:4}-${GFID:12:4}-${GFID:16:4}-${GFID:20:12}"
        rm -f ${BRICK}/.glusterfs/${GFID:0:2}/${GFID:2:2}/${GFID:0:8}-${GFID:8:4}-${GFID:12:4}-${GFID:16:4}-${GFID:20:12}
        echo "Removing ${BRICK}${SBFILE}"
        rm -f ${BRICK}${SBFILE}
        echo "Stat'ing file"
        stat /MOUNT_POINT/${SBFILE}
    else
        echo "WARNING! ${BRICK}${SBFILE} GFID file was not found. Skipping!"
    fi
done
-------------

From: gluster-users-bounces at gluster.org [mailto:gluster-users-bounces at gluster.org] On Behalf Of Stefano Sinigardi
Sent: 03 June 2013 13:22
To: Vijay Bellur
Cc: gluster-users at gluster.org; Louis Zuckerman
Subject: Re: [Gluster-users] glusterfs missing files on ls

Also, because of the mistake that I did removing files and folders (the .dropbox-cache folder removal on all the bricks) directly from bricks, maybe it's better to scan the .gluster folder and remove any broken symlink before upgrading (but after having stopped glusterd, of course)?
Please let me know. I can understand that these are basic questions, but I don't want to make many other mistakes
Thanks a lot for your great support
Regards,
    Stefano

This e-mail and any attachments are confidential and intended
solely for the addressee and may also be privileged or exempt from
disclosure under applicable law. If you are not the addressee, or
have received this e-mail in error, please notify the sender
immediately, delete it from your system and do not copy, disclose
or otherwise act upon any part of this e-mail or its attachments.

Internet communications are not guaranteed to be secure or
virus-free.
The Barclays Group does not accept responsibility for any loss
arising from unauthorised access to, or interference with, any
Internet communications by any third party, or from the
transmission of any viruses. Replies to this e-mail may be
monitored by the Barclays Group for operational or business
reasons.

Any opinion or other information in this e-mail or its attachments
that does not relate to the business of the Barclays Group is
personal to the sender and is not given or endorsed by the Barclays
Group.

Barclays Bank PLC. Registered in England and Wales (registered no.
1026167).
Registered Office: 1 Churchill Place, London, E14 5HP, United
Kingdom.

Barclays Bank PLC is authorised by the Prudential Regulation
Authority and regulated by the Financial Conduct Authority and the
Prudential Regulation Authority (Financial Services Register No.
122702).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://supercolony.gluster.org/pipermail/gluster-users/attachments/20130604/4c942311/attachment.html>


More information about the Gluster-users mailing list