Thanks for the post Joe. We introduced the "diff" based self heal algorithm in 3.1 release.<div><br></div><div>Avati<br><br><div class="gmail_quote">On Tue, May 3, 2011 at 3:38 AM, Joe Landman <span dir="ltr"><<a href="mailto:landman@scalableinformatics.com">landman@scalableinformatics.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi folks<br>
<br>
We've fielded a number of mirroring questions offline as well as watched/participated in discussions here. I thought it was important to make sure some of these are answered and searchable on the lists.<br>
<br>
One major question that kept arising was as follows:<br>
<br>
q: If I have a large image file (say a VM vmdk/other format) on a mirrored volume, will one small change of a few bytes result in a resync of the entire file?<br>
<br>
a: No.<br>
<br>
To test this, we created a 20GB file on a mirror volume.<br>
<br>
root@metal:/local2/home/landman# ls -alF /mirror1gfs/big.file<br>
-rw-r--r-- 1 root root 21474836490 2011-05-02 12:44 /mirror1gfs/big.file<br>
<br>
Then using the following quick and dirty Perl, we appended about 10-20 bytes to the file.<br>
<br>
#!/usr/bin/env perl<br>
<br>
my $file=shift;<br>
my $fh;<br>
open($fh,">>".$file);<br>
print $fh "end ".$$."\n";<br>
close($fh);<br>
<br>
<br>
root@metal:/local2/home/landman# ./<a href="http://app.pl" target="_blank">app.pl</a> /mirror1gfs/big.file<br>
<br>
then I had to write a quick and dirty tail replacement, as I've discovered that tail doesn't seek ... (yeah, it started reading every 'line' of that file ...)<br>
<br>
#!/usr/bin/env perl<br>
<br>
my $file=shift;<br>
my $fh;<br>
my $buf;<br>
<br>
open($fh,"<".$file);<br>
seek $fh,-200,2;<br>
read $fh,$buf,200;<br>
printf "buffer: \'%s\'\n",$buf;<br>
close($fh);<br>
<br>
<br>
root@metal:/local2/home/landman# ./<a href="http://tail.pl" target="_blank">tail.pl</a> /mirror1gfs/big.file<br>
buffer: 'end 19362'<br>
<br>
While running the <a href="http://app.pl" target="_blank">app.pl</a>, I did not see any massive resyncs. I had dstat running in another window.<br>
<br>
You might say, that this is irrelevant, as we only appended, and that could be special cased.<br>
<br>
So I wrote a random updater, that updated at random spots throughtout the large file (sorta like a VM vmdk and other files).<br>
<br>
<br>
#!/usr/bin/env perl<br>
<br>
my $file=shift;<br>
my $fh;<br>
my $buf;<br>
my @stat;<br>
my $loc;<br>
<br>
@stat = stat($file);<br>
$loc = int(rand($stat[7]));<br>
open($fh,">>+".$file);<br>
seek $fh,$loc,0;<br>
printf $fh "I was here!!!";<br>
printf "loc: %i\n",$loc;<br>
close($fh);<br>
<br>
root@metal:/local2/home/landman# ./<a href="http://randupd.pl" target="_blank">randupd.pl</a> /mirror1gfs/big.file<br>
loc: 17598205436<br>
root@metal:/local2/home/landman# ./<a href="http://randupd.pl" target="_blank">randupd.pl</a> /mirror1gfs/big.file<br>
loc: 16468787891<br>
root@metal:/local2/home/landman# ./<a href="http://randupd.pl" target="_blank">randupd.pl</a> /mirror1gfs/big.file<br>
loc: 9271612568<br>
root@metal:/local2/home/landman# ./<a href="http://randupd.pl" target="_blank">randupd.pl</a> /mirror1gfs/big.file<br>
loc: 1356667302<br>
root@metal:/local2/home/landman# ./<a href="http://randupd.pl" target="_blank">randupd.pl</a> /mirror1gfs/big.file<br>
loc: 12365324308<br>
root@metal:/local2/home/landman# ./<a href="http://randupd.pl" target="_blank">randupd.pl</a> /mirror1gfs/big.file<br>
loc: 15654714313<br>
root@metal:/local2/home/landman# ./<a href="http://randupd.pl" target="_blank">randupd.pl</a> /mirror1gfs/big.file<br>
loc: 10127739152<br>
root@metal:/local2/home/landman# ./<a href="http://randupd.pl" target="_blank">randupd.pl</a> /mirror1gfs/big.file<br>
loc: 10259920623<br>
<br>
and again, no massive resyncs.<br>
<br>
So I think its fairly safe to say that the concern over massive resyncs for small updates is not something we see in the field.<br>
<br>
Regards,<br>
<br>
Joe<br>
<br>
-- <br>
Joseph Landman, Ph.D<br>
Founder and CEO<br>
Scalable Informatics Inc.<br>
email: <a href="mailto:landman@scalableinformatics.com" target="_blank">landman@scalableinformatics.com</a><br>
web : <a href="http://scalableinformatics.com" target="_blank">http://scalableinformatics.com</a><br>
<a href="http://scalableinformatics.com/sicluster" target="_blank">http://scalableinformatics.com/sicluster</a><br>
phone: +1 734 786 8423 x121<br>
fax : +1 866 888 3112<br>
cell : +1 734 612 4615<br>
_______________________________________________<br>
Gluster-users mailing list<br>
<a href="mailto:Gluster-users@gluster.org" target="_blank">Gluster-users@gluster.org</a><br>
<a href="http://gluster.org/cgi-bin/mailman/listinfo/gluster-users" target="_blank">http://gluster.org/cgi-bin/mailman/listinfo/gluster-users</a><br>
</blockquote></div><br></div>