<div dir="ltr"><div><div><div><div>George,<br><br></div>Sorry. I sent you a version of the fix which was stale. Can you try with:<br><a href="https://review.gluster.org/20549">https://review.gluster.org/20549</a><br><br></div>This patch passes the test case you&#39;ve given.<br><br></div>regards,<br></div>Raghavendra<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 20, 2018 at 2:59 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_4142108453723750312WordSection1">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Hi,<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">Sorry, there seems still have issue.<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">We use
</span><span style="font-size:10.5pt;font-family:DengXian">“<span lang="EN-US">dd</span>”<span lang="EN-US"> application of linux tools instead of my demo program, and if the file is not exist before dd, the issue still be there.<u></u><u></u></span></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">The test command is
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">rm -rf /mnt/test/file.txt ; dd if=/dev/zero of=/mnt/test/file.txt bs=512 count=1 oflag=sync;stat /mnt/test/file.txt;tar -czvf /tmp/abc.gz<u></u><u></u></span></p>
<p class="m_4142108453723750312MsoListParagraph" style="margin-left:18.0pt">
<u></u><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"><span>1)<span style="font:7.0pt &quot;Times New Roman&quot;">    
</span></span></span><u></u><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">If we set md-cache-timeout to 0, the issue will not happen<u></u><u></u></span></p>
<p class="m_4142108453723750312MsoListParagraph" style="margin-left:18.0pt">
<u></u><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US"><span>2)<span style="font:7.0pt &quot;Times New Roman&quot;">    
</span></span></span><u></u><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">If we set md-cache-timeout to 1, the issue will 100% reproduced! (with new patch you mentioned in the mail)<u></u><u></u></span></p>
<p class="m_4142108453723750312MsoListParagraph" style="margin-left:18.0pt;text-indent:0cm"><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">Please see detail test result as the below:<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">bash-4.4# gluster v set export md-cache-timeout 0<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">volume set: failed: Volume export does not exist<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">bash-4.4# gluster v set test md-cache-timeout 0<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">volume set: success<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">bash-4.4# dd if=/dev/zero of=/mnt/test/file.txt bs=512 count=1 oflag=sync;stat /mnt/test/file.txt;tar -czvf /tmp/abc.gz /mnt/test/file.txt;stat /mnt/test/file.txt^C<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">bash-4.4# rm /mnt/test/file.txt<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">bash-4.4# dd if=/dev/zero of=/mnt/test/file.txt bs=512 count=1 oflag=sync;stat /mnt/test/file.txt;tar -czvf /tmp/abc.gz /mnt/test/file.txt;stat /mnt/test/file.txt<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">1+0 records in<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">1+0 records out<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">512 bytes copied, 0.00932571 s, 54.9 kB/s<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">  File: /mnt/test/file.txt<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">  Size: 512             Blocks: 1          IO Block: 131072 regular file<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Device: 33h/51d Inode: 9949244856126716752  Links: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Access: 2018-07-13 17:55:02.756000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Modify: 2018-07-13 17:55:02.764000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Change: 2018-07-13 17:55:02.768000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Birth: -<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">tar: Removing leading `/&#39; from member names<u></u><u></u></span></p>
</span><p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">/mnt/test/file.txt<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">  File: /mnt/test/file.txt<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">  Size: 512             Blocks: 1          IO Block: 131072 regular file<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Device: 33h/51d Inode: 9949244856126716752  Links: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Access: 2018-07-13 17:55:02.776000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Modify: 2018-07-13 17:55:02.764000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Change: 2018-07-13 17:55:02.768000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Birth: -<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">bash-4.4# gluster v set test md-cache-timeout 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">volume set: success<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">bash-4.4# rm /mnt/test/file.txt<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">bash-4.4# dd if=/dev/zero of=/mnt/test/file.txt bs=512 count=1 oflag=sync;stat /mnt/test/file.txt;tar -czvf /tmp/abc.gz /mnt/test/file.txt;stat /mnt/test/file.txt<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">1+0 records in<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">1+0 records out<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">512 bytes copied, 0.0107589 s, 47.6 kB/s<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">  File: /mnt/test/file.txt<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">  Size: 512             Blocks: 1          IO Block: 131072 regular file<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Device: 33h/51d Inode: 13569976446871695205  Links: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Access: 2018-07-13 17:55:11.548000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Modify: 2018-07-13 17:55:11.560000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Change: 2018-07-13 17:55:11.560000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Birth: -<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">tar: Removing leading `/&#39; from member names<u></u><u></u></span></p>
</span><p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">/mnt/test/file.txt<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">tar: /mnt/test/file.txt: file changed as we read it<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">  File: /mnt/test/file.txt<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">  Size: 512             Blocks: 1          IO Block: 131072 regular file<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Device: 33h/51d Inode: 13569976446871695205  Links: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Access: 2018-07-13 17:55:11.580000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Modify: 2018-07-13 17:55:11.560000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Change: 2018-07-13 17:55:11.564000000 +0000<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">Birth: -<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>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian" lang="EN-US">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"><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> Friday, July 20, 2018 4:01 PM<span class=""><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>
</span><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;; Raghavendra G &lt;<a href="mailto:raghavendra@gluster.com" target="_blank">raghavendra@gluster.com</a>&gt;; <a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a></span></p><div><div class="h5"><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></div></div><p></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 Fri, Jul 20, 2018 at 1:22 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-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<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" 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">The patch can resolve this issue, I have verified in Gluster 4.2(master trunk branch) and Gluster 3.12.3!</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">Thanks we&#39;ll merge it.<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-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<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">Thanks &amp; 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>
<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"><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">
</span><span lang="EN-US"><a href="mailto:gluster-devel-bounces@gluster.org" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">gluster-devel-bounces@gluster.<wbr>org</span></a></span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US">
 [mailto:</span><span lang="EN-US"><a href="mailto:gluster-devel-bounces@gluster.org" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">gluster-devel-bounces@<wbr>gluster.org</span></a></span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US">]
<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;</span><span lang="EN-US"><a href="mailto:george.lian@nokia-sbell.com" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">george.lian@nokia-sbell.com</span></a></span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US">&gt;<br>
<b>Cc:</b> Zhang, Bingxuan (NSB - CN/Hangzhou) &lt;</span><span lang="EN-US"><a href="mailto:bingxuan.zhang@nokia-sbell.com" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">bingxuan.zhang@nokia-sbell.<wbr>com</span></a></span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US">&gt;;
</span><span lang="EN-US"><a href="mailto:Gluster-devel@gluster.org" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">Gluster-devel@gluster.org</span></a></span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US">;
 Raghavendra G &lt;</span><span lang="EN-US"><a href="mailto:raghavendra@gluster.com" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">raghavendra@gluster.com</span></a></span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US">&gt;<br>
<b>Subject:</b> Re: [Gluster-devel] The ctime of fstat is not correct which lead to &quot;tar&quot; utility error</span><span lang="EN-US"><u></u><u></u></span></p>
<div>
<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"> <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-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<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-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<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-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<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>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
</div>
</div></div></div>
</div>

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