12a457
From ba6480523b5e9e4fc27cb180fab29b536d277322 Mon Sep 17 00:00:00 2001
12a457
From: Kaleb S KEITHLEY <kkeithle@redhat.com>
12a457
Date: Tue, 17 May 2016 17:44:24 -0400
12a457
Subject: [PATCH 168/178] common-ha: stonith-enabled option set error in new pacemaker
12a457
12a457
Setting the option too early results in an error in newer versions
12a457
of pacemaker. Postpone setting the option in order for it to succeed.
12a457
12a457
N.B. We do not use a fencing agent. Yes, we know this is "not supported."
12a457
12a457
access attempts, e.g. `pcs property set stonith-enabled=false`
12a457
will fail (or time out) if attempted "too early", i.e. before
12a457
the cluster has elected its DC.
12a457
12a457
see https://bugzilla.redhat.com/show_bug.cgi?id=1336947#c3 and
12a457
https://bugzilla.redhat.com/show_bug.cgi?id=1320740
12a457
12a457
Backport of
12a457
> mainline http://review.gluster.org/14426
12a457
> BZ 1336945
12a457
> release-3.8 http://review.gluster.org/14427
12a457
> BZ 1336947
12a457
> release-3.7 http://review.gluster.org/14428
12a457
> BZ 1336948
12a457
12a457
Change-Id: Ie0ad8b593270fc4ad0cd64bd03336efc5c08ff00
12a457
BUG: 1334092
12a457
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
12a457
Reviewed-on: https://code.engineering.redhat.com/gerrit/74545
12a457
Reviewed-by: Jiffin Thottan <jthottan@redhat.com>
12a457
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
12a457
---
12a457
 extras/ganesha/scripts/ganesha-ha.sh |   13 +++++++++----
12a457
 1 files changed, 9 insertions(+), 4 deletions(-)
12a457
12a457
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
12a457
index 33affe9..f0796d2 100644
12a457
--- a/extras/ganesha/scripts/ganesha-ha.sh
12a457
+++ b/extras/ganesha/scripts/ganesha-ha.sh
12a457
@@ -182,7 +182,14 @@ setup_cluster()
12a457
         exit 1;
12a457
     fi
12a457
 
12a457
-    sleep 3
12a457
+    sleep 1
12a457
+    # wait for the cluster to elect a DC before querying or writing
12a457
+    # to the CIB. BZ 1334092
12a457
+    crmadmin --dc_lookup --timeout=5000 > /dev/null 2>&1
12a457
+    while [ $? -ne 0 ]; do
12a457
+        crmadmin --dc_lookup --timeout=5000 > /dev/null 2>&1
12a457
+    done
12a457
+
12a457
     unclean=$(pcs status | grep -u "UNCLEAN")
12a457
     while [[ "${unclean}X" = "UNCLEANX" ]]; do
12a457
          sleep 1
12a457
@@ -196,6 +203,7 @@ setup_cluster()
12a457
             logger "warning: pcs property set no-quorum-policy=ignore failed"
12a457
         fi
12a457
     fi
12a457
+
12a457
     pcs property set stonith-enabled=false
12a457
     if [ $? -ne 0 ]; then
12a457
         logger "warning: pcs property set stonith-enabled=false failed"
12a457
@@ -213,9 +221,6 @@ setup_finalize_ha()
12a457
          sleep 1
12a457
          stopped=$(pcs status | grep -u "Stopped")
12a457
     done
12a457
-
12a457
-    # pcs resource cleanup
12a457
-
12a457
 }
12a457
 
12a457
 
12a457
-- 
12a457
1.7.1
12a457