#!/bin/bash # # Bug 853690 - Test that short writes do not lead to corruption. # # Mismanagement of short writes in AFR leads to corruption and immediately # detectable split-brain. Write a file to a replica volume using error-gen # to cause short writes on one replica. # # Short writes are also possible during heal. If ignored, the files are marked # consistent and silently differ. After reading the file, cause a lookup, wait # for self-heal and verify that the afr xattrs do not match. # ######## . $(dirname $0)/../../include.rc . $(dirname $0)/../../volume.rc cleanup; TEST mkdir -p $B0/test{1,2} # Our graph is a two brick replica with 100% frequency of short writes on one # side of the replica. This guarantees a single write fop leads to an out-of-sync # situation. cat > $B0/test.vol <&1 | grep = | cut -f2 -d=` EXPECT_NOT 0x000000000000000000000000 echo $xa TEST rm -f $M0/file EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 rm -f $B0/test.vol rm -rf $B0/test1 $B0/test2 cleanup;