[Pacemaker] DRBD promotion timeout after pacemaker stop on other node

Vladislav Bogdanov bubble at hoster-ok.com
Tue Nov 12 10:13:56 EST 2013


12.11.2013 09:56, Vladislav Bogdanov wrote:
...
> Ah, then in_ccm will be set to false only when corosync (2) is stopped
> on a node, not when pacemaker is stopped?
> 
> Thus, current drbd agent/fencing logic does not (well) support just stop
> of pacemaker in my use-case, messaging layer should be stopped as well.
> 
> May be it should also look at the "shutdown" attribute...

Just for the thread completeness.
With the patch below and latest pacemaker "tip" from beekhof repository
drbd fence handler returns almost immediately and drbd resource is promoted
without delays on another node after shutdown of pacemaker instance which has
it promoted.

--- a/scripts/crm-fence-peer.sh 2013-09-27 10:47:52.000000000 +0000
+++ b/scripts/crm-fence-peer.sh 2013-11-12 13:45:52.274674803 +0000
@@ -500,6 +500,21 @@ guess_if_pacemaker_will_fence()
        [[ $crmd = "banned" ]] && will_fence=true
        if [[ ${expected-down} = "down" && $in_ccm = "false"  && $crmd != "online" ]]; then
                : "pacemaker considers this as clean down"
+       elif [[ $crmd/$join/$expected = "offline/down/down" ]] ; then
+               # Check if pacemaker is simply shutdown, but membership/quorum is possibly still established (corosync2/cman)
+               # 1.1.11 will set expected="down" on a clean shutdown too
+               # Look for "shutdown" transient node attribute
+               local node_attributes=$(set +x; echo "$cib_xml" | awk "/<node_state [^\n]*uname=\"$DRBD_PEER\"/,/<\/instance_attributes>/"| grep -F -e "<nvpair ")
+               if [ -n "${node_attributes}" ] ; then
+                       local shut_down=$(set +x; echo "$node_attributes" | awk '/ name="shutdown"/ {if (match($0, /value=\"([[:digit:]]+)\"/, values)) {print values[1]} }')
+                       if [ -n "${shut_down}" ] ; then
+                               : "pacemaker considers this as clean down"
+                       else
+                               will_fence=true
+                       fi
+               else
+                       will_fence=true
+               fi
        elif [[ $in_ccm = false ]] || [[ $crmd != "online" ]]; then
                will_fence=true
        fi





More information about the Pacemaker mailing list