Compare commits

...

2 Commits
c10-beta ... c9

Author SHA1 Message Date
eb043654d2 import CS sap-hana-ha-1.2.10-1.el9_6 2025-09-16 08:07:00 +00:00
ccb63bae51 import CS sap-hana-ha-1.2.8-4.el9_6 2025-06-24 08:12:10 +00:00
9 changed files with 176 additions and 27 deletions

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
ClusterLabs-resource-agents-a6ccb93a.tar.gz
sap-hana-ha-87a5781.tar.gz
SOURCES/ClusterLabs-resource-agents-a6ccb93a.tar.gz
SOURCES/sap-hana-ha-14da4f0d.tar.gz

2
.sap-hana-ha.metadata Normal file
View File

@ -0,0 +1,2 @@
1b9dca55ed882a6353ac3fdf2cbbe572ff2a1618 SOURCES/ClusterLabs-resource-agents-a6ccb93a.tar.gz
6715147d3207eaab0e1a2cafb624f4d2c36adb96 SOURCES/sap-hana-ha-14da4f0d.tar.gz

View File

@ -0,0 +1,126 @@
--- sap-hana-ha/alert/SAPHanaSR-alert-fencing
+++ sap-hana-ha/alert/SAPHanaSR-alert-fencing
@@ -5,11 +5,25 @@
# Support: linux@sap.com
# License: GNU General Public License (GPL)
# Copyright: (c) 2024 SUSE LLC
-# Version: 2024-08-09-14:35
+# Version: 2025-07-17
+#
+# Configure the alert with crmsh:
#
# crm configure alert nodes-1 "/usr/bin/SAPHanaSR-alert-fencing" select nodes
# crm configure alert fencing-1 "/usr/bin/SAPHanaSR-alert-fencing" select fencing attributes alert_uptime_threshold=300
#
+# Configure the alert with pcs:
+#
+# pcs alert create id=alert-hana-1 path=/usr/bin/SAPHanaSR-alert-fencing options alert_uptime_threshold=300
+# cibadmin -CMX '<configuration> <alerts> <alert id="alert-hana-1"> <select> <select_nodes /> <select_fencing /> </select> </alert> </alerts> </configuration>'
+#
+# Controlling the fence attributes:
+# - hana_fence_action: allowed settings are terminate (default), fence or reboot
+# - hana_fence_timeout: default is 120 seconds, only applies to 'fence' or 'reboot' actions
+#
+# Examples:
+# crm_attribute --name=hana_fence_action --update=reboot
+# crm_attribute --name=hana_fence_timeout --update=300
logger_tag="SAPHanaSR-alert-fencing"
logger="/usr/bin/logger"
@@ -42,10 +56,28 @@ function process_fencing()
if [[ "$local_site_name" != "" && "$fenced_site_name" == "$local_site_name" ]]; then
$logger -t "$logger_tag" "DEC: FENCE ($fenced_site_name == $local_site_name)"
sleep 10
- sudo /usr/sbin/crm --force node fence "${HOSTNAME}"; rc="$?"
- if [[ "$rc" != "0" ]]; then
- $logger -t "$logger_tag" "ACT: sudo /usr/sbin/crm --force node fence ${HOSTNAME}; rc=$rc"
- fi
+ # Check if hana_fence_action is set, if not use 'terminate'.
+ hana_fence_action="$(/usr/sbin/crm_attribute -n hana_fence_action -G -d terminate -q)"
+ case "${hana_fence_action}" in
+ terminate)
+ /usr/sbin/crm_attribute -t status -N "${HOSTNAME}" -n terminate -v true
+ rc="$?"
+ if [[ "$rc" != "0" ]]; then
+ $logger -t "$logger_tag" "ACT: /usr/sbin/crm_attribute -t status -N \"${HOSTNAME}\" -n terminate -v true; rc=$?"
+ fi
+ ;;
+ fence | reboot)
+ hana_fence_timeout="$(/usr/sbin/crm_attribute -n hana_fence_timeout -G -d 120 -q)"
+ /usr/sbin/stonith_admin --"${hana_fence_action}"="${HOSTNAME}" --timeout="${hana_fence_timeout}"
+ rc="$?"
+ if [[ "$rc" != "0" ]]; then
+ $logger -t "$logger_tag" "ACT: /usr/sbin/stonith_admin --${hana_fence_action}=\"${HOSTNAME}\" --timeout=${hana_fence_timeout}; rc=$?"
+ fi
+ ;;
+ *)
+ $logger -t "$logger_tag" "ACT: unknown fence-action \"$hana_fence_action\""
+ ;;
+ esac
else
$logger -t "$logger_tag" "DEC: NO FENCE ($fenced_site_name != $local_site_name)"
fi
--- sap-hana-ha/tools/SAPHanaSR-hookHelper
+++ sap-hana-ha/tools/SAPHanaSR-hookHelper
@@ -19,7 +19,15 @@
# do not use '1' as return value, so we can distinguish between the return of
# the helper script and an error of 'sudo'
+
+
+# Controlling the fence attributes:
+# - hana_fence_action: allowed settings are terminate (default), fence or reboot
+# - hana_fence_timeout: default is 120 seconds, only applies to 'fence' or 'reboot' actions
#
+# Examples:
+# crm_attribute --name=hana_fence_action --update=reboot
+# crm_attribute --name=hana_fence_timeout --update=300
##### functions
@@ -30,6 +38,8 @@ usage() {
echo -e "\\t--ino=<InstanceNumber>: instance number (like 10) of the SAP instance"
echo -e "\\t--case=<use case>: the use case for the hook helper"
echo -e "\\t at the moment only 'checkTakeover' and 'fenceMe' is supported"
+ echo -e "\\t fencing-behavior and timeout with 'fenceMe' can be configured via"
+ echo -e "\\t hana_fence_action & hana_fence_timeout attributes"
echo -e "\\t--version: show script version"
echo -e "\\t--help: show help"
exit 1
@@ -246,13 +256,30 @@ case "$USECASE" in
;;
"fenceMe" )
nodeName=$(/usr/sbin/crm_node -n)
- #stonith_admin --reboot="$nodeName"
# only 'activate' the /root/SAPHanaSR-hookHelper.log logging, if really needed for debugging
#echo "$(date) SAPHanaSR-hookHelper fenceMe" >> /root/SAPHanaSR-hookHelper.log
su - "${ASID}adm" -c "HDB kill-9"
#echo "$(date) SAPHanaSR-hookHelper fenceMe - killed, now fence" >> /root/SAPHanaSR-hookHelper.log
- /usr/sbin/crm --force node fence "$nodeName"
- rc=42 # if fence is working this rc should never been send back
+ #
+ # Check if hana_fence_action is set, if not use 'terminate'.
+ hana_fence_action="$(/usr/sbin/crm_attribute -n hana_fence_action -G -d terminate -q)"
+ case "${hana_fence_action}" in
+ terminate)
+ /usr/sbin/crm_attribute -t status -N "${nodeName}" -n terminate -v true
+ # Sleep until fencing takes us down or someone removes the 'terminate' attribute.
+ while [ "$(crm_attribute -t status -N "${nodeName}" -n terminate -G -d false -q)" == "true" ]; do
+ sleep 10
+ done
+ rc=42
+ ;;
+ fence | reboot)
+ hana_fence_timeout="$(/usr/sbin/crm_attribute -n hana_fence_timeout -G -d 120 -q)"
+ /usr/sbin/stonith_admin --"${hana_fence_action}"="${nodeName}" --timeout="${hana_fence_timeout}" || rc=42
+ ;;
+ *)
+ rc=42
+ ;;
+ esac
;;
"firstStopThenKill" )
#
--
2.50.1

