<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 12:21 AM, Vijay Bellur <span dir="ltr">&lt;<a href="mailto:vbellur@redhat.com" target="_blank">vbellur@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Adding gluster-devel.<br>
<br>
<br>
On 03/06/2014 01:15 PM, Krishnan Parthasarathi wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
All,<br>
<br>
In recent discussions around design (and implementation) of the barrier<br>
feature, couple of things came to light.<br>
<br>
1) changelog xlator needs barrier xlator to block unlink and rename FOPs<br>
    in the call path. This is apart from the current list of FOPs that are blocked<br>
    in their call back path.<br>
    This is to make sure that the changelog has a bounded queue of unlink and rename FOPs,<br>
    from the time barriering is enabled, to be drained, committed to changelog file and published.<br></blockquote></blockquote><div><br></div><div>Why is this necessary?</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2) It is possible in a pure distribute volume that the following sequence of FOPs could result<br>
    in snapshots of bricks disagreeing on inode type for a file or directory.<br>
<br>
    t1: snap b1<br>
    t2: unlink /a<br>
    t3: mkdir /a<br>
    t4: snap b2<br>
<br>
where, b1 and b2 are bricks of a pure distribute volume V.<br>
<br>
The above sequence can happen with the current barrier xlator design, since we allow unlink FOPs<br>
to go through to the disk and only block their acknowledgement to the application. This implies<br>
a concurrent mkdir on the same name could succeed, since DHT doesn&#39;t serialize unlink and mkdir FOPs,<br>
unlike AFR.<br>
<br>
Avati,<br>
<br>
I hear that you have a solution for problem 2). Could you please start the discussion on this thread?<br>
It would help us to decide how to go about with the barrier xlator implementation.<br></blockquote></blockquote><div><br></div><div><br></div><div>The solution is really a long pending implementation of dentry serialization in the resolver of protocol server. Today we allow multiple FOPs to happen in parallel which modify the same dentry. This results in hairy races (including non atomicity of rename) and has been kept open for a while now. Implementing the dentry serialization in the resolver will &quot;solve&quot; 2 as a side effect. Hence that is a better approach than making changes in the barrier translator.</div>
<div><br></div><div>Avati </div></div></div></div>