[DRBD-user] [PATCH] crm-fence-peer.sh: tweak --suicide-on-failure-if-primary

Lars Ellenberg lars.ellenberg at linbit.com
Mon Sep 9 15:23:13 CEST 2013

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Mon, Sep 09, 2013 at 08:43:56PM +0900, Junko IKEDA wrote:
> Hi,
> 
> I'm trying to run DRBD 8.3.16-rc1 with the new parameter,
> --suicide-on-failure-if-primary.
> In the case of "try_place_constraint" is not called,
> for example one node already has a wrong constrain,
> there might be some missing environment variables settings.
> Is this the meaningless test case for the dual primary cluster?
> Please see the attached.

Right.
Similar commit should show up in the repo "soon".

> 
> Thanks,
> Junko IKEDA

> diff --git a/scripts/crm-fence-peer.sh b/scripts/crm-fence-peer.sh
> index c410f22..4e4fc5d 100755
> --- a/scripts/crm-fence-peer.sh
> +++ b/scripts/crm-fence-peer.sh
> @@ -216,12 +216,9 @@ check_cluster_properties()
>  try_place_constraint()
>  {
>  	local peer_state
> -	local startup_fencing stonith_enabled
>  
>  	rc=1
>  
> -	check_cluster_properties
> -
>  	while :; do
>  		check_peer_node_reachable
>  		[[ $peer_state != "reachable" ]] && break
> @@ -343,7 +340,7 @@ commit_suicide()
>  
>  	reboot_timeout=$(( reboot_timeout + SECONDS ))
>  	# pacemaker apparently cannot kill me.
> -	while (( $SECONDS  > $reboot_timeout )); do
> +	while (( $SECONDS  < $reboot_timeout )); do

D'oh.  :-)

>  		echo WARNING "${extra_msg}going to reboot -f in $(( reboot_timeout - SECONDS )) seconds! To cancel: kill $$"
>  		sleep 2
>  	done
> @@ -367,6 +364,10 @@ drbd_peer_fencing()
>  	get_cib_xml -Ql || return
>  	fence_peer_init || return
>  
> +	local startup_fencing stonith_enabled
> +	check_cluster_properties
> +	set_states_from_proc_drbd
> +
>  	case $1 in
>  	fence)
>  		if [[ $fencing_attribute = "#uname" ]]; then


-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
__
please don't Cc me, but send to list   --   I'm subscribed



More information about the drbd-user mailing list