View File

@ -20,7 +20,7 @@ diff -up sap-hana-ha/srHook/global.ini_susCostOpt.patch100 sap-hana-ha/srHook/gl
--- sap-hana-ha/srHook/global.ini_susCostOpt.patch100 2024-07-08 14:39:04.000000000 +0200
+++ sap-hana-ha/srHook/global.ini_susCostOpt 2024-08-19 12:30:39.986351800 +0200
@@ -1,6 +1,6 @@
[ha_dr_provider_susCostOpt]
[ha_dr_provider_suscostopt]
provider = susCostOpt
-path = /usr/share/SAPHanaSR-angi
+path = /usr/share/sap-hana-ha
@ -31,10 +31,10 @@ diff -up sap-hana-ha/srHook/global.ini_susHanaSR.patch100 sap-hana-ha/srHook/glo
--- sap-hana-ha/srHook/global.ini_susHanaSR.patch100 2024-07-08 14:39:04.000000000 +0200
+++ sap-hana-ha/srHook/global.ini_susHanaSR 2024-08-19 12:30:39.986351800 +0200
@@ -1,7 +1,7 @@
-[ha_dr_provider_susHanaSR]
-[ha_dr_provider_sushanasr]
-provider = susHanaSR
-path = /usr/share/SAPHanaSR-angi
+[ha_dr_provider_HanaSR]
+[ha_dr_provider_hanasr]
+provider = HanaSR
+path = /usr/share/sap-hana-ha
execution_order = 1
@ -46,19 +46,19 @@ diff -up sap-hana-ha/srHook/global.ini_susTkOver.patch100 sap-hana-ha/srHook/glo
--- sap-hana-ha/srHook/global.ini_susTkOver.patch100 2024-07-08 14:39:04.000000000 +0200
+++ sap-hana-ha/srHook/global.ini_susTkOver 2024-08-19 12:30:39.987351802 +0200
@@ -1,9 +1,9 @@
-[ha_dr_provider_susTkOver]
-[ha_dr_provider_sustkover]
-provider = susTkOver
-path = /usr/share/SAPHanaSR-angi
-sustkover_timeout = 30
+[ha_dr_provider_TkOver]
+[ha_dr_provider_tkover]
+provider = TkOver
+path = /usr/share/sap-hana-ha
+tkover_timeout = 30
execution_order = 1
[trace]
-ha_dr_susTkOver = info
+ha_dr_TkOver = info
-ha_dr_sustkover = info
+ha_dr_tkover = info
diff -up sap-hana-ha/srHook/susChkSrv.py.patch100 sap-hana-ha/srHook/susChkSrv.py
--- sap-hana-ha/srHook/susChkSrv.py.patch100 2024-07-08 14:39:04.000000000 +0200
@ -285,3 +285,20 @@ diff -up sap-hana-ha/srHook/susTkOver.py.patch100 sap-hana-ha/srHook/susTkOver.p
"provider_description": "Block manual takeover, if cluster is active",
"provider_version": "1.0"}
diff -up sap-hana-ha/srHook/global.ini_susChkSrv_fence.patch100 sap-hana-ha/srHook/global.ini_susChkSrv_fence
--- sap-hana-ha/srHook/global.ini_susChkSrv_fence.patch100 2025-06-18 10:56:35.000000000 +0200
+++ sap-hana-ha/srHook/global.ini_susChkSrv_fence 2025-07-22 10:58:24.213433012 +0200
@@ -1,10 +1,10 @@
-[ha_dr_provider_suschksrv]
-provider = susChkSrv
-path = /usr/share/SAPHanaSR-angi/
+[ha_dr_provider_chksrv]
+provider = ChkSrv
+path = /usr/share/sap-hana-ha/
execution_order = 3
action_on_lost = fence
stop_timeout = 25
[trace]
-ha_dr_suschksrv = info
+ha_dr_chksrv = info

