<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 20, 2018 at 1:22 PM, Lian, George (NSB - CN/Hangzhou) <span dir="ltr">&lt;<a href="mailto:george.lian@nokia-sbell.com" target="_blank">george.lian@nokia-sbell.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="ZH-CN">
<div class="m_6702556926408735423WordSection1"><span class="">
<p class="MsoNormal"><span lang="EN-US">&gt;&gt;&gt;We recently identified an issue with stat-prefetch. Fix can be found at:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">&gt;&gt;&gt;<a href="https://review.gluster.org/#/c/20410/11" target="_blank">https://review.gluster.org/<wbr>#/c/20410/11</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">&gt;&gt;&gt;Can you let us know whether this helps?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">The patch can resolve this issue, I have verified in Gluster 4.2(master trunk branch) and Gluster 3.12.3!</span></p></div></div></blockquote><div><br></div><div>Thanks we&#39;ll merge it.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="ZH-CN"><div class="m_6702556926408735423WordSection1"><p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Thanks &amp; Best Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">George<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US"> <a href="mailto:gluster-devel-bounces@gluster.org" target="_blank">gluster-devel-bounces@gluster.<wbr>org</a> [mailto:<a href="mailto:gluster-devel-bounces@gluster.org" target="_blank">gluster-devel-bounces@<wbr>gluster.org</a>]
<b>On Behalf Of </b>Raghavendra Gowdappa<br>
<b>Sent:</b> Thursday, July 19, 2018 5:06 PM<br>
<b>To:</b> Lian, George (NSB - CN/Hangzhou) &lt;<a href="mailto:george.lian@nokia-sbell.com" target="_blank">george.lian@nokia-sbell.com</a>&gt;<br>
<b>Cc:</b> Zhang, Bingxuan (NSB - CN/Hangzhou) &lt;<a href="mailto:bingxuan.zhang@nokia-sbell.com" target="_blank">bingxuan.zhang@nokia-sbell.<wbr>com</a>&gt;; <a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a>; Raghavendra G &lt;<a href="mailto:raghavendra@gluster.com" target="_blank">raghavendra@gluster.com</a>&gt;<br>
<b>Subject:</b> Re: [Gluster-devel] The ctime of fstat is not correct which lead to &quot;tar&quot; utility error<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On Thu, Jul 19, 2018 at 2:29 PM, Lian, George (NSB - CN/Hangzhou) &lt;<a href="mailto:george.lian@nokia-sbell.com" target="_blank">george.lian@nokia-sbell.com</a>&gt; wrote:<u></u><u></u></span></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Hi, Gluster Experts,</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">In glusterfs version 3.12.3, There seems a
</span><span style="font-size:10.5pt;font-family:DengXian">“<span lang="EN-US">fstat</span>”<span lang="EN-US"> issue for ctime after we use fsync,
</span></span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">We have a demo execute binary which write some data and then do fsync for this file, it named as
</span><span style="font-size:10.5pt;font-family:DengXian">“<span lang="EN-US">tt</span>”<span lang="EN-US">,</span></span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Then run tar command right after
</span><span style="font-size:10.5pt;font-family:DengXian">“<span lang="EN-US">tt</span>”<span lang="EN-US"> command, it will always error with
</span>“<span lang="EN-US">tar: /mnt/test/file1.txt: file changed as we read it</span>”</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">The command output is list as the below, the source code and volume info configuration attached FYI,</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">This issue will be 100% reproducible! (/mnt/test is mountpoint of glusterfs volume
</span><span style="font-size:10.5pt;font-family:DengXian">“<span lang="EN-US">test</span>”<span lang="EN-US"> , which the volume info is attached in mail)</span></span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">------------------------------<wbr>------------------------------<wbr>------</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">./tt;tar -czvf /tmp/abc.gz /mnt/test/file1.txt</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">mtime:1531247107.272000000</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">ctime:1531247107.272000000</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">tar: Removing leading `/&#39; from member names</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">/mnt/test/file1.txt</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">tar: /mnt/test/file1.txt: file changed as we read it</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">------------------------------<wbr>------------------------------<wbr>----------</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">After my investigation, the xattrop for changelog is later than the fsync response , this is mean:</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">In function
</span><span style="font-size:10.5pt" lang="EN-US"> </span><span style="font-size:10.5pt;font-family:DengXian">“<span lang="EN-US">afr_fsync_cbk</span>”<span lang="EN-US"> will call afr_delayed_changelog_wake_<wbr>resume (this, local-&gt;fd, stub);</span></span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">In our case, it always a pending changelog , so glusterfs save the metadata information to stub, and handle pending
 changelog first,</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">But the changelog will also change the ctime, from the packet captured by tcpdump, the response packet of xattrop
 will not include the metadata information,</span><span style="font-size:10.5pt" lang="EN-US"> </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> and the wake_resume also not handle this metadata changed case.</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">So in this case, the metadata in mdc_cache is not right, and when cache is valid, the application will get WRONG
 metadata!</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">For verify my guess, if I change the configuration for this volume</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-indent:36.75pt">
