|
|
15862b |
diff -uNr a/heartbeat/SAPHana b/heartbeat/SAPHana
|
|
|
15862b |
--- a/heartbeat/SAPHana 2017-05-11 12:12:17.207213156 +0200
|
|
|
15862b |
+++ b/heartbeat/SAPHana 2017-05-11 12:19:44.846798058 +0200
|
|
|
15862b |
@@ -16,7 +16,7 @@
|
|
|
15862b |
# Support: linux@sap.com
|
|
|
15862b |
# License: GNU General Public License (GPL)
|
|
|
15862b |
# Copyright: (c) 2013,2014 SUSE Linux Products GmbH
|
|
|
15862b |
-# (c) 2015-2016 SUSE Linux GmbH
|
|
|
15862b |
+# (c) 2015-2017 SUSE Linux GmbH
|
|
|
15862b |
#
|
|
|
15862b |
# An example usage:
|
|
|
15862b |
# See usage() function below for more details...
|
|
|
15862b |
@@ -35,7 +35,7 @@
|
|
|
15862b |
#######################################################################
|
|
|
15862b |
#
|
|
|
15862b |
# Initialization:
|
|
|
15862b |
-SAPHanaVersion="0.152.17"
|
|
|
15862b |
+SAPHanaVersion="0.152.21"
|
|
|
15862b |
timeB=$(date '+%s')
|
|
|
15862b |
|
|
|
15862b |
: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
|
|
|
15862b |
@@ -133,8 +133,8 @@
|
|
|
15862b |
function backup_global_and_nameserver() {
|
|
|
15862b |
super_ocf_log info "FLOW $FUNCNAME ($*)"
|
|
|
15862b |
local rc=0
|
|
|
15862b |
- cp /hana/shared/$SID/global/hdb/custom/config/global.ini /hana/shared/$SID/global/hdb/custom/config/global.ini.$(date +"%s")
|
|
|
15862b |
- cp /hana/shared/$SID/global/hdb/custom/config/nameserver.ini /hana/shared/$SID/global/hdb/custom/config/nameserver.ini.$(date +"%s")
|
|
|
15862b |
+ cp /hana/shared/${SID}/global/hdb/custom/config/global.ini /hana/shared/${SID}/global/hdb/custom/config/global.ini.$(date +"%s")
|
|
|
15862b |
+ cp /hana/shared/${SID}/global/hdb/custom/config/nameserver.ini /hana/shared/${SID}/global/hdb/custom/config/nameserver.ini.$(date +"%s")
|
|
|
15862b |
super_ocf_log info "FLOW $FUNCNAME rc=$rc"
|
|
|
15862b |
return $rc
|
|
|
15862b |
}
|
|
|
15862b |
@@ -665,7 +665,7 @@
|
|
|
15862b |
# DONE: PRIO4: SAPVIRHOST might be different to NODENAME
|
|
|
15862b |
# DONE: PRIO1: ASK: Is the output format of ListInstances fix? Could we take that as an API? Answer: Yes
|
|
|
15862b |
# try to catch: Inst Info : LNX - 42 - lv9041 - 740, patch 36, changelist 1444691
|
|
|
15862b |
- # We rely on the following format: SID is word#4, SYSNR is work#6, vHost is word#8
|
|
|
15862b |
+ # We rely on the following format: SID is word#4, SYSNR is word#6, vHost is word#8
|
|
|
15862b |
if [ -e /usr/sap/hostctrl/exe/saphostctrl ]; then
|
|
|
15862b |
vName=$(/usr/sap/hostctrl/exe/saphostctrl -function ListInstances \
|
|
|
15862b |
| awk '$4 == SID && $6 == SYSNR { print $8 }' SID=$SID SYSNR=$InstanceNr 2>/dev/null )
|
|
|
15862b |
@@ -713,27 +713,29 @@
|
|
|
15862b |
"[234]*:P:[^:]*:master .* 150"
|
|
|
15862b |
"[015-9]*:P:[^:]*:master .* 90"
|
|
|
15862b |
"[0-9]*:P:[^:]*:slave .* 60"
|
|
|
15862b |
- "[0-9]*:P:[^:]*:\? .* 0"
|
|
|
15862b |
- "[0-9]*:P:[^:]*:- .* 0"
|
|
|
15862b |
+ "[234]*:P:[^:]*:[?:-] .* 0"
|
|
|
15862b |
+ "[015-9]*:P:[^:]*:[?:-] .* -1"
|
|
|
15862b |
"[234]*:S:[^:]*:master SOK 100"
|
|
|
15862b |
+ "[234]*:S:[^:]*:master PRIM 100"
|
|
|
15862b |
"[015-9]*:S:[^:]*:master SOK 80"
|
|
|
15862b |
"[0-9]*:S:[^:]*:master SFAIL -INFINITY"
|
|
|
15862b |
"[0-9]*:S:[^:]*:slave SOK 10"
|
|
|
15862b |
"[0-9]*:S:[^:]*:slave SFAIL -INFINITY"
|
|
|
15862b |
- "[0-9]*:S:[^:]*:\? .* 0"
|
|
|
15862b |
- "[0-9]*:S:[^:]*:- .* 0"
|
|
|
15862b |
- ".* .* -1"
|
|
|
15862b |
+ "[234]*:S:[^:]*:[?:-] .* 0"
|
|
|
15862b |
+ "[015-9]*:S:[^:]*:[?:-] .* -1"
|
|
|
15862b |
+ ".* .* -1"
|
|
|
15862b |
)
|
|
|
15862b |
SCORING_TABLE_PREFERRED_LOCAL_RESTART=(
|
|
|
15862b |
- "[0-9]*:P:[^:]*:master .* 150"
|
|
|
15862b |
- "[0-9]*:P:[^:]*:.* .* 140"
|
|
|
15862b |
+ "[0-9]*:P:[^:]*:master .* 150"
|
|
|
15862b |
+ "[0-9]*:P:[^:]*:.* .* 140"
|
|
|
15862b |
"[0-9]*:S:[^:]*:master SOK 100"
|
|
|
15862b |
+ "[0-9]*:S:[^:]*:master PRIM 100"
|
|
|
15862b |
"[0-9]*:S:[^:]*:master SFAIL -INFINITY"
|
|
|
15862b |
"[0-9]*:S:[^:]*:slave SOK 10"
|
|
|
15862b |
"[0-9]*:S:[^:]*:slave SFAIL -INFINITY"
|
|
|
15862b |
- "[0-9]*:S:[^:]*:\? .* 0"
|
|
|
15862b |
- "[0-9]*:S:[^:]*:- .* 0"
|
|
|
15862b |
- ".* .* -1"
|
|
|
15862b |
+ "[015-9]*:S:[^:]*:[?:-] .* -1"
|
|
|
15862b |
+ "[234]*:S:[^:]*:[?:-] .* -1"
|
|
|
15862b |
+ ".* .* -1"
|
|
|
15862b |
)
|
|
|
15862b |
SCORING_TABLE_PREFERRED_NEVER=(
|
|
|
15862b |
"[234]*:P:[^:]*:master .* 150"
|
|
|
15862b |
@@ -1030,7 +1032,7 @@
|
|
|
15862b |
# TODO: Limit the runtime of systemReplicationStatus.py
|
|
|
15862b |
# SAP_CALL
|
|
|
15862b |
# FULL_SR_STATUS=$(su - $sidadm -c "python $DIR_EXECUTABLE/python_support/systemReplicationStatus.py $siteParam" 2>/dev/null); srRc=$?
|
|
|
15862b |
- FULL_SR_STATUS=$(HANA_CALL --timeout 60 --cmd "systemReplicationStatus.py" 2>/dev/null); srRc=$?
|
|
|
15862b |
+ FULL_SR_STATUS=$(HANA_CALL --timeout 60 --cmd "systemReplicationStatus.py $siteParam" 2>/dev/null); srRc=$?
|
|
|
15862b |
super_ocf_log info "DEC $FUNCNAME systemReplicationStatus.py (to site '$remSR_name')-> $srRc"
|
|
|
15862b |
super_ocf_log info "FLOW $FUNCNAME systemReplicationStatus.py (to site '$remSR_name')-> $srRc"
|
|
|
15862b |
#
|
|
|
15862b |
@@ -2445,8 +2447,9 @@
|
|
|
15862b |
else
|
|
|
15862b |
#
|
|
|
15862b |
# neither MASTER nor SLAVE - This clone instance seams to be broken!!
|
|
|
15862b |
- #
|
|
|
15862b |
- rc=$OCF_ERR_GENERIC
|
|
|
15862b |
+ # bsc#1027098 - do not stop SAP HANA if "only" HANA state is not correct
|
|
|
15862b |
+ # Let next monitor find, if that HANA instance is available or not
|
|
|
15862b |
+ rc=$OCF_SUCCESS;
|
|
|
15862b |
fi
|
|
|
15862b |
fi
|
|
|
15862b |
rc=$?
|
|
|
15862b |
diff -uNr a/heartbeat/SAPHanaTopology b/heartbeat/SAPHanaTopology
|
|
|
15862b |
--- a/heartbeat/SAPHanaTopology 2017-05-11 12:12:17.205213176 +0200
|
|
|
15862b |
+++ b/heartbeat/SAPHanaTopology 2017-05-11 12:12:40.642982012 +0200
|
|
|
15862b |
@@ -14,7 +14,7 @@
|
|
|
15862b |
# Support: linux@sap.com
|
|
|
15862b |
# License: GNU General Public License (GPL)
|
|
|
15862b |
# Copyright: (c) 2014 SUSE Linux Products GmbH
|
|
|
15862b |
-# (c) 2015-2016 SUSE Linux GmbH
|
|
|
15862b |
+# (c) 2015-2017 SUSE Linux GmbH
|
|
|
15862b |
#
|
|
|
15862b |
# An example usage:
|
|
|
15862b |
# See usage() function below for more details...
|
|
|
15862b |
@@ -28,7 +28,7 @@
|
|
|
15862b |
#######################################################################
|
|
|
15862b |
#
|
|
|
15862b |
# Initialization:
|
|
|
15862b |
-SAPHanaVersion="0.152.17"
|
|
|
15862b |
+SAPHanaVersion="0.152.21"
|
|
|
15862b |
timeB=$(date '+%s')
|
|
|
15862b |
|
|
|
15862b |
: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
|
|
|
15862b |
@@ -474,6 +474,7 @@
|
|
|
15862b |
ATTR_NAME_HANA_SRMODE=("hana_${sid}_srmode" "forever")
|
|
|
15862b |
ATTR_NAME_HANA_VHOST=("hana_${sid}_vhost" "forever")
|
|
|
15862b |
ATTR_NAME_HANA_STATUS=("hana_${sid}_status" "reboot")
|
|
|
15862b |
+ ATTR_NAME_HANA_VERSION=("hana_${sid}_version" "reboot")
|
|
|
15862b |
#
|
|
|
15862b |
# new "central" attributes
|
|
|
15862b |
#
|
|
|
15862b |
@@ -531,7 +532,7 @@
|
|
|
15862b |
# hdbnsutil was a bit unstable in some tests so we recall the tool, if it fails to report the srmode
|
|
|
15862b |
for chkMethod in hU hU hU gP ; do
|
|
|
15862b |
# DONE: Limit the runtime of hdbnsutil.
|
|
|
15862b |
- # TODO: Use getParameter.py if we get no answer
|
|
|
15862b |
+ # DONE: Use getParameter.py if we get no answer
|
|
|
15862b |
# SAP_CALL
|
|
|
15862b |
#super_ocf_log debug "DBG2: hdbANSWER=$hdbANSWER"
|
|
|
15862b |
#srmode=$(echo "$hdbANSWER" | awk -F= '/mode/ {print $2}')
|
|
|
15862b |
@@ -602,7 +603,18 @@
|
|
|
15862b |
# currently having more than 2 HANA in a chain/star members IN the cluster is not allowed, the third must be external
|
|
|
15862b |
if [ "$NODENAME" != "$n1" ]; then
|
|
|
15862b |
hanaSite=$(get_hana_attribute ${n1} ${ATTR_NAME_HANA_SITE[@]})
|
|
|
15862b |
- hanaRemoteHost="$n1"
|
|
|
15862b |
+ #
|
|
|
15862b |
+ # only, if a hanaSite is found use that node - this allows majority makers
|
|
|
15862b |
+ #
|
|
|
15862b |
+ if [ -n "$hanaSite" ]; then
|
|
|
15862b |
+ hanaRemoteHost=$(get_hana_attribute ${n1} ${ATTR_NAME_HANA_VHOST[@]})
|
|
|
15862b |
+ #
|
|
|
15862b |
+ # only if vhost is NOT set use the nodename instead
|
|
|
15862b |
+ #
|
|
|
15862b |
+ if [ -z "$hanaRemoteHost" ]; then
|
|
|
15862b |
+ hanaRemoteHost="$n1"
|
|
|
15862b |
+ fi
|
|
|
15862b |
+ fi
|
|
|
15862b |
fi
|
|
|
15862b |
done
|
|
|
15862b |
super_ocf_log info "DEC: site=$site, mode=$srmode, hanaRemoteHost=$hanaRemoteHost - found by remote site ($hanaSite)"
|
|
|
15862b |
@@ -700,7 +712,7 @@
|
|
|
15862b |
# TODO: PRIO3: move the string "$HA_RSCTMP/SAPHana/SAPTopologyON" to a variable
|
|
|
15862b |
# TODO: PRIO3: move the file to the clusters tmp directory?
|
|
|
15862b |
mkdir -p $HA_RSCTMP/SAPHana
|
|
|
15862b |
- touch $HA_RSCTMP/SAPHana/SAPTopologyON
|
|
|
15862b |
+ touch $HA_RSCTMP/SAPHana/SAPTopologyON.${SID}
|
|
|
15862b |
if ! check_saphostagent; then
|
|
|
15862b |
start_saphostagent
|
|
|
15862b |
fi
|
|
|
15862b |
@@ -722,7 +734,7 @@
|
|
|
15862b |
local output=""
|
|
|
15862b |
local rc=0
|
|
|
15862b |
|
|
|
15862b |
- rm $HA_RSCTMP/SAPHana/SAPTopologyON
|
|
|
15862b |
+ rm $HA_RSCTMP/SAPHana/SAPTopologyON.${SID}
|
|
|
15862b |
rc=$OCF_SUCCESS
|
|
|
15862b |
|
|
|
15862b |
super_ocf_log info "FLOW $FUNCNAME rc=$rc"
|
|
|
15862b |
@@ -740,7 +752,7 @@
|
|
|
15862b |
super_ocf_log info "FLOW $FUNCNAME ($*)"
|
|
|
15862b |
local rc=0
|
|
|
15862b |
|
|
|
15862b |
- if [ -f $HA_RSCTMP/SAPHana/SAPTopologyON ]; then
|
|
|
15862b |
+ if [ -f $HA_RSCTMP/SAPHana/SAPTopologyON.${SID} ]; then
|
|
|
15862b |
rc=$OCF_SUCCESS
|
|
|
15862b |
else
|
|
|
15862b |
rc=$OCF_NOT_RUNNING
|
|
|
15862b |
@@ -845,6 +857,11 @@
|
|
|
15862b |
if ocf_is_probe; then
|
|
|
15862b |
super_ocf_log debug "DBG2: PROBE ONLY"
|
|
|
15862b |
sht_monitor; rc=$?
|
|
|
15862b |
+ local hana_version=$(HANA_CALL --timeout 10 --cmd "HDB version" \
|
|
|
15862b |
+ | awk -F':' '$1==" version" {print $2}; ' | tr -d '[:space:]')
|
|
|
15862b |
+ if [[ -n $hana_version ]]; then
|
|
|
15862b |
+ set_hana_attribute "${NODENAME}" "$hana_version" ${ATTR_NAME_HANA_VERSION[@]}
|
|
|
15862b |
+ fi
|
|
|
15862b |
else
|
|
|
15862b |
super_ocf_log debug "DBG2: REGULAR MONITOR"
|
|
|
15862b |
if ! check_saphostagent; then
|
|
|
15862b |
@@ -871,9 +888,13 @@
|
|
|
15862b |
super_ocf_log debug "DBG2: HANA IS STANDALONE"
|
|
|
15862b |
sht_monitor; rc=$?
|
|
|
15862b |
else
|
|
|
15862b |
- hanaPrim="-"
|
|
|
15862b |
- super_ocf_log warn "ACT: sht_monitor_clone: HANA_STATE_DEFECT"
|
|
|
15862b |
- rc=$OCF_ERR_CONFIGURED
|
|
|
15862b |
+ # bsc#1027098 Do not mark HANA instance as failed, if "only" the HANA state could not be detected
|
|
|
15862b |
+ hanaPrim=$(get_hana_attribute ${NODENAME} ${ATTR_NAME_HANA_ROLES[@]} | awk -F: '{ print $2}')
|
|
|
15862b |
+ if [ "$hanaPrim" = "" ]; then
|
|
|
15862b |
+ hanaPrim="-"
|
|
|
15862b |
+ fi
|
|
|
15862b |
+ super_ocf_log warn "ACT: sht_monitor_clone: HANA_STATE_DEFECT (primary/secondary state could not be detected at this point of time)"
|
|
|
15862b |
+ sht_monitor; rc=$?
|
|
|
15862b |
fi
|
|
|
15862b |
fi
|
|
|
15862b |
# DONE: PRIO1: ASK: Is the output format of ListInstances fix? Could we take that as an API?
|