3604df
From 42fae88f9b0a998b65883b8cb6148e93d7e9b022 Mon Sep 17 00:00:00 2001
3604df
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
3604df
Date: Fri, 24 Feb 2017 17:39:22 -0500
3604df
Subject: [PATCH 300/300] common-ha: setup after teardown often fails
3604df
3604df
The cleanup logic only removes the corosync files on $this node. If
3604df
the files on the other nodes are not removed, some residual state may
3604df
be retained that prevents a new setup from coming up successfully.
3604df
3604df
using `pcs cluster destroy --all` precludes this possibility and
3604df
obviates the (error prone) logic to remove the the nodes one by one;
3604df
this we can remove the loop where that is done.
3604df
3604df
HT to Tomas Jelinek in #cluster on IRC
3604df
3604df
release-3.10 https://review.gluster.org/#/c/16737/
3604df
release-3.10 Change-Id: Iff24e3732f91f3b96a0b00b8199aa42446e60938
3604df
3604df
Change-Id: Ibc0f544fa7685030f09d63f9a033ac45df157839
3604df
BUG: 1426324
3604df
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
3604df
Reviewed-on: https://code.engineering.redhat.com/gerrit/98648
3604df
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
3604df
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
3604df
---
3604df
 extras/ganesha/scripts/ganesha-ha.sh | 22 ++--------------------
3604df
 1 file changed, 2 insertions(+), 20 deletions(-)
3604df
3604df
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
3604df
index c807610..8f138ef 100644
3604df
--- a/extras/ganesha/scripts/ganesha-ha.sh
3604df
+++ b/extras/ganesha/scripts/ganesha-ha.sh
3604df
@@ -321,24 +321,6 @@ string:"EXPORT(Export_Id=$export_id)" 2>&1)
3604df
 
3604df
 teardown_cluster()
3604df
 {
3604df
-    local name=${1}
3604df
-
3604df
-    for server in ${HA_SERVERS} ; do
3604df
-        if [[ ${HA_CLUSTER_NODES} != *${server}* ]]; then
3604df
-            logger "info: ${server} is not in config, removing"
3604df
-
3604df
-            pcs cluster stop ${server} --force
3604df
-            if [ $? -ne 0 ]; then
3604df
-                logger "warning: pcs cluster stop ${server} failed"
3604df
-            fi
3604df
-
3604df
-            pcs cluster node remove ${server}
3604df
-            if [ $? -ne 0 ]; then
3604df
-                logger "warning: pcs cluster node remove ${server} failed"
3604df
-            fi
3604df
-        fi
3604df
-    done
3604df
-
3604df
     # BZ 1193433 - pcs doesn't reload cluster.conf after modification
3604df
     # after teardown completes, a subsequent setup will appear to have
3604df
     # 'remembered' the deleted node. You can work around this by
3604df
@@ -352,7 +334,7 @@ teardown_cluster()
3604df
         logger "warning pcs cluster stop --all failed"
3604df
     fi
3604df
 
3604df
-    pcs cluster destroy
3604df
+    pcs cluster destroy --all
3604df
     if [ $? -ne 0 ]; then
3604df
         logger "error pcs cluster destroy failed"
3604df
         exit 1
3604df
@@ -1046,7 +1028,7 @@ main()
3604df
 
3604df
         teardown_resources ${HA_SERVERS}
3604df
 
3604df
-        teardown_cluster ${HA_NAME}
3604df
+        teardown_cluster
3604df
 
3604df
         cleanup_ganesha_config ${HA_CONFDIR}
3604df
         ;;
3604df
-- 
3604df
2.9.3
3604df