View File

@ -83,10 +83,10 @@ diff -up sap-hana-ha/tools/SAPHanaSR-upgrade-to-angi-demo.patch102 sap-hana-ha/t
CIB_MSTTMP_ANG="#
primitive rsc_SAPHanaCon_@@sid@@_HDB@@ino@@ ocf:suse:SAPHanaController \
op start interval=0 timeout=3600 \
@@ -80,7 +80,7 @@ function init-variables() {
cibadmin -Ql > "$BAKDIR"/cib.xml || exit 1
@@ -81,7 +81,7 @@ function init-variables() {
SCRIPT=/root/bin/"$EXE"
RPMOLD="SAPHanaSR"
RPMDOC="SAPHanaSR-doc"
- RPMNEW="SAPHanaSR-angi"
+ RPMNEW="sap-hana-ha"
SID=$(/usr/sap/hostctrl/exe/saphostctrl -function ListInstances |\

View File

@ -47,7 +47,7 @@
# Use %%{name}
# %%global name sap-hana-ha
%global saphana_hash 87a5781
%global saphana_hash 14da4f0d
# Whether this platform defaults to using systemd as an init system
# (needs to be evaluated prior to BuildRequires being enumerated and
@ -71,8 +71,8 @@
Name: sap-hana-ha
Summary: Cluster resource HA for SAP HANA in System Replication
Version: 1.2.8
Release: 3%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
Version: 1.2.10
Release: 1%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
License: GPLv2+
URL: https://github.com/SUSE/SAPHanaSR
Source0: %{upstream_prefix}-%{upstream_version}.tar.gz
@ -80,6 +80,9 @@ Source1: %{name}-%{saphana_hash}.tar.gz
# Unpackaged source, just to make sure centpkg keeps it.
Source2: create-rename-patches.sh
# Upstream PR waiting: https://github.com/SUSE/SAPHanaSR/pull/291
Patch01: 0001-feat-fencing-generic-commands-and-options.patch
# Patches that will always be needed.
# Other patches: handle conflicts if diff lines overlap
Patch100: patterns-srHook-files.patch
@ -274,8 +277,10 @@ install -m 0444 %{name}/srHook/global.ini_susChkSrv %{buildroot}/%{_datadir}/%{n
# Scripts for some add-on functionality.
# saphana_sr_tools is a lib imported by SAPHanaSR-* python scripts.
install -m 0555 %{name}/tools/SAPHanaSR-showAttr %{buildroot}%{_bindir}
install -m 0444 %{name}/tools/saphana_sr_tools.py %{buildroot}%{_usr}/lib/%{name}
install -m 0755 %{name}/alert/SAPHanaSR-alert-fencing %{buildroot}%{_bindir}
install -m 0755 %{name}/tools/SAPHanaSR-hookHelper %{buildroot}%{_bindir}
install -m 0755 %{name}/tools/SAPHanaSR-showAttr %{buildroot}%{_bindir}
install -m 0644 %{name}/tools/saphana_sr_tools.py %{buildroot}%{_usr}/lib/%{name}
## tree fixup
# remove docs (there is only one and they should come from doc sections in files)
@ -308,19 +313,20 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents
%exclude /usr/src
%changelog
* Fri Jan 17 2025 Janine Fuchs <jfuchs@redhat.com> - 1.2.8-3
- Include man pages.
* Tue Jul 29 2025 Janine Fuchs <jfuchs@redhat.com> - 1.2.10-1
- Rebase to 1.2.10 and include fencing scripts.
Resolves: RHEL-74289
Resolves: RHEL-104816
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1.2.8-2.1
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Fri Jun 06 2025 Janine Fuchs <jfuchs@redhat.com> - 1.2.8-4
- Fix dashes in hostname.
* Tue Aug 13 2024 Janine Fuchs <jfuchs@redhat.com> - 1.2.8-2
- Add package to RHEL 10.
Resolves: RHEL-84349
Resolves: RHEL-53598
* Mon Feb 03 2025 Janine Fuchs <jfuchs@redhat.com> - 1.2.8-3
- Add package to RHEL 9.
Resolves: RHEL-77481
# vim:set ai ts=2 sw=2 sts=2 et:

View File

@ -1,2 +0,0 @@
SHA512 (ClusterLabs-resource-agents-a6ccb93a.tar.gz) = 3ea92f051f16efbd0845d193cc7d2e7d8e9f66ba8e2bbba3a7b8d093ceff3103f8077b93037067dee8962a7d5c1ad0a0b5642acbaf385b0619cef96f18928911
SHA512 (sap-hana-ha-87a5781.tar.gz) = b772906a774b4eb0b29b2fafb289ecc410329eea7425e93814477a61a9d4b1a3971010d9eab7d38769555c2e66c29fb2e9df3117f11d43d8677537965966b07d