<div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 12, 2018 at 6:49 PM Anuradha Talur <<a href="mailto:atalur@commvault.com">atalur@commvault.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr" style="font-size:10pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:"Courier New",monospace">
<p>Hi,<br>
<br>
We recently started testing cloudsync xlator on a replica volume.<br>
And we have noticed a few issues. We would like some advice on how to proceed with them.<br>
<br>
</p>
<p><span style="font-size:10pt">1) As we know, when stubbing a file</span><span style="font-size:10pt"> cloudsync uses mtime of files to decide whether a file should be truncated or not.</span></p>
<p>If the mtime provided as part of the setfattr operation is lesser than the current mtime of the file on brick, stubbing isn't completed.</p>
<p>This works fine in a plain distribute volume. <span style="font-size:10pt">B</span><span style="font-size:10pt">ut i</span><span style="font-size:10pt">n case of a replica volume, the mtime</span><span style="font-size:10pt"> could be different for
the files on each of the replica </span><span style="font-size:10pt">brick.</span></p>
<p><br>
During our testing we came across the following scenario for a replica 3 volume with 3 bricks:<br>
<br>
We performed `setfattr -n "trusted.glusterfs.csou.complete" -v m1 file1` from our gluster mount to stub the files.<br>
It so happened that on brick1 this operation succeeded and truncated file1 as it should have. But on brick2 and brick3, mtime found on file1<br>
was greater than m1, leading to failure there.<br>
<br>
From AFR's perspective this operation failed as a whole because quorum could not be met. But on the brick where this setxattr succeeded, truncate was already performed. So now we have one of the replica bricks out of sync and AFR has no awareness of this.
This file needs to be rolled back to its state before the<br>
</p>
<p>setfattr.<br>
<br>
Ideally, it appears that we should add intelligence in AFR to handle this. <span style="font-family:"Courier New",monospace;font-size:13.3333px;background-color:rgb(255,255,255)">How do you suggest we do that?</span><br>
</p>
<p><span style="font-family:"Courier New",monospace;font-size:13.3333px;background-color:rgb(255,255,255)">The case is also applicable to EC volumes of course.<br>
<br>
2) Given that cloudsync depends on mtime to make the decision of truncating, how do we ensure that we don't end up in this situation again?<br></span></p></div></blockquote><div><br></div><div>Thank you for your feedback.</div><div><br></div><div>At the outset it looks like these problems can be addressed by enabling consistent attributes feature in posix [1]. Can you please enable that option and re-test these cases?</div><div><br></div><div>Regards,</div><div>Vijay</div><div><br></div><div>[1] <a href="https://review.gluster.org/#/c/19267/8/doc/features/ctime.md">https://review.gluster.org/#/c/19267/8/doc/features/ctime.md</a></div></div></div></div>