diff options
| author | Kaleb S KEITHLEY <kkeithle@redhat.com> | 2016-05-19 13:04:50 -0400 | 
|---|---|---|
| committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2016-05-24 02:36:16 -0700 | 
| commit | cfb0ef35483eb0656ca190c1665e68c5ff448092 (patch) | |
| tree | 5a2279b6b9ca7668517b2441d084924ac30032c8 /extras | |
| parent | e96a52cdc1b5f730399470480df18139b69a341a (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: 1336947
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/14427
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>
Diffstat (limited to 'extras')
| -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  | 
