<div dir="ltr">No problem. Glad to be of help.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 14 April 2013 05:31, Daniel Mons <span dir="ltr">&lt;<a href="mailto:daemons@kanuka.com.au" target="_blank">daemons@kanuka.com.au</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Running the following script on an unimportant tree in the cluster<br>
this weekend as a test.  So far, so good, and it appears to be doing<br>
what I want.<br>
<br>
Thanks again Pete for the recommendation.<br>
<br>
-Dan<br>
<br>
<br>
#!/bin/bash<br>
BR=&#39;-------------------------&#39;<br>
UUID=$(/usr/bin/uuidgen)<br>
if [ &quot;$UUID&quot; == &quot;&quot; ]<br>
        then<br>
        echo &quot;UUID is null&quot;<br>
        exit 1<br>
fi<br>
find &quot;/mnt/blah/&quot; -type f | while read FILE<br>
do<br>
        DNAME=$(dirname &quot;${FILE}&quot;)<br>
        FNAME=$(basename &quot;${FILE}&quot;)<br>
        cd &quot;${DNAME}&quot;<br>
        if (( $? &gt; 0 ))<br>
        then<br>
                echo &quot;Bad cd operation&quot;<br>
                exit 1<br>
        fi<br>
        pwd<br>
        mv -v &quot;${FNAME}&quot; &quot;${FNAME}.${UUID}&quot;<br>
        if (( $? &gt; 0 ))<br>
        then<br>
                echo &quot;Bad mv operation&quot;<br>
                exit 1<br>
        fi<br>
        cp -pv &quot;${FNAME}.${UUID}&quot; &quot;${FNAME}&quot;<br>
        if (( $? &gt; 0 ))<br>
        then<br>
                echo &quot;Bad cp operation&quot;<br>
                exit 1<br>
        fi<br>
        rm -fv &quot;${FNAME}.${UUID}&quot;<br>
        if (( $? &gt; 0 ))<br>
        then<br>
                echo &quot;Bad rm operation&quot;<br>
                exit 1<br>
        fi<br>
        echo &quot;${BR}&quot;<br>
