e3c68b
From d7795a592883cfb01da76b6905a7c9eb1e912bef Mon Sep 17 00:00:00 2001
e3c68b
From: Mohit Agrawal <moagrawa@redhat.com>
e3c68b
Date: Tue, 28 May 2019 08:28:29 +0530
e3c68b
Subject: [PATCH 147/169] glusterd: bulkvoldict thread is not handling all
e3c68b
 volumes
e3c68b
e3c68b
Problem: In commit ac70f66c5805e10b3a1072bd467918730c0aeeb4 I
e3c68b
         missed one condition to populate volume dictionary in
e3c68b
         multiple threads while brick_multiplex is enabled.Due
e3c68b
         to that glusterd is not sending volume dictionary for
e3c68b
         all volumes to peer.
e3c68b
e3c68b
Solution: Update the condition in code as well as update test case
e3c68b
          also to avoid the issue
e3c68b
e3c68b
> Change-Id: I06522dbdfee4f7e995d9cc7b7098fdf35340dc52
e3c68b
> fixes: bz#1711250
e3c68b
> Cherry pick from commit 4a5fb52eb1c5387a0fb8bfa1253e5227c7c255e8
e3c68b
> Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/22739/
e3c68b
e3c68b
BUG: 1711249
e3c68b
Change-Id: I06522dbdfee4f7e995d9cc7b7098fdf35340dc52
e3c68b
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
e3c68b
Reviewed-on: https://code.engineering.redhat.com/gerrit/171589
e3c68b
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e3c68b
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
e3c68b
---
e3c68b
 tests/bugs/glusterd/bug-1699339.t          | 16 ++++++++++------
e3c68b
 xlators/mgmt/glusterd/src/glusterd-utils.c |  2 +-
e3c68b
 2 files changed, 11 insertions(+), 7 deletions(-)
e3c68b
e3c68b
diff --git a/tests/bugs/glusterd/bug-1699339.t b/tests/bugs/glusterd/bug-1699339.t
e3c68b
index 3e950f4..bb8d4f4 100644
e3c68b
--- a/tests/bugs/glusterd/bug-1699339.t
e3c68b
+++ b/tests/bugs/glusterd/bug-1699339.t
e3c68b
@@ -52,18 +52,22 @@ done
e3c68b
 
e3c68b
 TEST kill_glusterd 1
e3c68b
 
e3c68b
-vol1=$(printf "%s-vol%02d" $V0 1)
e3c68b
+TESTS_EXPECTED_IN_LOOP=4
e3c68b
+for i in `seq 1 3 15`
e3c68b
+do
e3c68b
+vol1=$(printf "%s-vol%02d" $V0 $i)
e3c68b
 TEST $CLI_2 volume set $vol1 performance.readdir-ahead on
e3c68b
-vol2=$(printf "%s-vol%02d" $V0 2)
e3c68b
-TEST $CLI_2 volume set $vol2 performance.readdir-ahead on
e3c68b
+done
e3c68b
 
e3c68b
 # Bring back 1st glusterd
e3c68b
 TEST $glusterd_1
e3c68b
 EXPECT_WITHIN $PROBE_TIMEOUT 2 peer_count
e3c68b
 
e3c68b
+TESTS_EXPECTED_IN_LOOP=4
e3c68b
+for i in `seq 1 3 15`
e3c68b
+do
e3c68b
+vol1=$(printf "%s-vol%02d" $V0 $i)
e3c68b
 EXPECT_WITHIN $PROBE_TIMEOUT "on" volinfo_field_1 $vol1 performance.readdir-ahead
e3c68b
-
e3c68b
-vol_name=$(printf "%s-vol%02d" $V0 2)
e3c68b
-EXPECT_WITHIN $PROBE_TIMEOUT "on" volinfo_field_1 $vol2 performance.readdir-ahead
e3c68b
+done
e3c68b
 
e3c68b
 cleanup
e3c68b
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
e3c68b
index efa5a86..8f1525e 100644
e3c68b
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
e3c68b
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
e3c68b
@@ -3542,7 +3542,7 @@ glusterd_add_volumes_to_export_dict(dict_t **peer_data)
e3c68b
             if ((i + 1) != totthread) {
e3c68b
                 arg->end = ((i + 1) * vol_per_thread_limit);
e3c68b
             } else {
e3c68b
-                arg->end = ((i * vol_per_thread_limit) + endindex);
e3c68b
+                arg->end = (((i + 1) * vol_per_thread_limit) + endindex);
e3c68b
             }
e3c68b
             th_ret = gf_thread_create_detached(
e3c68b
                 &th_id, glusterd_add_bulk_volumes_create_thread, arg,
e3c68b
-- 
e3c68b
1.8.3.1
e3c68b