<div dir="ltr"><div dir="ltr">Hi Kotresh,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 17, 2019 at 1:50 PM Kotresh Hiremath Ravishankar &lt;<a href="mailto:khiremat@redhat.com">khiremat@redhat.com</a>&gt; 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"><div>Hi All,</div><div><br></div><div>The ctime feature is enabled by default from release gluster-6. But as explained in bug [1]  there is a known issue with legacy files i.e., the files which are created before ctime feature is enabled. These files would not have &quot;trusted.glusterfs.mdata&quot; xattr which maintain time attributes. So on, accessing those files, it gets created with latest time attributes. This is not correct because all the time attributes (atime, mtime, ctime) get updated instead of required time attributes.<br><br>There are couple of approaches to solve this.</div><div><br></div><div>1. On accessing the files, let the posix update the time attributes from  the back end file on respective replicas. This obviously results in inconsistent &quot;trusted.glusterfs.mdata&quot; xattr values with in replica set. AFR/EC should heal this xattr as part of metadata heal upon accessing this file. It can chose to replicate from any subvolume. Ideally we should consider the highest time from the replica and treat it as source but I think that should be fine as replica time attributes are mostly in sync with max difference in order of few seconds if am not wrong. </div><div><br></div><div>   But client side self heal is disabled by default because of performance reasons [2]. If we chose to go by this approach, we need to consider enabling at least client side metadata self heal by default. Please share your thoughts on enabling the same by default.</div><div><br></div><div>2. Don&#39;t let posix update the legacy files from the backend. On lookup cbk, let the utime xlator update the time attributes from statbuf received synchronously. </div><div><br></div><div>Both approaches are similar as both results in updating the xattr during lookup. Please share your inputs on which approach is better. </div></div></blockquote><div><br></div><div>I prefer second approach. First approach is not feasible for EC volumes because self-heal requires that k bricks (on a k+r configuration) agree on the value of this xattr, otherwise it considers the metadata damaged and needs manual intervention to fix it. During upgrade, first r bricks with be upgraded without problems, but trusted.glusterfs.mdata won&#39;t be healed because r &lt; k. In fact this xattr will be removed from new bricks because the majority of bricks agree on xattr not being present. Once the r+1 brick is upgraded, it&#39;s possible that posix sets different values for trusted.glusterfs.mdata, which will cause self-heal to fail.</div><div><br></div><div>Second approach seems better to me if guarded by a new option that enables this behavior. utime xlator should only update the mdata xattr if that option is set, and that option should only be settable once all nodes have been upgraded (controlled by op-version). In this situation the first lookup on a file where utime detects that mdata is not set, will require a synchronous update. I think this is good enough because it will only happen once per file. We&#39;ll need to consider cases where different clients do lookups at the same time, but I think this can be easily solved by ignoring the request if mdata is already present.</div><div><br></div><div>Xavi</div><div><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"><div><br></div><div><br></div><div><br></div><div>[1] <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1593542" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1593542</a></div><div>[2] <a href="https://github.com/gluster/glusterfs/issues/473" target="_blank">https://github.com/gluster/glusterfs/issues/473</a></div><div><br></div>-- <br><div dir="ltr" class="gmail-m_-6308520181934418538gmail_signature"><div dir="ltr"><div>Thanks and Regards,<br></div>Kotresh H R<br></div></div></div>
</blockquote></div></div>