|
|
3604df |
From e98cac011b340b92ebb484afb5deb1e3964c8f10 Mon Sep 17 00:00:00 2001
|
|
|
3604df |
From: Atin Mukherjee <amukherj@redhat.com>
|
|
|
3604df |
Date: Thu, 9 Feb 2017 12:56:38 +0530
|
|
|
3604df |
Subject: [PATCH 287/294] glusterd: ignore return code of
|
|
|
3604df |
glusterd_restart_bricks
|
|
|
3604df |
|
|
|
3604df |
When GlusterD is restarted on a multi node cluster, while syncing the
|
|
|
3604df |
global options from other GlusterD, it checks for quorum and based on
|
|
|
3604df |
which it decides whether to stop/start a brick. However we handle the
|
|
|
3604df |
return code of this function in which case if we don't want to start any
|
|
|
3604df |
bricks the ret will be non zero and we will end up failing the import
|
|
|
3604df |
which is incorrect.
|
|
|
3604df |
|
|
|
3604df |
Fix is just to ignore the ret code of glusterd_restart_bricks ()
|
|
|
3604df |
|
|
|
3604df |
>Reviewed-on: https://review.gluster.org/16574
|
|
|
3604df |
>Smoke: Gluster Build System <jenkins@build.gluster.org>
|
|
|
3604df |
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
3604df |
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
|
|
3604df |
>Reviewed-by: Samikshan Bairagya <samikshan@gmail.com>
|
|
|
3604df |
>Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
|
|
|
3604df |
|
|
|
3604df |
Change-Id: I37766b0bba138d2e61d3c6034bd00e93ba43e553
|
|
|
3604df |
BUG: 1420635
|
|
|
3604df |
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
3604df |
Reviewed-on: https://code.engineering.redhat.com/gerrit/97503
|
|
|
3604df |
---
|
|
|
3604df |
tests/bugs/glusterd/bug-1420637-volume-sync-fix.t | 40 +++++++++++++++++++++++
|
|
|
3604df |
xlators/mgmt/glusterd/src/glusterd-utils.c | 12 ++-----
|
|
|
3604df |
2 files changed, 43 insertions(+), 9 deletions(-)
|
|
|
3604df |
create mode 100644 tests/bugs/glusterd/bug-1420637-volume-sync-fix.t
|
|
|
3604df |
|
|
|
3604df |
diff --git a/tests/bugs/glusterd/bug-1420637-volume-sync-fix.t b/tests/bugs/glusterd/bug-1420637-volume-sync-fix.t
|
|
|
3604df |
new file mode 100644
|
|
|
3604df |
index 0000000..0bd9988
|
|
|
3604df |
--- /dev/null
|
|
|
3604df |
+++ b/tests/bugs/glusterd/bug-1420637-volume-sync-fix.t
|
|
|
3604df |
@@ -0,0 +1,40 @@
|
|
|
3604df |
+#!/bin/bash
|
|
|
3604df |
+
|
|
|
3604df |
+# Test case for checking when server-quorum-ratio value is changed on one
|
|
|
3604df |
+# glusterd where the other is down, the other changes done get synced back
|
|
|
3604df |
+properly when the glusterd is brought up.
|
|
|
3604df |
+
|
|
|
3604df |
+. $(dirname $0)/../../include.rc
|
|
|
3604df |
+. $(dirname $0)/../../volume.rc
|
|
|
3604df |
+. $(dirname $0)/../../cluster.rc
|
|
|
3604df |
+
|
|
|
3604df |
+cleanup;
|
|
|
3604df |
+
|
|
|
3604df |
+TEST launch_cluster 2
|
|
|
3604df |
+
|
|
|
3604df |
+TEST $CLI_1 peer probe $H2;
|
|
|
3604df |
+EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count
|
|
|
3604df |
+
|
|
|
3604df |
+# Lets create & start the volume
|
|
|
3604df |
+TEST $CLI_1 volume create $V0 $H1:$B1/${V0}0 $H2:$B2/${V0}1
|
|
|
3604df |
+
|
|
|
3604df |
+# Start the volume
|
|
|
3604df |
+TEST $CLI_1 volume start $V0
|
|
|
3604df |
+TEST $CLI_1 volume set $V0 performance.readdir-ahead on
|
|
|
3604df |
+
|
|
|
3604df |
+# Bring down 2nd glusterd
|
|
|
3604df |
+TEST kill_glusterd 2
|
|
|
3604df |
+
|
|
|
3604df |
+TEST $CLI_1 volume set all cluster.server-quorum-ratio 60
|
|
|
3604df |
+TEST $CLI_1 volume set $V0 performance.readdir-ahead off
|
|
|
3604df |
+
|
|
|
3604df |
+# Bring back 2nd glusterd
|
|
|
3604df |
+TEST $glusterd_2
|
|
|
3604df |
+
|
|
|
3604df |
+# After 2nd glusterd come back, there will be 2 nodes in a clusater
|
|
|
3604df |
+EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count;
|
|
|
3604df |
+
|
|
|
3604df |
+EXPECT_WITHIN $PROBE_TIMEOUT "60" volinfo_field_2 all cluster.server-quorum-ratio
|
|
|
3604df |
+EXPECT_WITHIN $PROBE_TIMEOUT "off" volinfo_field_2 $V0 performance.readdir-ahead
|
|
|
3604df |
+
|
|
|
3604df |
+cleanup;
|
|
|
3604df |
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
|
3604df |
index a0d18cc..d849690 100644
|
|
|
3604df |
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
|
3604df |
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
|
3604df |
@@ -4314,15 +4314,8 @@ glusterd_import_global_opts (dict_t *friend_data)
|
|
|
3604df |
* recompute if quorum is met. If quorum is not met bricks are
|
|
|
3604df |
* not started and those already running are stopped
|
|
|
3604df |
*/
|
|
|
3604df |
- if (old_quorum != new_quorum) {
|
|
|
3604df |
- ret = glusterd_restart_bricks (conf);
|
|
|
3604df |
- if (ret) {
|
|
|
3604df |
- gf_msg ("glusterd", GF_LOG_INFO, 0,
|
|
|
3604df |
- GD_MSG_SERVER_QUORUM_NOT_MET,
|
|
|
3604df |
- "Restarting bricks failed");
|
|
|
3604df |
- goto out;
|
|
|
3604df |
- }
|
|
|
3604df |
- }
|
|
|
3604df |
+ if (old_quorum != new_quorum)
|
|
|
3604df |
+ glusterd_restart_bricks (conf);
|
|
|
3604df |
}
|
|
|
3604df |
|
|
|
3604df |
ret = 0;
|
|
|
3604df |
@@ -4973,6 +4966,7 @@ glusterd_restart_bricks (glusterd_conf_t *conf)
|
|
|
3604df |
}
|
|
|
3604df |
}
|
|
|
3604df |
}
|
|
|
3604df |
+ ret = 0;
|
|
|
3604df |
|
|
|
3604df |
out:
|
|
|
3604df |
conf->restart_done = _gf_true;
|
|
|
3604df |
--
|
|
|
3604df |
2.9.3
|
|
|
3604df |
|