<span style="font-size:10.5pt;font-family:DengXian">“<span lang="EN-US">gluster v set test md-cache-timeout 0</span>”<span lang="EN-US"> or</span></span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-indent:36.75pt">
<span style="font-size:10.5pt;font-family:DengXian">“<span lang="EN-US">gluster v set export stat-prefetch off</span>”</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">This issue will be GONE!</span><span lang="EN-US"><u></u><u></u></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">We recently identified an issue with stat-prefetch. Fix can be found at:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><a href="https://review.gluster.org/#/c/20410/11" target="_blank">https://review.gluster.org/#/<wbr>c/20410/11</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Can you let us know whether this helps?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">And I restore the configuration to default, which mean stat-prefetch is on and md-cache-timeout is 1 second,</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">I try invalidate the md-cache in source code as the below in function mdc_fync_cbk on md-cache.c</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">The issue also will be GONE!</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">So GLusterFS Experts,</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Could you please verify this issue, and share your comments on my investigation?</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">And your finally solutions is highly appreciated!</span><span lang="EN-US"><u></u><u></u></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Does the following fix you&#39;ve posted solves the problem?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">------------------------------<wbr>------changes in function
</span><span style="font-size:10.5pt;font-family:DengXian">“<span lang="EN-US">mdc_fsync_cbk</span>”</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">int</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">mdc_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">              </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> int32_t op_ret, int32_t op_errno,</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">              </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> struct iatt *prebuf, struct iatt *postbuf, dict_t
 *xdata)</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">{</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">       </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> mdc_local_t</span><span style="font-size:10.5pt" lang="EN-US"> </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">
 *local = NULL;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">       </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> local = frame-&gt;local;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">       </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> if (op_ret != 0)</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">               </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> goto out;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">       </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> if (!local)</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">               </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> goto out;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">       </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> mdc_inode_iatt_set_validate(<wbr>this, local-&gt;fd-&gt;inode, prebuf,
 postbuf,</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">                              <wbr>      </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> _gf_true);</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">/* new added for ctime issue*/</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">       </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> mdc_inode_iatt_invalidate(<wbr>this, local-&gt;fd-&gt;inode);</span><span style="font-size:10.5pt" lang="EN-US">            <wbr>                       </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">
</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">/* new added end*/</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">out:</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">       </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> MDC_STACK_UNWIND (fsync, frame, op_ret, op_errno, prebuf,
 postbuf,</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">                         </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> xdata);</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt" lang="EN-US">       </span><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"> return 0;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">}</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">------------------------------<wbr>------------------------------<wbr>---------------------</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Best Regards,</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">George</span><span lang="EN-US"><u></u><u></u></span></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
</div>
</div></div></div>
</div>

</blockquote></div><br></div></div>