diff options
author | Kaleb S KEITHLEY <kkeithle@redhat.com> | 2016-05-19 12:57:58 -0400 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2016-05-24 02:35:58 -0700 |
commit | 4394291064b68f7c1a8634a00b211154087df1bc (patch) | |
tree | 9c07e3abeab3348d3c1c9fd714902a512ee667b0 | |
parent | db817ff68125f89adba76080e8e93d4a4e72d549 (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.
Change-Id: Ifc0aa7ce652c1da339b9eb8fe17e40e8a09b1096
BUG: 1336945
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/14426
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: Gluster Build System <jenkins@build.gluster.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: soumya k <skoduri@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
-rw-r--r-- | extras/ganesha/scripts/ganesha-ha.sh | 19 |
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 |