diff --git a/RHEL-191368-db2-avoid-promoting-in-standby_remote_catchup_pending-state.patch b/RHEL-191368-db2-avoid-promoting-in-standby_remote_catchup_pending-state.patch new file mode 100644 index 0000000..df9f152 --- /dev/null +++ b/RHEL-191368-db2-avoid-promoting-in-standby_remote_catchup_pending-state.patch @@ -0,0 +1,52 @@ +From 18f01d598fb654ed629d27d69c2bfccd74cef4a8 Mon Sep 17 00:00:00 2001 +From: Arslan Ahmad +Date: Thu, 9 Apr 2026 01:30:58 +0530 +Subject: [PATCH] db2: Avoid promotion in STANDBY/REMOTE_CATCHUP_PENDING state + +So to prevent data loss, promoting the standby node which is in +STANDBY/REMOTE_CATCHUP_PENDING/DISCONNECTED state will be avoided, +reporting same in cluster status. + +Fixes #2043 + +Signed-off-by: Arslan Ahmad +--- + heartbeat/db2 | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/heartbeat/db2 b/heartbeat/db2 +index 4420b9989e..744917574b 100755 +--- a/heartbeat/db2 ++++ b/heartbeat/db2 +@@ -944,7 +944,7 @@ db2_promote() { + for i in 1 2 + do + hadr=$(db2_hadr_status $db) || return $OCF_ERR_GENERIC +- ocf_log info "DB2 database $instance($db2node)/$db has HADR status $hadr and will be promoted" ++ ocf_log info "DB2 database $instance($db2node)/$db has HADR status $hadr" + + case "$hadr" in + Standard/Standalone) +@@ -965,6 +965,7 @@ db2_promote() { + done + fi + ++ ocf_log info "DB2 database $instance($db2node)/$db is already promoted" + return $OCF_SUCCESS + ;; + +@@ -975,11 +976,12 @@ db2_promote() { + STANDBY/*PEER/DISCONNECTED|Standby/DisconnectedPeer) + # must take over by force peer window only + force="by force peer window only" ++ ocf_log info "DB2 database will be promoted using 'by force peer window only' option" + ;; + +- # must take over by force + STANDBY/REMOTE_CATCHUP_PENDING/DISCONNECTED) +- force="by force" ++ ocf_exit_reason "Promoting database in $hadr state can result in data loss. Manual intervention required." ++ return $OCF_ERR_GENERIC + ;; + + *) diff --git a/resource-agents.spec b/resource-agents.spec index adb1a55..b209cdc 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -45,7 +45,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.10.0 -Release: 127%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 128%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: %{upstream_prefix}-%{upstream_version}.tar.gz @@ -224,6 +224,7 @@ Patch171: RHEL-180767-3-nfsserver-do-not-try-to-stop-fsidd-when-not-present.patc Patch172: RHEL-184272-nfsserver-monitor-nfsdcld-and-nfs-mountd-services-to-trigger-recovery-on-failure.patch Patch173: RHEL-171180-portblock-add-IPv6-support.patch Patch174: RHEL-183132-portblock-fix-IPv6-rule-detection-in-the-iptables-backend.patch +Patch175: RHEL-191368-db2-avoid-promoting-in-standby_remote_catchup_pending-state.patch # bundled ha-cloud-support libs Patch500: ha-cloud-support-aliyun.patch @@ -543,6 +544,7 @@ exit 1 %patch -p1 -P 172 %patch -p1 -P 173 %patch -p1 -P 174 +%patch -p1 -P 175 # bundled ha-cloud-support libs %patch -p1 -P 500 @@ -877,6 +879,11 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents %{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm %changelog +* Thu Jul 02 2026 Arslan Ahmad - 4.10.0-128 +- db2: avoid promoting in STANDBY/REMOTE_CATCHUP_PENDING state + + Resolves: RHEL-191368 + * Fri Jun 19 2026 Oyvind Albrigtsen - 4.10.0-127 - portblock: add IPv6 support - portblock: fix IPv6 rule detection in the iptables backend