<div dir="ltr"><div><div><div>Todd,<br><br></div>Thanks for your reply. But how can I take this brick offline? Since the gluster volume has replicate count 2, it won&#39;t allow me to remove one brick. Is there a command which can take one replicate brick offline?<br>
<br></div>Many thanks.<br><br></div>Liang <br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 8, 2013 at 3:02 PM, Todd Pfaff <span dir="ltr">&lt;<a href="mailto:pfaff@rhpcs.mcmaster.ca" target="_blank">pfaff@rhpcs.mcmaster.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Liang,<br>
<br>
I don&#39;t claim to know the answer to your question, and my knowledge of zfs<br>
is minimal at best so I may be way off base here, but it seems to me that<br>
your attempted random corruption with this command:<div class="im"><br>
<br>
  dd if=/dev/urandom of=/dev/<u></u>sda6 bs=1024 count=20480<br>
<br></div>
is likely going to corrupt the underlying zfs filesystem metadata, not<br>
just file data, and I wouldn&#39;t expect gluster to be able to fixed a<br>
brick&#39;s corrupted filesystem.  Perhaps you now have to take the brick<br>
offline, fix any zfs filesystem errors if possible, bring the brick back<br>
online and see what then happens with self-heal.<br>
<br>
--<br>
Todd Pfaff &lt;<a href="mailto:pfaff@mcmaster.ca" target="_blank">pfaff@mcmaster.ca</a>&gt;<br>
<a href="http://www.rhpcs.mcmaster.ca/" target="_blank">http://www.rhpcs.mcmaster.ca/</a><div class="HOEnZb"><div class="h5"><br>
<br>
On Tue, 8 Jan 2013, Liang Ma wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi There,<br>
<br>
I&#39;d like to test and understand the self heal feature of glusterfs. This is<br>
what I did with 3.3.1-ubuntu1~precise4 on Ubuntu 12.04.1 LTS.<br>
<br>
gluster volume create gtest replica 2 gluster3:/zfs-test gluster4:/zfs-test<br>
where zfs-test is a zfs pool on partition /dev/sda6 in both nodes.<br>
<br>
To simulate a random corruption on node gluster3<br>
<br>
dd if=/dev/urandom of=/dev/<u></u>sda6 bs=1024 count=20480<br>
<br>
Now zfs detected the corrupted files<br>
<br>
  pool: zfs-test<br>
 state: ONLINE<br>
status: One or more devices has experienced an error resulting in data<br>
        corruption.  Applications may be affected.<br>
action: Restore the file in question if possible.  Otherwise restore the<br>
        entire pool from backup.<br>
   see: <a href="http://zfsonlinux.org/msg/ZFS-8000-8A" target="_blank">http://zfsonlinux.org/msg/ZFS-<u></u>8000-8A</a><br>
 scan: none requested<br>
config:<br>
<br>
        NAME        STATE     READ WRITE CKSUM<br>
        zfs-test   ONLINE       0     0 2.29K<br>
          sda6     ONLINE       0     0 4.59K<br>
<br>
errors: Permanent errors have been detected in the following files:<br>
<br>
        /zfs-test/&lt;xattrdir&gt;/trusted.<u></u>gfid<br>
        /zfs-test/.glusterfs/b0/1e/<u></u>b01ec17c-14cc-4999-938b-<u></u>b4a71e358b46<br>
        /zfs-test/.glusterfs/b0/1e/<u></u>b01ec17c-14cc-4999-938b-<u></u>b4a71e358b46/&lt;xat<br>
trdir&gt;/trusted.gfid<br>
        /zfs-test/.glusterfs/dd/8c/<u></u>dd8c6797-18c3-4f3b-b1ca-<u></u>86def2b578c5/&lt;xat<br>
trdir&gt;/trusted.gfid<br>
<br>
Now the gluster log file shows the self heal can&#39;t fix the corruption<br>
[2013-01-08 12:46:03.371214] W<br>
[afr-common.c:1196:afr_detect_<u></u>self_heal_by_iatt] 2-gtest-replicate-0:<br>
/K.iso: gfid different on subvolume<br>
[2013-01-08 12:46:03.373539] E<br>
[afr-self-heal-common.c:1419:<u></u>afr_sh_common_lookup_cbk] 2-gtest-replicate-0:<br>
Missing Gfids for /K.iso<br>
[2013-01-08 12:46:03.385701] E<br>
[afr-self-heal-common.c:2160:<u></u>afr_self_heal_completion_cbk]<br>
2-gtest-replicate-0: background  gfid self-heal failed on /K.iso<br>
[2013-01-08 12:46:03.385760] W [fuse-bridge.c:292:fuse_entry_<u></u>cbk]<br>
0-glusterfs-fuse: 11901: LOOKUP() /K.iso =&gt; -1 (No data available)<br>
<br>
where K.iso is one of the sample files affected by the dd command.<br>
<br>
So could anyone tell me what is the best way to repair the simulated<br>
corruption?<br>
<br>
Thank you.<br>
<br>
Liang<br>
<br>
<br>
</blockquote>
</div></div></blockquote></div><br></div>