<html><body><div style="font-family: garamond,new york,times,serif; font-size: 12pt; color: #000000"><div>Seems OK to me, as long as the appropriate locks are taken.</div><div><br></div><div>-Krutika</div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Emmanuel Dreyfus" &lt;manu@netbsd.org&gt;<br><b>To: </b>"Gluster Devel" &lt;gluster-devel@gluster.org&gt;<br><b>Sent: </b>Saturday, December 13, 2014 8:08:03 PM<br><b>Subject: </b>[Gluster-devel] AFR conservative merge portability<br><div><br></div>Hello<br><div><br></div>On NetBSD, tests/basic/afr/entry-self-heal.t always fail on this<br>scenario:<br><div><br></div>mkdir spb_heal<br>kill brick brick0<br>touch spb_heal/0<br>glusterfs volume start force<br>kill_brick brick1<br>touch spb_heal/1<br>glusterfs volume start force<br><div><br></div>At that time, conservative merge takes off and copy spb_heal/0 and<br>spb_heal/1 in each brick where it is missing. That works, but on NetBSD<br>we are left with AFR xattr on spb_heal directory telling each brick<br>accuses the other for metadata. This metadata split brain that will not<br>self heal.<br><div><br></div>This happens because after adding an entry, parent directory (spb_heal<br>here) mtime/ctime must be updated. On Linux, it seems the filesystem is<br>responsible for that. On NetBSD, the kernel filesyste-independant code<br>takes care of it and will send a SETATTR to update ctime/mtime on parent<br>directory.<br><div><br></div>So when we touch spb_heal/0 and spb_heal/1, the NetBSD kernel sends a<br>SETATTR for spb_heal ctime/mtine, and since the other brick is down,<br>here is our metadata split brain.<br><div><br></div>In http://review.gluster.org/9267, Krutika Dhananjay fixes the test by<br>clearing AFR xattr to remove the split brain state, but while it let the<br>test pass, it does not address the real world problem that will leave<br>metadata split brain that does not self heal.<br><div><br></div>Here is a proposal: we know that at the end of conservative merge, we<br>should end up with the situation where directory ctime/mtime is the<br>ctime of the most recently added children. And fortunately, as<br>conservative merge happens, parent directory ctime/mtime are updated on<br>each child addition, and we finish in the desired state.<br><div><br></div>In other words, after conservative merge, parent directory metadata<br>split brain for only ctime/mtime can just be cleared by AFR without any<br>harm.<br><div><br></div>Does it looks reasonable? Any opinion?<br><div><br></div>-- <br>Emmanuel Dreyfus<br>http://hcpnet.free.fr/pubz<br>manu@netbsd.org<br>_______________________________________________<br>Gluster-devel mailing list<br>Gluster-devel@gluster.org<br>http://supercolony.gluster.org/mailman/listinfo/gluster-devel<br></blockquote><div><br></div></div></body></html>