done<br>
<br>
<br>
On 11 April 2013 22:41, Daniel Mons &lt;<a href="mailto:daemons@kanuka.com.au">daemons@kanuka.com.au</a>&gt; wrote:<br>
&gt; Hi Pete,<br>
&gt;<br>
&gt; Thanks for that link.  I&#39;m going to try this en mass on an unimportant<br>
&gt; directory over the weekend.<br>
&gt;<br>
&gt; -Dan<br>
&gt;<br>
&gt;<br>
&gt; On 11 April 2013 01:41, Pete Smith &lt;<a href="mailto:pete@realisestudio.com">pete@realisestudio.com</a>&gt; wrote:<br>
&gt;&gt; Hi Dan<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ve come up against this recently whilst trying to delete large amounts of<br>
&gt;&gt; files from our cluster.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m resolving it with the method from<br>
&gt;&gt; <a href="http://comments.gmane.org/gmane.comp.file-systems.gluster.user/1917" target="_blank">http://comments.gmane.org/gmane.comp.file-systems.gluster.user/1917</a><br>
&gt;&gt;<br>
&gt;&gt; With Fabric as a helping hand, it&#39;s not too tedious.<br>
&gt;&gt;<br>
&gt;&gt; Not sure about the level of glustershd compatibiity, but it&#39;s working for<br>
&gt;&gt; me.<br>
&gt;&gt;<br>
&gt;&gt; HTH<br>
&gt;&gt;<br>
&gt;&gt; Pete<br>
&gt;&gt; --<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 10 April 2013 11:44, Daniel Mons &lt;<a href="mailto:daemons@kanuka.com.au">daemons@kanuka.com.au</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Our production GlusterFS 3.3.1GA setup is a 3x2 distribute-replicate,<br>
&gt;&gt;&gt; with 100TB usable for staff.  This is one of 4 identical GlusterFS<br>
&gt;&gt;&gt; clusters we&#39;re running.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Very early in the life of our production Gluster rollout, we ran<br>
&gt;&gt;&gt; Netatalk 2.X to share files with MacOSX clients (due to slow negative<br>
&gt;&gt;&gt; lookup on CIFS/Samba for those pesky resource fork files in MacOSX&#39;s<br>
&gt;&gt;&gt; Finder).  Netatalk 2.X wrote it&#39;s CNID_DB files back to Gluster, which<br>
&gt;&gt;&gt; caused enormous IO, locking up many nodes at a time (lots of &quot;hung<br>
&gt;&gt;&gt; task&quot; errors in dmesg/syslog).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; We&#39;ve since moved to Netatalk 3.X which puts its CNID_DB files<br>
&gt;&gt;&gt; elsewhere (we put them on local SSD RAID), and the lockups have<br>
&gt;&gt;&gt; vanished.  However, our split-brain files number in the tens of<br>
&gt;&gt;&gt; thousands to to those previous lockups, and aren&#39;t always predictable<br>
&gt;&gt;&gt; (i.e.: it&#39;s not always the case where brick0 is &quot;good&quot; and brick1 is<br>
&gt;&gt;&gt; &quot;bad&quot;).  Manually fixing the files is far too time consuming.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;ve written a rudimentary script that trawls<br>
&gt;&gt;&gt; /var/log/glusterfs/glustershd.log for split-brain GFIDs, tracks it<br>
&gt;&gt;&gt; down on the matching pair of bricks, and figures out via a few rules<br>
&gt;&gt;&gt; (size tends to be a good indicator for us, as bigger files tend to be<br>
&gt;&gt;&gt; more rencent ones) which is the &quot;good&quot; file.  This works for about 80%<br>
&gt;&gt;&gt; of files, which will dramatically reduce the amount of data we have to<br>
&gt;&gt;&gt; manually check.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; My question is: what should I do from here?  Options are:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Option 1) Delete the file from the &quot;bad&quot; brick<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Option 2)  rsync the file from the &quot;good&quot; brick to the &quot;bad&quot; brick<br>
&gt;&gt;&gt; with -aX flag (preserve everything, including trusted.afr.$server and<br>
&gt;&gt;&gt; trusted.gfid xattrs)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Option 3) rsync the file from &quot;good&quot; to &quot;bad&quot;, and then setfattr -x<br>
&gt;&gt;&gt; trusted.* on the bad brick.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Which of these is considered the better (more glustershd compatible)<br>
&gt;&gt;&gt; option?  Or alternatively, is there something else that&#39;s preferred?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Normally I&#39;d just test this on our backup gluster, however as it was<br>
&gt;&gt;&gt; never running Netatalk, it has no split-brain problems, so I can&#39;t<br>
&gt;&gt;&gt; test the functionality.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks for any insight provided,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -Dan<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; Gluster-users mailing list<br>
&gt;&gt;&gt; <a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a><br>
&gt;&gt;&gt; <a href="http://supercolony.gluster.org/mailman/listinfo/gluster-users" target="_blank">http://supercolony.gluster.org/mailman/listinfo/gluster-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
<span class="HOEnZb"><font color="#888888">&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Pete Smith<br>
&gt;&gt; DevOp/System Administrator<br>
&gt;&gt; Realise Studio<br>
&gt;&gt; 12/13 Poland Street, London W1F 8QB<br>
&gt;&gt; T. <a href="tel:%2B44%20%280%2920%207165%209644" value="+442071659644">+44 (0)20 7165 9644</a><br>
&gt;&gt;<br>
&gt;&gt; <a href="http://realisestudio.com" target="_blank">realisestudio.com</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><font color="#666666"><span style="font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)">Pete Smith</span><br style="padding:0px;margin:0px;font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)">
<span style="font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)">DevOp/System Administrator</span><br style="padding:0px;margin:0px;font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)">
<span style="font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)">Realise Studio</span><br style="padding:0px;margin:0px;font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)">
<span style="font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)">12/13 Poland Street, London W1F 8QB</span><br style="padding:0px;margin:0px;font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)">
<span style="font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)">T. +44 (0)20 7165 9644</span><br style="padding:0px;margin:0px;font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)">
<br style="padding:0px;margin:0px;font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)"><span style="font-family:&#39;Lucida Console&#39;,Courier,&#39;Courier New&#39;;font-size:12px;background-color:rgb(255,255,255)"><a href="http://realisestudio.com" target="_blank">realisestudio.com</a></span></font>
</div>