01.03.2016 18:30, Lars Ellenberg wrote:

Not sure about this one.
Is this only "heuristic", or do you have something in pacemaker source
you can point me to?

I definitely used both pacemaker sources and CIBs status section when was writing this. Unfortunately, the original patch is dated Nov 2013, so details are now lost from the mind context. I believe that with corosync2 in_ccm is true if corosync is running. The simplest way to try is to shutdown pacemaker on one node and see what is the result both with and without this patch.


If we are unsure, we better assume that the node should be fenced,
rather than assume that is was clean down when it actually is not
(even though it may already have had announced its intention to shutdown).

I believe I re-checked that trice because I use this patch in production (active/active) for more than two years.
The only thing may be missing is compatibility with older versions.


On Mon, Feb 29, 2016 at 03:10:37PM +0000, Vladislav Bogdanov wrote:
---
  scripts/crm-fence-peer.sh |   15 +++++++++++++++
  1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/scripts/crm-fence-peer.sh b/scripts/crm-fence-peer.sh
index 67f3457..83bae72 100755
--- a/scripts/crm-fence-peer.sh
+++ b/scripts/crm-fence-peer.sh
@@ -531,6 +531,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
--
1.7.1

_______________________________________________
drbd-user mailing list
[email protected]
http://lists.linbit.com/mailman/listinfo/drbd-user


_______________________________________________
drbd-user mailing list
[email protected]
http://lists.linbit.com/mailman/listinfo/drbd-user

Reply via email to