|
|
d1681e |
From 8fb2496f67b1170595144eecb9a3b8f3be35044e Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Atin Mukherjee <amukherj@redhat.com>
|
|
|
d1681e |
Date: Mon, 30 Oct 2017 15:55:32 +0530
|
|
|
d1681e |
Subject: [PATCH 40/74] glusterd: delete source brick only once in reset-brick
|
|
|
d1681e |
commit force
|
|
|
d1681e |
|
|
|
d1681e |
While stopping the brick which is to be reset and replaced delete_brick
|
|
|
d1681e |
flag was passed as true which resulted glusterd to free up to source
|
|
|
d1681e |
brick before the actual operation. This results commit force to fail
|
|
|
d1681e |
failing to find the source brickinfo.
|
|
|
d1681e |
|
|
|
d1681e |
>upstream patch : https://review.gluster.org/#/c/18581
|
|
|
d1681e |
|
|
|
d1681e |
Change-Id: I1aa7508eff7cc9c9b5d6f5163f3bb92736d6df44
|
|
|
d1681e |
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/121876
|
|
|
d1681e |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
.../bug-1507466-reset-brick-commit-force.t | 24 ++++++++++++++++++++++
|
|
|
d1681e |
xlators/mgmt/glusterd/src/glusterd-reset-brick.c | 2 +-
|
|
|
d1681e |
2 files changed, 25 insertions(+), 1 deletion(-)
|
|
|
d1681e |
create mode 100644 tests/bugs/glusterd/bug-1507466-reset-brick-commit-force.t
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/tests/bugs/glusterd/bug-1507466-reset-brick-commit-force.t b/tests/bugs/glusterd/bug-1507466-reset-brick-commit-force.t
|
|
|
d1681e |
new file mode 100644
|
|
|
d1681e |
index 0000000..764399d
|
|
|
d1681e |
--- /dev/null
|
|
|
d1681e |
+++ b/tests/bugs/glusterd/bug-1507466-reset-brick-commit-force.t
|
|
|
d1681e |
@@ -0,0 +1,24 @@
|
|
|
d1681e |
+#!/bin/bash
|
|
|
d1681e |
+. $(dirname $0)/../../include.rc
|
|
|
d1681e |
+. $(dirname $0)/../../cluster.rc
|
|
|
d1681e |
+cleanup;
|
|
|
d1681e |
+
|
|
|
d1681e |
+function check_peers {
|
|
|
d1681e |
+ $CLI_1 peer status | grep 'Peer in Cluster (Connected)' | wc -l
|
|
|
d1681e |
+}
|
|
|
d1681e |
+
|
|
|
d1681e |
+TEST launch_cluster 3
|
|
|
d1681e |
+TEST $CLI_1 peer probe $H2;
|
|
|
d1681e |
+EXPECT_WITHIN $PROBE_TIMEOUT 1 check_peers
|
|
|
d1681e |
+
|
|
|
d1681e |
+TEST $CLI_1 volume create $V0 replica 2 $H1:$B0/${V0} $H2:$B0/${V0}
|
|
|
d1681e |
+TEST $CLI_1 volume start $V0
|
|
|
d1681e |
+
|
|
|
d1681e |
+# Negative case with brick not killed && volume-id xattrs present
|
|
|
d1681e |
+TEST ! $CLI_1 volume reset-brick $V0 $H1:$B0/${V0} $H1:$B0/${V0} commit force
|
|
|
d1681e |
+
|
|
|
d1681e |
+TEST $CLI_1 volume reset-brick $V0 $H1:$B0/${V0} start
|
|
|
d1681e |
+# Now test if reset-brick commit force works
|
|
|
d1681e |
+TEST $CLI_1 volume reset-brick $V0 $H1:$B0/${V0} $H1:$B0/${V0} commit force
|
|
|
d1681e |
+
|
|
|
d1681e |
+cleanup;
|
|
|
d1681e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-reset-brick.c b/xlators/mgmt/glusterd/src/glusterd-reset-brick.c
|
|
|
d1681e |
index c127d64..abb44e0 100644
|
|
|
d1681e |
--- a/xlators/mgmt/glusterd/src/glusterd-reset-brick.c
|
|
|
d1681e |
+++ b/xlators/mgmt/glusterd/src/glusterd-reset-brick.c
|
|
|
d1681e |
@@ -343,7 +343,7 @@ glusterd_op_reset_brick (dict_t *dict, dict_t *rsp_dict)
|
|
|
d1681e |
gf_msg_debug (this->name, 0, "I AM THE DESTINATION HOST");
|
|
|
d1681e |
ret = glusterd_volume_stop_glusterfs (volinfo,
|
|
|
d1681e |
src_brickinfo,
|
|
|
d1681e |
- _gf_true);
|
|
|
d1681e |
+ _gf_false);
|
|
|
d1681e |
if (ret) {
|
|
|
d1681e |
gf_msg (this->name, GF_LOG_CRITICAL, 0,
|
|
|
d1681e |
GD_MSG_BRICK_STOP_FAIL,
|
|
|
d1681e |
--
|
|
|
d1681e |
1.8.3.1
|
|
|
d1681e |
|