From 385acc675c512c63f7051d46ad96666ea34cf0b5 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Wed, 22 Jul 2015 15:18:20 +0530 Subject: features/shard: Handle unlink of files with holes appropriately in unlink() and rename(). Change-Id: I25a02386dc95580c2e76a13fdd8e11a0df234d56 BUG: 1245547 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/11737 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Tested-by: NetBSD Build System --- tests/bugs/shard/bug-1245547.t | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/bugs/shard/bug-1245547.t (limited to 'tests/bugs/shard') diff --git a/tests/bugs/shard/bug-1245547.t b/tests/bugs/shard/bug-1245547.t new file mode 100644 index 00000000000..c19b2a6a042 --- /dev/null +++ b/tests/bugs/shard/bug-1245547.t @@ -0,0 +1,35 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 $H0:$B0/${V0}{0,1} +TEST $CLI volume set $V0 features.shard on +TEST $CLI volume start $V0 + +TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0 +#Create a file. +TEST touch $M0/foo +#Write some data into it. +TEST `echo "abc" > $M0/foo` + +#This should ensure /.shard is created on the bricks. +TEST stat $B0/${V0}0/.shard +TEST stat $B0/${V0}1/.shard + +#Create a file 'bar' with holes. +TEST touch $M0/bar +TEST truncate -s 10G $M0/bar +#Unlink on such a file should succeed. +TEST unlink $M0/bar +# +#Create a file 'baz' with holes. +TEST touch $M0/baz +TEST truncate -s 10G $M0/baz +#Rename with a sharded existing dest that has holes must succeed. +TEST mv -f $M0/foo $M0/baz + +cleanup; -- cgit