[Gluster-devel] Duplicate entries with rebalance

Pranith Kumar K pkarampu at redhat.com
Thu Feb 28 13:05:26 UTC 2013


hi,
     Duplicate entries are seen in a dir because of a bug 916449 in 
afr(fix is the attached patch), dht (fix: 
http://review.gluster.com/4587). Even with the fixes I am still able to 
observe duplicate entries sporadically.
I added some logs in dht_readdirp_cbk. According to the logs the entry 
is read from subvolume replicate-0 once and suvolume replicate-2 the 
next time. I see that the sticky flag is set in the iatt buf received 
from replicate-0 subvol where as the sticky flag is not set in the iatt 
buf received from replicate-2. Please note that the issue is not 
consistent. when I run the script in a while loop, it hits the bug once 
in 5-10 runs.

Run it as:
while prove -rfv tests/bugs/test.t; do :; done

Here is the script:

#!/bin/bash

. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc

cleanup;

TEST glusterd
TEST pidof glusterd

function get_dup_files {
         local d=$1
         echo $(ls -rt -d -1 $d/* | sort | uniq -c | egrep -v "^\s*1\s\s*")
}

TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}0 $H0:$B0/${V0}1 
$H0:$B0/${V0}2 $H0:$B0/${V0}3
TEST $CLI volume start $V0

TEST glusterfs -s $H0 --volfile-id $V0 $M0;

TEST mkdir $M0/dir{1..10};
#TEST cp /bin/* $M0/;
TEST touch $M0/dir{1..10}/files{1..100};

TEST $CLI volume add-brick $V0 $H0:$B0/${V0}4 $H0:/$B0/${V0}5

TEST $CLI volume rebalance $V0 start force
kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}0.pid`;
TEST $CLI volume start $V0 force;
EXPECT_WITHIN 60 "success:" rebalance_status_field $V0
find $M0 |xargs stat 1>/dev/null;

EXPECT "" get_dup_files $M0/dir1
EXPECT "" get_dup_files $M0/dir2
EXPECT "" get_dup_files $M0/dir3
EXPECT "" get_dup_files $M0/dir4
EXPECT "" get_dup_files $M0/dir5
EXPECT "" get_dup_files $M0/dir6
EXPECT "" get_dup_files $M0/dir7
EXPECT "" get_dup_files $M0/dir8
EXPECT "" get_dup_files $M0/dir9
EXPECT "" get_dup_files $M0/dir10

Pranith.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-916449.patch
Type: text/x-patch
Size: 4756 bytes
Desc: not available
URL: <http://supercolony.gluster.org/pipermail/gluster-devel/attachments/20130228/82a913d8/attachment-0001.bin>


More information about the Gluster-devel mailing list