Skip to content

Commit

Permalink
bsc1233972: Porting of SUSE#271 for a1.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
paolo-depa committed Dec 2, 2024
1 parent c5dff26 commit d8adcc6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions ra/saphana-common-lib
Original file line number Diff line number Diff line change
Expand Up @@ -676,13 +676,13 @@ function get_local_sr_config() {
function get_local_virtual_name() {
# called by: TODO
local -a listInstances
local lI lIh1
local lI
if [ -e /usr/sap/hostctrl/exe/saphostctrl ]; then
mapfile -t listInstances < <( /usr/sap/hostctrl/exe/saphostctrl -function ListInstances )
for lI in "${listInstances[@]}"; do
lIh1="${lI// /}"
# InstInfo:HA1-00-suse01-753,patch1010,changelist2124070
if [[ "$lIh1" =~ :"$SID"-"$InstanceNr"-([^-]*)- ]]; then
# InstInfo : HA1 - 00 - suse-01 - 753,patch1010,changelist2124070
# bsc#1233972 - hostname may include dashes
if [[ "$lI" =~ "$SID - $InstanceNr - "([^ ]*)" -" ]]; then
gVirtName="${BASH_REMATCH[1]}"
break
fi
Expand Down
14 changes: 7 additions & 7 deletions ra/saphana-topology-lib
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ function sht_start() {
local hanalrc=0
#local loopcount=0

# TODO: PRIO3: move the string "$HA_RSCTMP/SAPHana/SAPTopologyON" to a variable
# TODO: PRIO3: move the file to the clusters tmp directory?
# TODO PRIO3: move the string "$HA_RSCTMP/SAPHana/SAPTopologyON" to a variable
# TODO PRIO3: move the file to the clusters tmp directory?
mkdir -p "$HA_RSCTMP/SAPHana"
touch "$HA_RSCTMP/SAPHana/SAPTopologyON.${SID}"
if ! check_saphostagent; then
Expand All @@ -286,13 +286,13 @@ function sht_start() {
if [[ "$hanalrc" != 124 ]]; then
set_hana_attribute "${NODENAME}" "$gNodeRole" "${ATTR_NAME_HANA_ROLES[@]}"
fi
# TODO PRIO 1: scale-out used side-effect via RC_hdbnsutil to give back different return codes; scale-up rc was always OCF_SUCCESS
# TODO PRIO1: scale-out used side-effect via RC_hdbnsutil to give back different return codes; scale-up rc was always OCF_SUCCESS
# currently using the always-good mode to force OCF_SUCCESS
RC_hdbnsutil=0
case "$RC_hdbnsutil" in
0 | 1 ) rc="$OCF_SUCCESS";; # TODO: Prio 3: Need to check rc==1 - is that success or not_running?
0 | 1 ) rc="$OCF_SUCCESS";; # TODO PRIO3: Need to check rc==1 - is that success or not_running?
2 ) rc="$OCF_NOT_RUNNING";; # rc==2 have been seen for bad persistency layer
* ) rc="$OCF_SUCCESS";; # TODO: Prio 3: Need to check "other" return codes
* ) rc="$OCF_SUCCESS";; # TODO PRIO3: Need to check "other" return codes
esac
# old scale-up code:
# rc=$OCF_SUCCESS
Expand Down Expand Up @@ -329,7 +329,7 @@ function sht_monitor() {
super_ocf_log info "FLOW ${FUNCNAME[0]} ()"
local rc=0
local vName="${NODENAME}"
# TODO PRIO 1: 'node_role_walk' is only needed for scale-out; how to differ that here?
# TODO PRIO1: 'node_role_walk' is only needed for scale-out; how to differ that here?
node_role_walk --standbyFilter=off
# DONE: PRIO1: ASK: Is the output format of ListInstances fix? Could we take that as an API?
# try to catch: Inst Info : LNX - 42 - lv9041 - 740, patch 36, changelist 1444691
Expand Down Expand Up @@ -434,7 +434,7 @@ function sht_stop_clone() {
super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)"
local rc=0 tout=0 nRole nNsConf
hanaPrim="$(check_for_primary "live")";
# TODO: should we simplify the calculation of timeout (see saphana-silesystem-lib)?
# TODO should we simplify the calculation of timeout (see saphana-silesystem-lib)?
# shellcheck disable=SC2154
local actionTimeOut="$OCF_RESKEY_CRM_meta_timeout" stdTimeOut=300 actTimeOutPercent=50
if [ -z "$actionTimeOut" ]; then
Expand Down

4 comments on commit d8adcc6

@fmherschel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paolo-depa Could you tell me, what exactly you needed to port, to match for package 1.2.7? Mybe my eyes are not good enough - I only see that in line 437 you dropped the " PRIO3:". But I guess its more.

@paolo-depa
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fmherschel when trying to apply the patch SUSE#271 I received errors for hunk mismatch, so I decided to make a similar patch on my forked project, which I was eventually able to apply later on.
Unfortunately the logs for that build attempt seem to be gone, but - considerig that the patches are almost identical - I only can assume that the failure was due to a temporary IBS failure...

@paolo-depa
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fmherschel I was finally able to reproduce it and the issue is in saphana-topology-lib at line 286, 'cause v1.2.7 misses this commit, and the different operator within the if statement makes the patch be rejected: probably I'd better include also the mentioned commit if a PTF needs to be delivered, right?

@fmherschel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we already have SAPHanaSR-agni 1.2.9 out but WITHOUT my latest patch. Might it be possible you build the PTF based on my complete PR?

Please sign in to comment.