summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2018-07-10 14:21:35 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-07-13 10:22:00 +0000
commit1718f9c6cb3bc856265ff996babef97119a716bd (patch)
treeeca98443dd1f00d26a7799f4f8e86f023c775b6b
parente8cf52f5107af00b5dcbde3bff22a394efba5372 (diff)
glusterd: To find a compatible brick ignore diagnostics.brick-log-level option
Problem: glusterd start a volume as a separate process instead of attaching with the already running process if volume option has different brick-log-level. There is no functionality impact on a brick if the option has different brick-log-level so glusterd should attach a brick with the already running process. Solution: Ignore brick-log-level option in unsafe_option BUG: 1599628 Change-Id: I72638ff2026fcd9332bc38e1144b1ef4a708820b fixes: bz#1599628 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
-rw-r--r--tests/basic/mpx-compat.t9
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c4
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/basic/mpx-compat.t b/tests/basic/mpx-compat.t
index 4ca262ee349..453011c0154 100644
--- a/tests/basic/mpx-compat.t
+++ b/tests/basic/mpx-compat.t
@@ -15,6 +15,11 @@ function count_processes {
pgrep glusterfsd | wc -w
}
+function count_brick_pids {
+ $CLI --xml volume status all | sed -n '/.*<pid>\([^<]*\).*/s//\1/p' \
+ | grep -v "N/A" | sort | uniq | wc -l
+}
+
cleanup
TEST glusterd
TEST $CLI volume set all cluster.brick-multiplex yes
@@ -25,6 +30,9 @@ push_trapfunc "cleanup"
TEST $CLI volume create $V0 $H0:$B0/brick-${V0}-{0,1}
TEST $CLI volume create $V1 $H0:$B0/brick-${V1}-{0,1}
+# Enable brick log-level to DEBUG
+gluster v set $V0 diagnostics.brick-log-level DEBUG
+
# Start both.
TEST $CLI volume start $V0
TEST $CLI volume start $V1
@@ -34,6 +42,7 @@ TEST $CLI volume start $V1
# coming up, and yield a false positive.
sleep $PROCESS_UP_TIMEOUT
EXPECT "1" count_processes
+EXPECT 1 count_brick_pids
# Make the second volume incompatible with the first.
TEST $CLI volume stop $V1
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index d8a4a75a46e..55b2e735dc3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2330,6 +2330,10 @@ unsafe_option (dict_t *this, char *key, data_t *value, void *arg)
return _gf_false;
}
+ if (fnmatch ("*diagnostics.brick-log*", key, 0) == 0) {
+ return _gf_false;
+ }
+
return _gf_true;
}