All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] cman: wait for quorum
@ 2009-08-06 16:17 David Teigland
  2009-08-06 16:56 ` Fabio M. Di Nitto
  0 siblings, 1 reply; 2+ messages in thread
From: David Teigland @ 2009-08-06 16:17 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Wait for quorum when starting.
https://www.redhat.com/archives/cluster-devel/2009-August/msg00006.html

Signed-off-by: David Teigland <teigland@redhat.com>
---
 cman/init.d/cman.in |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 6481d6b..ff140fc 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -68,13 +68,13 @@ fi
 #     a cluster is not joined.  If CMAN_CLUSTER_TIMEOUT is zero, then
 #     wait indefinately for a cluster join.  If CMAN_CLUSTER_TIMEOUT is
 #     negative, do not check to see that the cluster has been joined
-[ -z "$CMAN_CLUSTER_TIMEOUT" ] && CMAN_CLUSTER_TIMEOUT=120
+[ -z "$CMAN_CLUSTER_TIMEOUT" ] && CMAN_CLUSTER_TIMEOUT=60
 
 # CMAN_QUORUM_TIMEOUT -- amount of time to wait for a quorate cluster on
 #     startup quorum is needed by many other applications, so we may as
-#     well wait here.  If CMAN_QUORUM_TIMEOUT is less than 1, quorum will
+#     well wait here.  If CMAN_QUORUM_TIMEOUT is zero, quorum will
 #     be ignored.
-[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=0
+[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=20
 
 # CMAN_SHUTDOWN_TIMEOUT -- amount of time to wait for cman to become a
 #     cluster member before calling cman_tool leave during shutdown.
@@ -490,6 +490,14 @@ start_cman()
 	fi
 }
 
+wait_for_quorum()
+{
+	if [ $CMAN_QUORUM_TIMEOUT -gt 0 ]; then
+		errmsg=$( cman_tool -t $CMAN_QUORUM_TIMEOUT \
+			 -q wait 2>&1 ) || return 1
+	fi
+}
+
 stop_cman()
 {
 	if cman_running; then
@@ -678,6 +686,10 @@ start()
 		qdiskd_enabled \
 		"Starting qdiskd"
 
+	runwrap wait_for_quorum \
+		none \
+		"Waiting for quorum"
+
 	runwrap start_groupd \
 		groupd_enabled \
 		"Starting groupd"
-- 
1.5.5.6



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Cluster-devel] [PATCH] cman: wait for quorum
  2009-08-06 16:17 [Cluster-devel] [PATCH] cman: wait for quorum David Teigland
@ 2009-08-06 16:56 ` Fabio M. Di Nitto
  0 siblings, 0 replies; 2+ messages in thread
From: Fabio M. Di Nitto @ 2009-08-06 16:56 UTC (permalink / raw)
  To: cluster-devel.redhat.com


Untested but looks good to me.

Fabio

On Thu, 2009-08-06 at 11:17 -0500, David Teigland wrote:
> Wait for quorum when starting.
> https://www.redhat.com/archives/cluster-devel/2009-August/msg00006.html
> 
> Signed-off-by: David Teigland <teigland@redhat.com>
> ---
>  cman/init.d/cman.in |   18 +++++++++++++++---
>  1 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
> index 6481d6b..ff140fc 100644
> --- a/cman/init.d/cman.in
> +++ b/cman/init.d/cman.in
> @@ -68,13 +68,13 @@ fi
>  #     a cluster is not joined.  If CMAN_CLUSTER_TIMEOUT is zero, then
>  #     wait indefinately for a cluster join.  If CMAN_CLUSTER_TIMEOUT is
>  #     negative, do not check to see that the cluster has been joined
> -[ -z "$CMAN_CLUSTER_TIMEOUT" ] && CMAN_CLUSTER_TIMEOUT=120
> +[ -z "$CMAN_CLUSTER_TIMEOUT" ] && CMAN_CLUSTER_TIMEOUT=60
>  
>  # CMAN_QUORUM_TIMEOUT -- amount of time to wait for a quorate cluster on
>  #     startup quorum is needed by many other applications, so we may as
> -#     well wait here.  If CMAN_QUORUM_TIMEOUT is less than 1, quorum will
> +#     well wait here.  If CMAN_QUORUM_TIMEOUT is zero, quorum will
>  #     be ignored.
> -[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=0
> +[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=20
>  
>  # CMAN_SHUTDOWN_TIMEOUT -- amount of time to wait for cman to become a
>  #     cluster member before calling cman_tool leave during shutdown.
> @@ -490,6 +490,14 @@ start_cman()
>  	fi
>  }
>  
> +wait_for_quorum()
> +{
> +	if [ $CMAN_QUORUM_TIMEOUT -gt 0 ]; then
> +		errmsg=$( cman_tool -t $CMAN_QUORUM_TIMEOUT \
> +			 -q wait 2>&1 ) || return 1
> +	fi
> +}
> +
>  stop_cman()
>  {
>  	if cman_running; then
> @@ -678,6 +686,10 @@ start()
>  		qdiskd_enabled \
>  		"Starting qdiskd"
>  
> +	runwrap wait_for_quorum \
> +		none \
> +		"Waiting for quorum"
> +
>  	runwrap start_groupd \
>  		groupd_enabled \
>  		"Starting groupd"



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-06 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-06 16:17 [Cluster-devel] [PATCH] cman: wait for quorum David Teigland
2009-08-06 16:56 ` Fabio M. Di Nitto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.