From 0857896d2a4daa025fa69db6294f66c5da312fe6 Mon Sep 17 00:00:00 2001 From: Anuradha Date: Tue, 16 Jun 2015 15:57:30 +0530 Subject: cluster/afr : truncate all sinks files Backport of: http://review.gluster.org/11252/ Problem : During data self-heal of sparse files, sparseness of files is lost. Cause : Earlier, only files with larger ia_size in sinks were being truncated to ia_size of source. This caused checksum mismatch of sparse blocks when ia_size of files in sinks were lesser than ia_size of source file. Leading to unnecessary healing of sparse blocks. As a result of which sparseness of files was lost. Solution : truncate files in all the sinks irrespective of their size with respect to the source file. After this change, checksum won't mismatch for sparse blocks and heal won't be triggered. As a result, sparseness of the files will be preserved. Other fixes in this patch : 1) in afr_does_size_mismatch(), check for mismatch only in sources. Previously, the check was being done for all children in a replica. 2) in __afr_selfheal_data_checksums_match(), check checksum mismatch only for children with valid responses. Change-Id: Ifcdb1cdc9b16c4a8a7867aecf9fa94b66e5301c2 BUG: 1235966 Signed-off-by: Anuradha Talur Reviewed-on: http://review.gluster.org/11423 Tested-by: Gluster Build System Reviewed-by: Ravishankar N Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri --- tests/bugs/glusterfs/bug-853690.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/bugs/glusterfs/bug-853690.t b/tests/bugs/glusterfs/bug-853690.t index d81be011438..59facfcddb0 100755 --- a/tests/bugs/glusterfs/bug-853690.t +++ b/tests/bugs/glusterfs/bug-853690.t @@ -65,7 +65,7 @@ TEST glusterfs --volfile=$B0/test.vol --attribute-timeout=0 --entry-timeout=0 $M # Send a single write, guaranteed to be short on one replica, and attempt to # read the data back. Failure to detect the short write results in different # file sizes and immediate split-brain (EIO). -TEST dd if=/dev/zero of=$M0/file bs=128k count=1 +TEST dd if=/dev/urandom of=$M0/file bs=128k count=1 TEST dd if=$M0/file of=/dev/null bs=128k count=1 ######## # -- cgit