"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/basic/afr/data-self-heal.t" between
glusterfs-8.4.tar.gz and glusterfs-8.5.tar.gz

About: GlusterFS is a network/cluster filesystem. The storage server (or each in a cluster) runs glusterfsd and the clients use mount command or glusterfs client to mount the exported filesystem. Release series 8.x.

data-self-heal.t  (glusterfs-8.4):data-self-heal.t  (glusterfs-8.5)
#!/bin/bash #!/bin/bash
#Self-heal tests #Self-heal tests
. $(dirname $0)/../../include.rc . $(dirname $0)/../../include.rc
. $(dirname $0)/../../volume.rc . $(dirname $0)/../../volume.rc
. $(dirname $0)/../../afr.rc . $(dirname $0)/../../afr.rc
cleanup; cleanup;
function create_xattrop_entry { function create_xattrop_entry {
local xattrop_dir0=$(afr_get_index_path $B0/brick0) create_brick_xattrop_entry $B0/brick0 "$@" && create_brick_xattrop_entry
local xattrop_dir1=$(afr_get_index_path $B0/brick1) $B0/brick1 "$@" || exit 1
local base_entry_b0=`ls $xattrop_dir0`
local base_entry_b1=`ls $xattrop_dir1`
local gfid_str
for file in "$@"
do
gfid_str=$(gf_gfid_xattr_to_str $(gf_get_gfid_xattr $B0/brick0/$
file))
ln $xattrop_dir0/$base_entry_b0 $xattrop_dir0/$gfid_str
ln $xattrop_dir1/$base_entry_b1 $xattrop_dir1/$gfid_str
done
} }
function is_heal_done { function is_heal_done {
local f1_path="${1}/${3}" local f1_path="${1}/${3}"
local f2_path="${2}/${3}" local f2_path="${2}/${3}"
local zero_xattr="000000000000000000000000" local zero_xattr="000000000000000000000000"
local size1=$(stat -c "%s" $f1_path) local size1=$(stat -c "%s" $f1_path)
local size2=$(stat -c "%s" $f2_path) local size2=$(stat -c "%s" $f2_path)
local diff=$((size1-size2)) local diff=$((size1-size2))
local xattr11=$(get_hex_xattr trusted.afr.$V0-client-0 $f1_path) local xattr11=$(get_hex_xattr trusted.afr.$V0-client-0 $f1_path)
skipping to change at line 157 skipping to change at line 146
TEST setfattr -n trusted.afr.$V0-client-0 -v 0x000000200000000000000000 $B0/bric k0/size-more-prio-than-self-accused.txt TEST setfattr -n trusted.afr.$V0-client-0 -v 0x000000200000000000000000 $B0/bric k0/size-more-prio-than-self-accused.txt
TEST setfattr -n trusted.afr.$V0-client-1 -v 0x000000300000000000000000 $B0/bric k0/size-more-prio-than-self-accused.txt TEST setfattr -n trusted.afr.$V0-client-1 -v 0x000000300000000000000000 $B0/bric k0/size-more-prio-than-self-accused.txt
TEST setfattr -n trusted.afr.$V0-client-0 -v 0x000000200000000000000000 $B0/bric k1/size-more-prio-than-self-accused.txt TEST setfattr -n trusted.afr.$V0-client-0 -v 0x000000200000000000000000 $B0/bric k1/size-more-prio-than-self-accused.txt
TEST setfattr -n trusted.afr.$V0-client-1 -v 0x000000200000000000000000 $B0/bric k1/size-more-prio-than-self-accused.txt TEST setfattr -n trusted.afr.$V0-client-1 -v 0x000000200000000000000000 $B0/bric k1/size-more-prio-than-self-accused.txt
TEST "echo abc > $B0/brick0/v1-dirty.txt" TEST "echo abc > $B0/brick0/v1-dirty.txt"
TEST "echo def > $B0/brick1/v1-dirty.txt" TEST "echo def > $B0/brick1/v1-dirty.txt"
TEST setfattr -n trusted.afr.$V0-client-0 -v 0x000000200000000000000000 $B0/bric k0/v1-dirty.txt TEST setfattr -n trusted.afr.$V0-client-0 -v 0x000000200000000000000000 $B0/bric k0/v1-dirty.txt
TEST setfattr -n trusted.afr.$V0-client-1 -v 0x000000100000000000000000 $B0/bric k1/v1-dirty.txt TEST setfattr -n trusted.afr.$V0-client-1 -v 0x000000100000000000000000 $B0/bric k1/v1-dirty.txt
#Create base entry in indices/xattrop
echo "Data" > $M0/FILE
rm -f $M0/FILE
EXPECT "1" count_index_entries $B0/brick0
EXPECT "1" count_index_entries $B0/brick1
cd -
#Create gfid hard links for all files before triggering index heals. #Create gfid hard links for all files before triggering index heals.
create_xattrop_entry pending-changelog biggest-file-source.txt biggest-file-more -prio-than-changelog.txt same-size-more-prio-to-changelog.txt size-and-witness-s ame.txt self-accusing-vs-source.txt self-accusing-both.txt self-accusing-vs-inno cent.txt self-accusing-bigger-exists.txt size-more-prio-than-self-accused.txt v1 -dirty.txt TEST create_xattrop_entry pending-changelog biggest-file-source.txt biggest-file -more-prio-than-changelog.txt same-size-more-prio-to-changelog.txt size-and-witn ess-same.txt self-accusing-vs-source.txt self-accusing-both.txt self-accusing-vs -innocent.txt self-accusing-bigger-exists.txt size-more-prio-than-self-accused.t xt v1-dirty.txt
TEST $CLI volume heal $V0 TEST $CLI volume heal $V0
EXPECT_WITHIN $HEAL_TIMEOUT "~" print_pending_heals pending-changelog biggest-fi le-source.txt biggest-file-more-prio-than-changelog.txt same-size-more-prio-to-c hangelog.txt size-and-witness-same.txt self-accusing-vs-source.txt self-accusing -both.txt self-accusing-vs-innocent.txt self-accusing-bigger-exists.txt size-mor e-prio-than-self-accused.txt v1-dirty.txt EXPECT_WITHIN $HEAL_TIMEOUT "~" print_pending_heals pending-changelog biggest-fi le-source.txt biggest-file-more-prio-than-changelog.txt same-size-more-prio-to-c hangelog.txt size-and-witness-same.txt self-accusing-vs-source.txt self-accusing -both.txt self-accusing-vs-innocent.txt self-accusing-bigger-exists.txt size-mor e-prio-than-self-accused.txt v1-dirty.txt
EXPECT "N" is_heal_done $B0/brick0 $B0/brick1 split-brain.txt EXPECT "N" is_heal_done $B0/brick0 $B0/brick1 split-brain.txt
EXPECT "N" is_heal_done $B0/brick0 $B0/brick1 split-brain-all-dirty.txt EXPECT "N" is_heal_done $B0/brick0 $B0/brick1 split-brain-all-dirty.txt
EXPECT "N" is_heal_done $B0/brick0 $B0/brick1 split-brain-with-dirty.txt EXPECT "N" is_heal_done $B0/brick0 $B0/brick1 split-brain-with-dirty.txt
EXPECT "0" stat -c "%s" $M0/pending-changelog EXPECT "0" stat -c "%s" $M0/pending-changelog
TEST cmp $B0/brick0/pending-changelog $B0/brick1/pending-changelog TEST cmp $B0/brick0/pending-changelog $B0/brick1/pending-changelog
 End of changes. 3 change blocks. 
21 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)