Emmanuel,<div>  Can you give some more info about the happening writes and truncates. Are they all happening on the same FD? Is it possible to get paste strace -f output of the ftpd performing writes on the gluster mount?</div>
<div><br></div><div>Avati<br><br><div class="gmail_quote">On Sat, Jul 16, 2011 at 5:49 PM, Emmanuel Dreyfus <span dir="ltr">&lt;<a href="mailto:manu@netbsd.org">manu@netbsd.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Emmanuel Dreyfus &lt;<a href="mailto:manu@netbsd.org">manu@netbsd.org</a>&gt; wrote:<br>
<br>
&gt; client# md5 gnusrc.tgz<br>
&gt; MD5 (gnusrc.tgz) = 471a73c374ec2b5733571c01647a69d5<br>
&gt;<br>
&gt; server# md5 /export/wd3a/tmp/gnusrc.tgz<br>
&gt; MD5 (/export/wd3a/tmp/gnusrc.tgz) = cf03446a7f31713002ef3b74020b173f<br>
<br>
Here are the results of my investigations. It seems this is caused on<br>
the client, by reordering of ftruncate() and write() by<br>
performance/write-behind<br>
<br>
Above write-behind, we get this:<br>
write(sizeA, offsetA)<br>
ftruncate(offsetB)<br>
write(sizeB, offsetB)<br>
write(sizeC, offsetC)<br>
write(sizeD, offsetD)<br>
<br>
And below, this turns into:<br>
write(sizeA, offsetA)<br>
write(sizeB, offsetB)<br>
write(sizeC, offsetC)<br>
ftruncate(offsetB)<br>
write(sizeD, offsetD)<br>
<br>
Result is that data between offsetB and offsetD is filled with zeros.<br>
<br>
Removing the performance/write-behind xlator on the client fixes the<br>
problem.<br>
<br>
Nobody else got this problem? It may be NetBSD-specific, since the<br>
ftruncate() come from FUSE SETATTR issued by the NetBSD kernel to update<br>
the file size. I could filter out such messages, but I am not sure it<br>
would not have side effects.<br>
<br>
--<br>
Emmanuel Dreyfus<br>
<a href="http://hcpnet.free.fr/pubz" target="_blank">http://hcpnet.free.fr/pubz</a><br>
<a href="mailto:manu@netbsd.org">manu@netbsd.org</a><br>
<br>
_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@nongnu.org">Gluster-devel@nongnu.org</a><br>
<a href="https://lists.nongnu.org/mailman/listinfo/gluster-devel" target="_blank">https://lists.nongnu.org/mailman/listinfo/gluster-devel</a><br>
</blockquote></div><br></div>