Blob Blame History Raw
From 6dbf0813e2ec1407b41dbcee33d329c7fa90e4f4 Mon Sep 17 00:00:00 2001
From: Jiffin Tony Thottan <jthottan@redhat.com>
Date: Wed, 22 Feb 2017 18:30:53 +0530
Subject: [PATCH 298/300] ganesha/scripts : restart pcs cluster during add node

In RHEL 6 due to this change https://review.gluster.org/#/c/16122/
restart of HA cluster become requirement after adding a node to
cluster
After add node "pcs cluster node add <hostname>" following message is
coming up :
Warning: Using udpu transport on a RHEL 6 cluster, cluster restart is required to apply node addition

Thanks Manisha for founding issue and suggesting the fix.

This is backport of the below upstream patch -
        https://review.gluster.org/16721

>Change-Id: I9e55d4ba04ed2555d27f26f71b95b8bd6a67f94c
>BUG: 1425919
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
>Reviewed-on: https://review.gluster.org/16721
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
>Reviewed-by: soumya k <skoduri@redhat.com>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>

Change-Id: Iaa843c106d139d70a4c5c6e8263e2676d7b99371
BUG: 1425748
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/98581
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 extras/ganesha/scripts/ganesha-ha.sh | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
index 0c3528b..c807610 100644
--- a/extras/ganesha/scripts/ganesha-ha.sh
+++ b/extras/ganesha/scripts/ganesha-ha.sh
@@ -671,12 +671,6 @@ addnode_create_resources()
     local add_vip=${1}; shift
     local cibfile=$(mktemp -u)
 
-    # start HA on the new node
-    pcs cluster start ${add_node}
-    if [ $? -ne 0 ]; then
-       logger "warning: pcs cluster start ${add_node} failed"
-    fi
-
     pcs cluster cib ${cibfile}
     if [ $? -ne 0 ]; then
         logger "warning: pcs cluster cib ${cibfile} failed"
@@ -696,6 +690,7 @@ addnode_create_resources()
         logger "warning: pcs cluster cib-push ${cibfile} failed"
     fi
     rm -f ${cibfile}
+
 }
 
 
@@ -1077,6 +1072,19 @@ main()
             logger "warning: pcs cluster node add ${node} failed"
         fi
 
+        sleep 2
+        # restart of HA cluster required on RHEL 6 because of BZ1404410
+        pcs cluster stop --all
+        if [ $? -ne 0 ]; then
+            logger "warning: pcs cluster stopping cluster failed"
+        fi
+
+        sleep 2
+        pcs cluster start --all
+        if [ $? -ne 0 ]; then
+            logger "warning: pcs cluster starting cluster failed"
+        fi
+
         addnode_create_resources ${node} ${vip}
         # Subsequent add-node recreates resources for all the nodes
         # that already exist in the cluster. The nodes are picked up
-- 
2.9.3