diff --git a/RHEL-250800-SAPInstance-list-unit-files-creates-high-load-on-systemd.patch b/RHEL-250800-SAPInstance-list-unit-files-creates-high-load-on-systemd.patch new file mode 100644 index 0000000..6278d63 --- /dev/null +++ b/RHEL-250800-SAPInstance-list-unit-files-creates-high-load-on-systemd.patch @@ -0,0 +1,21 @@ +commit 408f14e82ba1f45ff071c48ac42d8a05d2bf4511 +Author: Fabian Herschel +Date: Wed Aug 26 14:04:06 2026 +0200 + + SAPInstance - fix-issue-2209 - list-unit-files creates high load on systemd + +diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance +index 95140e9c..b3f4be91 100755 +--- a/heartbeat/SAPInstance ++++ b/heartbeat/SAPInstance +@@ -457,8 +457,8 @@ check_systemd_integration() { + local rc=1 + + if which "$SYSTEMCTL" 1>/dev/null 2>/dev/null; then +- if $SYSTEMCTL list-unit-files | \ +- awk '$1 == service { found=1 } END { if (! found) {exit 1}}' service="${systemd_unit_name}.service"; then ++ # use list-unit-files with expected unit-file to limit systemd load; this also allows to use the return-code of systemctl ++ if $SYSTEMCTL list-unit-files "${systemd_unit_name}.service" >/dev/null ; then + rc=0 + else + rc=1 diff --git a/RHEL-250800-SAPStartSrv-remove-misleading-monitor-operation.patch b/RHEL-250800-SAPStartSrv-remove-misleading-monitor-operation.patch new file mode 100644 index 0000000..5baea94 --- /dev/null +++ b/RHEL-250800-SAPStartSrv-remove-misleading-monitor-operation.patch @@ -0,0 +1,30 @@ +commit 74adf6fe8899742de30968fedb5b9e24c50c1cdb +Author: Fabian Herschel +Date: Fri Aug 7 08:59:41 2026 +0200 + + ra/SAPStartSrv.in - removed misleading interval-value for the monitor-operation; monitor-method: move init to probe-only to save time for regular monitors (even if should be avoided) + +diff --git a/ra/SAPStartSrv.in b/ra/SAPStartSrv.in +index 3aa34d9..125718a 100644 +--- a/ra/SAPStartSrv.in ++++ b/ra/SAPStartSrv.in +@@ -356,8 +356,8 @@ class SapStartSrv(object): + ''' + Is the sapstartsrv server process running? + ''' +- self._inititialize() + if ocf.is_probe(): ++ self._inititialize() + if self._get_status() == 0: + return ocf.OCF_SUCCESS + +@@ -433,8 +433,7 @@ def main(): + sapstartsrv_agent.add_action(name='start', timeout=60, handler=sapstartsrv_instance.start) + sapstartsrv_agent.add_action(name='stop', timeout=60, handler=sapstartsrv_instance.stop) + sapstartsrv_agent.add_action(name='status', timeout=60, handler=sapstartsrv_instance.status) +- sapstartsrv_agent.add_action( +- name='monitor', timeout=20, interval=120, handler=sapstartsrv_instance.monitor) ++ sapstartsrv_agent.add_action(name='monitor', timeout=20, handler=sapstartsrv_instance.monitor) + sapstartsrv_agent.add_action( + name='validate-all', timeout=5, handler=sapstartsrv_instance.validate) + diff --git a/resource-agents-sap.spec b/resource-agents-sap.spec index b747370..2da51c5 100644 --- a/resource-agents-sap.spec +++ b/resource-agents-sap.spec @@ -14,7 +14,7 @@ # # Use a specified version as HEAD if needed, e.g. "v4.14.0" # -# # Source0: +# # Source0: https://github.com/ClusterLabs/resource-agents # git checkout # TAG=$(git log --pretty="format:%h" -n 1) # distdir="ClusterLabs-resource-agents-${TAG}" @@ -22,7 +22,7 @@ # rm -rf $TARFILE $distdir # git archive --prefix=$distdir/ HEAD | gzip > $TARFILE # -# # Source1: +# # Source1: https://github.com/SUSE/SAPStartSrv-resourceAgent # git checkout # TAG=$(git log --pretty="format:%h" -n 1) # distdir="SAPStartSrv-resourceAgent-${TAG}" @@ -60,12 +60,15 @@ Name: resource-agents-sap Summary: SAP cluster resource agents Version: 4.15.1 -Release: 1%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 2%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: %{upstream_prefix}-%{upstream_version}.tar.gz Source1: %{sapstart_prefix}-%{sapstart_version}.tar.gz +Patch0: RHEL-250800-SAPInstance-list-unit-files-creates-high-load-on-systemd.patch +Patch1: RHEL-250800-SAPStartSrv-remove-misleading-monitor-operation.patch + BuildArch: noarch # Build dependencies @@ -116,6 +119,9 @@ SAP instances to be managed in a cluster environment. %setup -q -n %{upstream_prefix}-%{upstream_version} %setup -q -T -D -a 1 -n %{upstream_prefix}-%{upstream_version} +%patch -p1 -P 0 +%patch -p1 -P 1 -d %{sapstart_prefix}-%{sapstart_version} + # Move the agent to the others for the ClusterLabs included processing. mv %{sapstart_prefix}-%{sapstart_version}/ra/SAPStartSrv.in heartbeat @@ -240,6 +246,12 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents %exclude /usr/src %changelog +* Tue Sep 01 2026 Janine Fuchs - 4.15.1-2 +- SAPInstance: fix systemd list-unit-files causing high load +- SAPStartSrv: remove misleading default monitor operation + + Resolves: RHEL-250800 + * Fri Jan 10 2025 Janine Fuchs - 4.15.1-1 - Add resource agent SAPStartSrv. Resolves: RHEL-2294 diff --git a/tests/run_tests.sh b/tests/run_tests.sh index ae56ff2..c0297cc 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -2,15 +2,68 @@ err=0 -agents=$(pcs resource list ocf:heartbeat 2>&1) -if [ $(echo "$agents" | wc -l) -lt 2 ]; then - echo "ERROR: pcs: agents available:\n$agents" - err=$((err+1)) -else - echo "INFO: pcs: agents available..." -fi +printf "\n" # readability -if [ $err -ge 1 ]; then - echo -e "\nERROR: $err tests FAILED..." - exit 1 +list_resources() { +# Verify that 3 SAP* agents are present. + printf "Checking resource agents... " + num="3" + agents=$(pcs resource list ocf:heartbeat:SAP --nodesc) + if [ "$(echo "${agents}" | wc -l)" != "${num}" ]; then + printf "FAILED\n" + printf "ERROR: %s matching pcs agents expected, but found:\n%s\n" "${num}" "${agents}" + err=$((err+1)) + else + printf "SUCCESS\n" + printf "%s matching pcs agents found:\n%s\n" "${num}" "${agents}" + fi + printf "\n" # readability +} + +check_bins() { +# Verify that binaries are working. + for bin in \ + "/usr/bin/sapservices-move -h" + do + printf "Testing '%s'... " "${bin}" + output=$(${bin} 2>&1) + rc=$? + if [ "${rc}" -gt 0 ]; then + printf "FAILED\n" + printf "ERROR: %s\n" "${output}" + err=$((err+1)) + else + printf "SUCCESS\n" + fi + done + printf "\n" # readability +} + +check_services() { +# Verify that the services exist. They are not loaded by design (rc=3). + for service in \ + sapping.service \ + sappong.service + do + printf "Testing '%s'... " "${service}" + output=$(systemctl status ${service} 2>&1) + rc=$? + if [ "${rc}" -gt 3 ]; then + printf "FAILED\n" + printf "ERROR: %s\n" "${output}" + err=$((err+1)) + else + printf "SUCCESS\n" + fi + done + printf "\n" # readability +} + +list_resources +check_bins +check_services + +if [ "${err}" -gt 0 ]; then + printf "ERROR: %s tests FAILED...\n" "${err}" + exit 1 fi