From 5c723ade196600030ee84621384cceb10fff64d8 Mon Sep 17 00:00:00 2001 From: karthik-us Date: Mon, 10 Dec 2018 18:13:19 +0530 Subject: cluster/afr: Do not update read_subvol in inode_ctx after rename/link fop Since rename/link fops on a file will not change any data in it, it should not update the read_subvol values in the inode_ctx, which interprets the data & metadata readable subvols for that file. The old read_subvol values should be retained even after the rename/link operations. Change-Id: I068044a426823a566f5bea8aa063cd689199d6dd fixes: bz#1657783 Signed-off-by: karthik-us --- ...7783-do-not-update-read-subvol-on-rename-link.t | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/bugs/replicate/bug-1657783-do-not-update-read-subvol-on-rename-link.t (limited to 'tests') diff --git a/tests/bugs/replicate/bug-1657783-do-not-update-read-subvol-on-rename-link.t b/tests/bugs/replicate/bug-1657783-do-not-update-read-subvol-on-rename-link.t new file mode 100644 index 00000000000..b180f0e1239 --- /dev/null +++ b/tests/bugs/replicate/bug-1657783-do-not-update-read-subvol-on-rename-link.t @@ -0,0 +1,40 @@ +#!/bin/bash +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0..2} +TEST $CLI volume set $V0 self-heal-daemon off +TEST $CLI volume set $V0 cluster.data-self-heal off +TEST $CLI volume set $V0 cluster.metadata-self-heal off +TEST $CLI volume set $V0 cluster.entry-self-heal off +TEST $CLI volume set $V0 performance.write-behind off + +TEST $CLI volume start $V0 +TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0; +TEST mkdir $M0/dir +TEST "echo abc > $M0/file1" +TEST "echo uvw > $M0/file2" + +TEST kill_brick $V0 $H0 $B0/${V0}0 +TEST "echo def > $M0/file1" +TEST "echo xyz > $M0/file2" + +TEST $CLI volume start $V0 force +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/${V0}0 +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" afr_child_up_status $V0 0 + +TEST kill_brick $V0 $H0 $B0/${V0}1 + +# Rename file1 and read it. Read should be served from the 3rd brick +TEST mv $M0/file1 $M0/file3 +EXPECT "def" cat $M0/file3 + +# Create a link to file2 and read it. Read should be served from the 3rd brick +TEST ln $M0/file2 $M0/dir/file4 +EXPECT "xyz" cat $M0/dir/file4 +EXPECT "xyz" cat $M0/file2 + +cleanup -- cgit