Compare commits
No commits in common. "c8" and "c8s" have entirely different histories.
19
.gitignore
vendored
19
.gitignore
vendored
@ -1,12 +1,7 @@
|
||||
SOURCES/ClusterLabs-resource-agents-55a4e2c9.tar.gz
|
||||
SOURCES/aliyun-cli-2.1.10.tar.gz
|
||||
SOURCES/aliyun-python-sdk-core-2.13.1.tar.gz
|
||||
SOURCES/aliyun-python-sdk-ecs-4.9.3.tar.gz
|
||||
SOURCES/aliyun-python-sdk-vpc-3.0.2.tar.gz
|
||||
SOURCES/colorama-0.3.3.tar.gz
|
||||
SOURCES/google-cloud-sdk-360.0.0-linux-x86_64.tar.gz
|
||||
SOURCES/httplib2-0.20.4.tar.gz
|
||||
SOURCES/pycryptodome-3.20.0.tar.gz
|
||||
SOURCES/pyparsing-2.4.7-py2.py3-none-any.whl
|
||||
SOURCES/pyroute2-0.4.13.tar.gz
|
||||
SOURCES/urllib3-1.26.18.tar.gz
|
||||
/*.tar.gz
|
||||
/*.rpm
|
||||
/*.whl
|
||||
/.*
|
||||
/*/
|
||||
!/tests/
|
||||
/tests/*.retry
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
dfc65f4cac3f95026b2f5674019814a527333004 SOURCES/ClusterLabs-resource-agents-55a4e2c9.tar.gz
|
||||
306e131d8908ca794276bfe3a0b55ccc3bbd482f SOURCES/aliyun-cli-2.1.10.tar.gz
|
||||
0a56f6d9ed2014a363486d33b63eca094379be06 SOURCES/aliyun-python-sdk-core-2.13.1.tar.gz
|
||||
c2a98b9a1562d223a76514f05028488ca000c395 SOURCES/aliyun-python-sdk-ecs-4.9.3.tar.gz
|
||||
f14647a4d37a9a254c4e711b95a7654fc418e41e SOURCES/aliyun-python-sdk-vpc-3.0.2.tar.gz
|
||||
0fe5bd8bca54dd71223778a1e0bcca9af324abb1 SOURCES/colorama-0.3.3.tar.gz
|
||||
81f039cf075e9c8b70d5af99c189296a9e031de3 SOURCES/google-cloud-sdk-360.0.0-linux-x86_64.tar.gz
|
||||
7caf4412d9473bf17352316249a8133fa70b7e37 SOURCES/httplib2-0.20.4.tar.gz
|
||||
c55d177e9484d974c95078d4ae945f89ba2c7251 SOURCES/pycryptodome-3.20.0.tar.gz
|
||||
c8307f47e3b75a2d02af72982a2dfefa3f56e407 SOURCES/pyparsing-2.4.7-py2.py3-none-any.whl
|
||||
147149db11104c06d405fd077dcd2aa1c345f109 SOURCES/pyroute2-0.4.13.tar.gz
|
||||
84e2852d8da1655373f7ce5e7d5d3e256b62b4e4 SOURCES/urllib3-1.26.18.tar.gz
|
||||
@ -0,0 +1,46 @@
|
||||
From 66885ea0227e847b571608015b150d391a6234d7 Mon Sep 17 00:00:00 2001
|
||||
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
|
||||
Date: Mon, 23 Feb 2026 13:35:58 +0100
|
||||
Subject: [PATCH] db2: set reintegration when promotion is successful
|
||||
|
||||
---
|
||||
heartbeat/db2 | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/heartbeat/db2 b/heartbeat/db2
|
||||
index 82f2f82c3..4420b9989 100755
|
||||
--- a/heartbeat/db2
|
||||
+++ b/heartbeat/db2
|
||||
@@ -955,6 +955,16 @@ db2_promote() {
|
||||
PRIMARY/PEER/*|PRIMARY/REMOTE_CATCHUP/*|PRIMARY/REMOTE_CATCHUP_PENDING/CONNECTED|Primary/Peer)
|
||||
# nothing to do, only update pacemaker's view
|
||||
echo MASTER > $STATE_FILE
|
||||
+
|
||||
+ if [ -n "$remote_host" ]; then
|
||||
+ for db in $dblist
|
||||
+ do
|
||||
+ reint_attr="db2hadr-${inst1}_${inst2}_${db}_reint"
|
||||
+ ocf_log debug "Promotion succeeded, setting $reint_attr = 1"
|
||||
+ crm_attribute -n "$reint_attr" -N "$remote_host" -v "1" -l forever
|
||||
+ done
|
||||
+ fi
|
||||
+
|
||||
return $OCF_SUCCESS
|
||||
;;
|
||||
|
||||
@@ -981,6 +991,15 @@ db2_promote() {
|
||||
# update pacemaker's view
|
||||
echo MASTER > $STATE_FILE
|
||||
|
||||
+ if [ -n "$remote_host" ]; then
|
||||
+ for db in $dblist
|
||||
+ do
|
||||
+ reint_attr="db2hadr-${inst1}_${inst2}_${db}_reint"
|
||||
+ ocf_log debug "Promotion succeeded, setting $reint_attr = 1"
|
||||
+ crm_attribute -n "$reint_attr" -N "$remote_host" -v "1" -l forever
|
||||
+ done
|
||||
+ fi
|
||||
+
|
||||
return $OCF_SUCCESS
|
||||
fi
|
||||
|
||||
32
RHEL-166181-1-db2-fix-bashism.patch
Normal file
32
RHEL-166181-1-db2-fix-bashism.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From 3712b1f52bccddc767ad6f16ec67d6c8c29f1f71 Mon Sep 17 00:00:00 2001
|
||||
From: Valentin Vidic <vvidic@valentin-vidic.from.hr>
|
||||
Date: Sun, 3 Apr 2022 20:39:01 +0200
|
||||
Subject: [PATCH] db2: fix bashism
|
||||
|
||||
dash only allows -a as AND operator.
|
||||
---
|
||||
heartbeat/db2 | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/heartbeat/db2 b/heartbeat/db2
|
||||
index ea24d33fc8..4a4b2f477f 100755
|
||||
--- a/heartbeat/db2
|
||||
+++ b/heartbeat/db2
|
||||
@@ -407,7 +407,7 @@ db2_start() {
|
||||
# partition is explicitly specified, activate without
|
||||
# partition information. This allows db2 instances without
|
||||
# partition support to be managed.
|
||||
- if [ -z "$OCF_RESKEY_dbpartitionnum" ] && ! [ -a "$db2sql/db2nodes.cfg" ]; then
|
||||
+ if [ -z "$OCF_RESKEY_dbpartitionnum" ] && ! [ -e "$db2sql/db2nodes.cfg" ]; then
|
||||
start_opts=""
|
||||
fi
|
||||
|
||||
@@ -511,7 +511,7 @@ db2_stop_bg() {
|
||||
|
||||
rc=$OCF_SUCCESS
|
||||
|
||||
- if [ -z "$OCF_RESKEY_dbpartitionnum" ] && ! [ -a "$db2sql/db2nodes.cfg" ]; then
|
||||
+ if [ -z "$OCF_RESKEY_dbpartitionnum" ] && ! [ -e "$db2sql/db2nodes.cfg" ]; then
|
||||
stop_opts=""
|
||||
fi
|
||||
|
||||
@ -0,0 +1,143 @@
|
||||
From 26c0d48bc69da1859f1ce5205a8bb6eaf6297b81 Mon Sep 17 00:00:00 2001
|
||||
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
|
||||
Date: Wed, 25 Mar 2026 10:46:09 +0100
|
||||
Subject: [PATCH] db2: do not use db2stop, as it sends truncation messages,
|
||||
which in some cases are not delivered
|
||||
|
||||
This caused divergence in the log, and the user would have to manually rebuild
|
||||
the DB to recover from it.
|
||||
---
|
||||
heartbeat/db2 | 104 +++++++-------------------------------------------
|
||||
1 file changed, 13 insertions(+), 91 deletions(-)
|
||||
|
||||
diff --git a/heartbeat/db2 b/heartbeat/db2
|
||||
index 4420b9989..9de18639d 100755
|
||||
--- a/heartbeat/db2
|
||||
+++ b/heartbeat/db2
|
||||
@@ -596,45 +596,10 @@ db2_start() {
|
||||
return $OCF_SUCCESS
|
||||
}
|
||||
|
||||
-#
|
||||
-# helper function to be spawned
|
||||
-# so we can detect a hang of the db2stop command
|
||||
-#
|
||||
-db2_stop_bg() {
|
||||
- local rc output
|
||||
- local stop_opts="dbpartitionnum $db2node"
|
||||
-
|
||||
- rc=$OCF_SUCCESS
|
||||
-
|
||||
- if [ -z "$OCF_RESKEY_dbpartitionnum" ] && ! [ -e "$db2sql/db2nodes.cfg" ]; then
|
||||
- stop_opts=""
|
||||
- fi
|
||||
-
|
||||
- if output=$(runasdb2 db2stop force $stop_opts)
|
||||
- then
|
||||
- ocf_log info "DB2 instance $instance($db2node) stopped: $output"
|
||||
- else
|
||||
- case $output in
|
||||
- *SQL1032N*)
|
||||
- #SQL1032N No start database manager command was issued
|
||||
- ocf_log info "$output"
|
||||
- ;;
|
||||
-
|
||||
- *)
|
||||
- ocf_log err "DB2 instance $instance($db2node) stop failed: $output"
|
||||
- rc=$OCF_ERR_GENERIC
|
||||
- esac
|
||||
- fi
|
||||
-
|
||||
- return $rc
|
||||
-}
|
||||
-
|
||||
#
|
||||
# Stop the given db2 database instance
|
||||
#
|
||||
db2_stop() {
|
||||
- local stop_timeout grace_timeout stop_bg_pid i must_kill
|
||||
-
|
||||
# remove master score
|
||||
master_score -D -l reboot
|
||||
|
||||
@@ -647,67 +612,24 @@ db2_stop() {
|
||||
return $OCF_SUCCESS
|
||||
fi
|
||||
|
||||
- stop_timeout=${OCF_RESKEY_CRM_meta_timeout:-20000}
|
||||
-
|
||||
- # grace_time is 4/5 (unit is ms)
|
||||
- grace_timeout=$((stop_timeout/1250))
|
||||
-
|
||||
- # start db2stop in background as this may hang
|
||||
- db2_stop_bg &
|
||||
- stop_bg_pid=$!
|
||||
-
|
||||
- # wait for grace_timeout
|
||||
- i=0
|
||||
- while [ $i -lt $grace_timeout ]
|
||||
- do
|
||||
- kill -0 $stop_bg_pid 2>/dev/null || break;
|
||||
- sleep 1
|
||||
- i=$((i+1))
|
||||
- done
|
||||
-
|
||||
- # collect exit status but don't hang
|
||||
- if kill -0 $stop_bg_pid 2>/dev/null
|
||||
- then
|
||||
- stoprc=1
|
||||
- kill -9 $stop_bg_pid 2>/dev/null
|
||||
- else
|
||||
- wait $stop_bg_pid
|
||||
- stoprc=$?
|
||||
- fi
|
||||
-
|
||||
- must_kill=0
|
||||
-
|
||||
- if [ $stoprc -ne 0 ]
|
||||
+ # db2nkill kills *all* partitions on the node
|
||||
+ if [ -x $db2bin/db2nkill ]
|
||||
then
|
||||
- ocf_log warn "DB2 instance $instance($db2node): db2stop failed, using db2nkill"
|
||||
- must_kill=1
|
||||
- elif ! db2_instance_dead
|
||||
+ logasdb2 $db2bin/db2nkill $db2node
|
||||
+ elif [ -x $db2bin/db2_kill ]
|
||||
then
|
||||
- ocf_log warn "DB2 instance $instance($db2node): db2stop indicated success but there a still processes, using db2nkill"
|
||||
- must_kill=1
|
||||
+ logasdb2 $db2bin/db2_kill
|
||||
fi
|
||||
|
||||
- if [ $must_kill -eq 1 ]
|
||||
- then
|
||||
- # db2nkill kills *all* partitions on the node
|
||||
- if [ -x $db2bin/db2nkill ]
|
||||
- then
|
||||
- logasdb2 $db2bin/db2nkill $db2node
|
||||
- elif [ -x $db2bin/db2_kill ]
|
||||
- then
|
||||
- logasdb2 $db2bin/db2_kill
|
||||
- fi
|
||||
-
|
||||
- # loop forever (or lrmd kills us due to timeout) until the
|
||||
- # instance is dead
|
||||
- while ! db2_instance_dead
|
||||
- do
|
||||
- ocf_log info "DB2 instance $instance($db2node): waiting for processes to exit"
|
||||
- sleep 1
|
||||
- done
|
||||
+ # loop forever (or lrmd kills us due to timeout) until the
|
||||
+ # instance is dead
|
||||
+ while ! db2_instance_dead
|
||||
+ do
|
||||
+ ocf_log info "DB2 instance $instance($db2node): waiting for processes to exit"
|
||||
+ sleep 1
|
||||
+ done
|
||||
|
||||
- ocf_log info "DB2 instance $instance($db2node) is now dead"
|
||||
- fi
|
||||
+ ocf_log info "DB2 instance $instance($db2node) is now dead"
|
||||
|
||||
return $OCF_SUCCESS
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user