From 2acc8c1f04d0376bedf36f1f746e542422344fa6 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 10 May 2013 10:09:13 +0530 Subject: cluster/dht: Don't do extra unref in dht-migration checks Problem: syncop_open used to perform a ref in syncop_open_cbk so the extra unref was needed but now syncop_open_cbk does not take a ref so no need to do extra unref. Fix: remove the extra fd_unref and let dht_local_wipe do the final unref. Change-Id: Ibe8f9a678d456a0c7bff175306068b5cd297ecc4 BUG: 961615 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/4974 Reviewed-by: Raghavendra Bhat Reviewed-by: Krishnan Parthasarathi Reviewed-by: Amar Tumballi Tested-by: Gluster Build System --- tests/bugs/bug-961615.t | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/bugs/bug-961615.t (limited to 'tests') diff --git a/tests/bugs/bug-961615.t b/tests/bugs/bug-961615.t new file mode 100644 index 000000000..d183e6c52 --- /dev/null +++ b/tests/bugs/bug-961615.t @@ -0,0 +1,34 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +#This test tests that an extra fd_unref does not happen in rebalance +#migration completion check code path in dht + +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 $H0:$B0/${V0}0 $H0:$B0/${V0}1 +TEST $CLI volume set $V0 performance.quick-read off +TEST $CLI volume set $V0 performance.io-cache off +TEST $CLI volume set $V0 performance.write-behind off +TEST $CLI volume set $V0 performance.stat-prefetch off +TEST $CLI volume set $V0 performance.read-ahead off +TEST $CLI volume start $V0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 +TEST touch $M0/1 +#This rename creates a link file for 10 in the other volume. +TEST mv $M0/1 $M0/10 +#Lets keep writing to the file which will trigger rebalance completion check +dd if=/dev/zero of=$M0/10 bs=1k & +bg_pid=$! +#Now rebalance force will migrate file '10' +TEST $CLI volume rebalance $V0 start force +EXPECT_WITHIN 60 "completed" rebalance_status_field $V0 +#If the bug exists mount would have crashed by now +TEST ls $M0 +kill -9 $bg_pid > /dev/null 2>&1 +wait > /dev/null 2>&1 +cleanup -- cgit