summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaleb S KEITHLEY <kkeithle@redhat.com>2016-05-19 13:08:38 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-05-24 02:36:31 -0700
commitdf931b2c6b2755e57b9d49e3fb045646e6e892fd (patch)
treea81c6828b55bac0961b7361cbbda6110f6ad3657
parenteb2001232249d30bf6d4a89e1454615dad7916a6 (diff)
common-ha: wait for cluster to elect DC before accessing CIB
access attempts, e.g. `pcs property set stonith-enabled=false` will fail (or time out) if attempted "too early", i.e. before the cluster has elected its DC. see https://bugzilla.redhat.com/show_bug.cgi?id=1336947#c3 and https://bugzilla.redhat.com/show_bug.cgi?id=1320740 Change-Id: Ifc0aa7ce652c1da339b9eb8fe17e40e8a09b1096 BUG: 1336948 Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/14428 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
-rw-r--r--extras/ganesha/scripts/ganesha-ha.sh19
1 files changed, 13 insertions, 6 deletions
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
index e91fe37e37b..f0796d2e043 100644
--- a/extras/ganesha/scripts/ganesha-ha.sh
+++ b/extras/ganesha/scripts/ganesha-ha.sh
@@ -182,7 +182,14 @@ setup_cluster()
exit 1;
fi
- sleep 3
+ sleep 1
+ # wait for the cluster to elect a DC before querying or writing
+ # to the CIB. BZ 1334092
+ crmadmin --dc_lookup --timeout=5000 > /dev/null 2>&1
+ while [ $? -ne 0 ]; do
+ crmadmin --dc_lookup --timeout=5000 > /dev/null 2>&1
+ done
+
unclean=$(pcs status | grep -u "UNCLEAN")
while [[ "${unclean}X" = "UNCLEANX" ]]; do
sleep 1
@@ -196,6 +203,11 @@ setup_cluster()
logger "warning: pcs property set no-quorum-policy=ignore failed"
fi
fi
+
+ pcs property set stonith-enabled=false
+ if [ $? -ne 0 ]; then
+ logger "warning: pcs property set stonith-enabled=false failed"
+ fi
}
@@ -204,11 +216,6 @@ setup_finalize_ha()
local cibfile=${1}
local stopped=""
- pcs property set stonith-enabled=false
- if [ $? -ne 0 ]; then
- logger "warning: pcs property set stonith-enabled=false failed"
- fi
-
stopped=$(pcs status | grep -u "Stopped")
while [[ "${stopped}X" = "StoppedX" ]]; do
sleep 1