50dc83
From a325e7b3bbe5c1f67b999f375b83d2e2f1b2c1c6 Mon Sep 17 00:00:00 2001
50dc83
From: Sanju Rakonde <srakonde@redhat.com>
50dc83
Date: Tue, 9 Apr 2019 13:56:24 +0530
50dc83
Subject: [PATCH 119/124] glusterd: provide a way to detach failed node
50dc83
50dc83
When a gluster node in trusted storage pool has failed
50dc83
due to hardware issues, volume delete operation fails
50dc83
saying "Not all peers are up" and peer detach for failed
50dc83
node fails saying "Brick(s) with peer <peer_ip> exists
50dc83
in cluster".
50dc83
50dc83
The idea here is to use either replace-brick or remove-brick
50dc83
command to remove all the bricks hosted by failed node and
50dc83
then re-attempting the peer detach. This change adds this
50dc83
trick in peer detach error message.
50dc83
50dc83
> upstream patch : https://review.gluster.org/22534
50dc83
50dc83
>fixes: bz#1697866
50dc83
>Change-Id: I0c58887479d31db603ad8d6535ea9d547880ccc8
50dc83
>Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
50dc83
50dc83
BUG: 1696334
50dc83
Change-Id: I0c58887479d31db603ad8d6535ea9d547880ccc8
50dc83
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
50dc83
Reviewed-on: https://code.engineering.redhat.com/gerrit/168614
50dc83
Tested-by: RHGS Build Bot <nigelb@redhat.com>
50dc83
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
50dc83
---
50dc83
 xlators/mgmt/glusterd/src/glusterd-handler.c | 7 +++++--
50dc83
 1 file changed, 5 insertions(+), 2 deletions(-)
50dc83
50dc83
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
50dc83
index 6147995..af8a8a4 100644
50dc83
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
50dc83
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
50dc83
@@ -4134,8 +4134,11 @@ set_deprobe_error_str(int op_ret, int op_errno, char *op_errstr, char *errstr,
50dc83
 
50dc83
             case GF_DEPROBE_BRICK_EXIST:
50dc83
                 snprintf(errstr, len,
50dc83
-                         "Brick(s) with the peer "
50dc83
-                         "%s exist in cluster",
50dc83
+                         "Peer %s hosts one or more bricks. If the peer is in "
50dc83
+                         "not recoverable state then use either replace-brick "
50dc83
+                         "or remove-brick command with force to remove all "
50dc83
+                         "bricks from the peer and attempt the peer detach "
50dc83
+                         "again.",
50dc83
                          hostname);
50dc83
                 break;
50dc83
 
50dc83
-- 
50dc83
1.8.3.1
50dc83