#!/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 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 < $B0/out1 2> /dev/null" TEST "getfattr -n trusted.afr.test-locks-1 $B0/test2/file --only-values > $B0/out2 2> /dev/null" TEST ! cmp $B0/out1 $B0/out2 TEST rm -f $B0/out1 $B0/out2 TEST rm -f $M0/file TEST umount $M0 rm -f $B0/test.vol rm -rf $B0/test1 $B0/test2 cleanup;