Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package resource-agents for openSUSE:Factory
checked in at 2026-11-16 09:06:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/resource-agents (Old)
and /work/SRC/openSUSE:Factory/.resource-agents.new.1251 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "resource-agents"
Mon Nov 16 09:06:20 2026 rev:154 rq:1397317 version:4.18.0+git118.8806b1e9
Changes:
--------
--- /work/SRC/openSUSE:Factory/resource-agents/resource-agents.changes
2026-10-06 19:14:19.962259063 +0200
+++
/work/SRC/openSUSE:Factory/.resource-agents.new.1251/resource-agents.changes
2026-11-16 09:07:21.289998220 +0100
@@ -1,0 +2,14 @@
+Thu Nov 12 15:28:38 UTC 2026 - Peter Varkoly <[email protected]>
+
+- Update to version 4.18.0+git118.8806b1e9:
+ * gcp-pd-move: optimize agent (#2224) (bsc#1290101)
+ * valkey: add valkey as an alias for the redis agent
+ * crypt: add allow_clone for non-shared encrypted devices
+ * LVM-activate: add basic access mode for local volume groups
+ * Merge pull request #2222 from Obihoernchen/filesystem-lustre-tgt
+ * podman-etcd: fall back to revision comparison when claim time isn't
definitive
+ * podman-etcd: post-check force_new_cluster claims and yield on version skew
+ * podman-etcd: make force_new_cluster a claim timestamp
+ * podman-etcd: pre-check force_new_cluster holders before writing
+
+-------------------------------------------------------------------
Old:
----
resource-agents-4.18.0+git105.9ea1183.tar.xz
New:
----
resource-agents-4.18.0+git118.8806b1e9.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ resource-agents.spec ++++++
--- /var/tmp/diff_new_pack.K7Blab/_old 2026-11-16 09:07:22.229037549 +0100
+++ /var/tmp/diff_new_pack.K7Blab/_new 2026-11-16 09:07:22.231037633 +0100
@@ -17,7 +17,7 @@
Name: resource-agents
-Version: 4.18.0+git105.9ea1183
+Version: 4.18.0+git118.8806b1e9
Release: 0
Summary: HA Reusable Cluster Resource Scripts
License: GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.K7Blab/_old 2026-11-16 09:07:22.293040230 +0100
+++ /var/tmp/diff_new_pack.K7Blab/_new 2026-11-16 09:07:22.297040397 +0100
@@ -1,7 +1,7 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/ClusterLabs/resource-agents.git</param>
-<param name="changesrevision">9ea1183281fc6a27016b586dc2562ede951fdb28</param>
+<param name="changesrevision">8806b1e95a0f394c13ee89904e4e40c5f639d39c</param>
</service>
</servicedata>
(No newline at EOF)
++++++ drop-deprecated-agents.patch ++++++
--- /var/tmp/diff_new_pack.K7Blab/_old 2026-11-16 09:07:22.310040942 +0100
+++ /var/tmp/diff_new_pack.K7Blab/_new 2026-11-16 09:07:22.313041067 +0100
@@ -1,7 +1,7 @@
-diff -ru resource-agents-4.18.0+git81.694408f0-orig/doc/man/Makefile.am
resource-agents-4.18.0+git81.694408f0/doc/man/Makefile.am
---- resource-agents-4.18.0+git81.694408f0-orig/doc/man/Makefile.am
2026-08-10 12:12:31.000000000 +0200
-+++ resource-agents-4.18.0+git81.694408f0/doc/man/Makefile.am 2026-08-11
16:54:34.921117088 +0200
-@@ -77,69 +77,46 @@
+diff -rup resource-agents-4.18.0+git118.8806b1e9-orig/doc/man/Makefile.am
resource-agents-4.18.0+git118.8806b1e9/doc/man/Makefile.am
+--- resource-agents-4.18.0+git118.8806b1e9-orig/doc/man/Makefile.am
2026-11-11 08:00:29.000000000 +0100
++++ resource-agents-4.18.0+git118.8806b1e9/doc/man/Makefile.am 2026-11-13
12:29:14.157131208 +0100
+@@ -77,69 +77,46 @@ clean-local:
# 12126 on savannah.gnu.org. But, maybe it gets fixed soon, it was
# first reported in 1995 and added to Savannah in in 2005...
if BUILD_DOC
@@ -72,7 +72,7 @@
ocf_heartbeat_galera.7 \
ocf_heartbeat_ganesha-nfs.7 \
ocf_heartbeat_garbd.7 \
-@@ -151,24 +128,13 @@
+@@ -151,24 +128,13 @@ man_MANS = ocf_heartbeat_
ocf_heartbeat_iface-bridge.7 \
ocf_heartbeat_iface-macvlan.7 \
ocf_heartbeat_iface-vlan.7 \
@@ -97,7 +97,7 @@
ocf_heartbeat_named.7 \
ocf_heartbeat_nfsnotify.7 \
ocf_heartbeat_nfsserver.7 \
-@@ -177,10 +143,6 @@
+@@ -177,10 +143,6 @@ man_MANS = ocf_heartbeat_
ocf_heartbeat_nvmet-namespace.7 \
ocf_heartbeat_nvmet-port.7 \
ocf_heartbeat_openstack-info.7 \
@@ -108,7 +108,7 @@
ocf_heartbeat_oraasm.7 \
ocf_heartbeat_oracle.7 \
ocf_heartbeat_oralsnr.7 \
-@@ -188,41 +150,25 @@
+@@ -188,43 +150,22 @@ man_MANS = ocf_heartbeat_
ocf_heartbeat_ovsmonitor.7 \
ocf_heartbeat_pgagent.7 \
ocf_heartbeat_pgsql.7 \
@@ -134,6 +134,7 @@
- ocf_heartbeat_symlink.7 \
- ocf_heartbeat_syslog-ng.7 \
- ocf_heartbeat_tomcat.7 \
+- ocf_heartbeat_valkey.7 \
- ocf_heartbeat_varnish.7 \
- ocf_heartbeat_vdo-vol.7 \
- ocf_heartbeat_vmware.7 \
@@ -148,16 +149,14 @@
-if BUILD_AZURE_EVENTS
-man_MANS += ocf_heartbeat_azure-events.7
-endif
-+#if BUILD_AZURE_EVENTS
-+#man_MANS += ocf_heartbeat_azure-events.7
-+#endif
-
+-
if BUILD_AZURE_EVENTS_AZ
man_MANS += ocf_heartbeat_azure-events-az.7
-diff -ru resource-agents-4.18.0+git81.694408f0-orig/heartbeat/Makefile.am
resource-agents-4.18.0+git81.694408f0/heartbeat/Makefile.am
---- resource-agents-4.18.0+git81.694408f0-orig/heartbeat/Makefile.am
2026-08-10 12:12:31.000000000 +0200
-+++ resource-agents-4.18.0+git81.694408f0/heartbeat/Makefile.am
2026-08-11 16:56:59.909067729 +0200
-@@ -50,39 +50,24 @@
+ endif
+diff -rup resource-agents-4.18.0+git118.8806b1e9-orig/heartbeat/Makefile.am
resource-agents-4.18.0+git118.8806b1e9/heartbeat/Makefile.am
+--- resource-agents-4.18.0+git118.8806b1e9-orig/heartbeat/Makefile.am
2026-11-11 08:00:29.000000000 +0100
++++ resource-agents-4.18.0+git118.8806b1e9/heartbeat/Makefile.am
2026-11-13 12:27:01.849769973 +0100
+@@ -50,39 +50,24 @@ IPv6addr_LDADD = -lplumb $(LIBN
send_ua_SOURCES = send_ua.c IPv6addr_utils.c
send_ua_LDADD = $(LIBNETLIBS)
@@ -198,7 +197,7 @@
VirtualDomain \
WAS \
WAS6 \
-@@ -93,14 +78,11 @@
+@@ -93,14 +78,11 @@ ocf_SCRIPTS = AoEtarget \
aliyun-vpc-move-ip \
anything \
apache \
@@ -213,7 +212,7 @@
corosync-qnetd \
crypt \
db2 \
-@@ -109,11 +91,8 @@
+@@ -109,11 +91,8 @@ ocf_SCRIPTS = AoEtarget \
dummypy \
docker \
docker-compose \
@@ -225,7 +224,7 @@
galera \
ganesha-nfs \
garbd \
-@@ -122,25 +101,15 @@
+@@ -122,25 +101,15 @@ ocf_SCRIPTS = AoEtarget \
iSCSILogicalUnit \
iSCSITarget \
ibmmq \
@@ -252,7 +251,7 @@
named \
nfsnotify \
nfsserver \
-@@ -148,11 +117,6 @@
+@@ -148,11 +117,6 @@ ocf_SCRIPTS = AoEtarget \
nvmet-subsystem \
nvmet-namespace \
nvmet-port \
@@ -264,7 +263,7 @@
oraasm \
oracle \
oralsnr \
-@@ -160,38 +124,21 @@
+@@ -160,38 +124,21 @@ ocf_SCRIPTS = AoEtarget \
ovsmonitor \
pgagent \
pgsql \
++++++ resource-agents-4.18.0+git105.9ea1183.tar.xz ->
resource-agents-4.18.0+git118.8806b1e9.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/resource-agents-4.18.0+git105.9ea1183/doc/man/Makefile.am
new/resource-agents-4.18.0+git118.8806b1e9/doc/man/Makefile.am
--- old/resource-agents-4.18.0+git105.9ea1183/doc/man/Makefile.am
2026-10-01 14:28:46.000000000 +0200
+++ new/resource-agents-4.18.0+git118.8806b1e9/doc/man/Makefile.am
2026-11-11 08:00:29.000000000 +0100
@@ -210,6 +210,7 @@
ocf_heartbeat_symlink.7 \
ocf_heartbeat_syslog-ng.7 \
ocf_heartbeat_tomcat.7 \
+ ocf_heartbeat_valkey.7 \
ocf_heartbeat_varnish.7 \
ocf_heartbeat_vdo-vol.7 \
ocf_heartbeat_vmware.7 \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/resource-agents-4.18.0+git105.9ea1183/heartbeat/Filesystem
new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/Filesystem
--- old/resource-agents-4.18.0+git105.9ea1183/heartbeat/Filesystem
2026-10-01 14:28:46.000000000 +0200
+++ new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/Filesystem
2026-11-11 08:00:29.000000000 +0100
@@ -416,7 +416,7 @@
# Get the current real device name, if possible.
# (specified devname could be -L or -U...)
case "$FSTYPE" in
-
nfs4|nfs|aznfs|efs|smbfs|cifs|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs|none|lustre)
+
nfs4|nfs|aznfs|efs|smbfs|cifs|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs|none|lustre|lustre_tgt)
: ;;
*)
match_string="${TAB}${CANONICALIZED_MOUNTPOINT}${TAB}"
@@ -498,7 +498,7 @@
no) false;;
""|auto)
case "$FSTYPE" in
-
ext4|ext4dev|ext3|reiserfs|reiser4|nss|xfs|jfs|vfat|fat|nfs4|nfs|aznfs|efs|cifs|smbfs|ocfs2|gfs2|none|lustre|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs)
+
ext4|ext4dev|ext3|reiserfs|reiser4|nss|xfs|jfs|vfat|fat|nfs4|nfs|aznfs|efs|cifs|smbfs|ocfs2|gfs2|none|lustre|lustre_tgt|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs)
false;;
*)
true;;
@@ -513,6 +513,7 @@
fstype_supported()
{
local support="$FSTYPE"
+ local module=""
local rc
if [ "X${HOSTOS}" = "XOpenBSD" ];then
@@ -531,6 +532,8 @@
fuse.*|glusterfs|rozofs) support="fuse";;
efs) check_binary "mount.efs"; support="nfs4";;
aznfs) check_binary "mount.aznfs"; support="nfs4";;
+ # there is no lustre_tgt module, only the fs-lustre_tgt alias
+ lustre_tgt) module="fs-lustre_tgt";;
esac
if [ "$support" != "$FSTYPE" ]; then
@@ -545,7 +548,7 @@
# if here, we should attempt to load the module and then
# check the if the filesystem support exists again.
- $MODPROBE $support >/dev/null
+ $MODPROBE ${module:-$support} >/dev/null
if [ $? -ne 0 ]; then
ocf_exit_reason "Couldn't find filesystem $support in
/proc/filesystems and failed to load kernel module"
return $OCF_ERR_INSTALLED
@@ -1187,7 +1190,7 @@
use_check_blkid_opt=""
# these are definitely not block devices
case "$FSTYPE" in
-
nfs4|nfs|aznfs|efs|smbfs|cifs|none|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs|lustre)
return;;
+
nfs4|nfs|aznfs|efs|smbfs|cifs|none|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs|lustre|lustre_tgt)
return;;
esac
if $(is_option "loop"); then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/resource-agents-4.18.0+git105.9ea1183/heartbeat/LVM-activate
new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/LVM-activate
--- old/resource-agents-4.18.0+git105.9ea1183/heartbeat/LVM-activate
2026-10-01 14:28:46.000000000 +0200
+++ new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/LVM-activate
2026-11-11 08:00:29.000000000 +0100
@@ -75,6 +75,7 @@
# 2: vg is clustered - clvmd (old)
# 3: vg has system_id (new)
# 4: vg has tagging (old)
+# 5: vg is local to one node - basic
VG_access_mode=${OCF_RESKEY_vg_access_mode}
VG_access_mode_num=0
@@ -108,6 +109,7 @@
* system_id
* clvmd
* tagging
+* basic
Notes:
@@ -122,6 +124,12 @@
3. The autoactivation property of volume group will be disabled when
vg_access_mode
is set to system_id.
+4. The "basic" vg_access_mode activates and deactivates LVs without any
+cluster protection. Use it only for volume groups whose physical volumes no
+other node can see, for example local VGs that hold DRBD backing devices,
+where the resource can be cloned so each node activates its own copy of the VG.
+Using "basic" on shared storage risks data corruption.
+
Option: OCF_CHECK_LEVEL
The standard monitor operation of depth 0 checks if the VG or LV is valid.
@@ -156,8 +164,9 @@
<parameter name="vg_access_mode" unique="0" required="1">
<longdesc lang="en">
This option decides which solution will be used to protect the volume group in
-cluster environment. Optional solutions are: lvmlockd, clvmd, system_id and
-tagging.
+cluster environment. Optional solutions are: lvmlockd, clvmd, system_id,
+tagging and basic. "basic" provides no protection and is only safe for
+volume groups whose physical volumes are local to one node.
</longdesc>
<shortdesc lang="en">The VG access mode</shortdesc>
<content type="string" default="${OCF_RESKEY_vg_access_mode_default}" />
@@ -171,7 +180,8 @@
With "exclusive", an LV can be activated by one node at a time.
This option only has effect on "lvmlockd"/"clvmd" vg_access_mode. For
"system_id"
-and "tagging", they always mean exclusive activation.
+and "tagging", they always mean exclusive activation. For "basic", LVs are
+always activated with a plain "-ay".
</longdesc>
<shortdesc lang="en">Logical volume activation mode</shortdesc>
<content type="string" default="${OCF_RESKEY_activation_mode_default}" />
@@ -245,6 +255,7 @@
# 2: vg is clustered - clvmd (old)
# 3: vg has system_id (new)
# 4: vg has tagging (old)
+# 5: vg is local to one node - basic
get_VG_access_mode_num()
{
@@ -270,6 +281,8 @@
# TODO:
# We don't have reliable way to test if tagging activation is
used.
access_mode=4
+ elif [ "$VG_access_mode" = "basic" ]; then
+ access_mode=5
else
access_mode=0
fi
@@ -521,6 +534,9 @@
tagging)
VG_access_mode_num=4
;;
+ basic)
+ VG_access_mode_num=5
+ ;;
*)
# dont exit with error-code here or nodes will get fenced on
# e.g. "pcs resource create"
@@ -623,6 +639,8 @@
4)
tagging_check
;;
+ 5)
+ ;;
*)
ocf_exit_reason "Incorrect VG access mode detected!"
exit $OCF_ERR_CONFIGURED
@@ -753,6 +771,15 @@
return $OCF_SUCCESS
}
+basic_activate() {
+ do_activate "-ay"
+ if [ $? -ne $OCF_SUCCESS ]; then
+ return $OCF_ERR_GENERIC
+ fi
+
+ return $OCF_SUCCESS
+}
+
lvmlockd_deactivate() {
do_activate "-an"
if [ $? -ne $OCF_SUCCESS ]; then
@@ -805,6 +832,15 @@
return $OCF_SUCCESS
}
+basic_deactivate() {
+ do_activate "-an"
+ if [ $? -ne $OCF_SUCCESS ]; then
+ return $OCF_ERR_GENERIC
+ fi
+
+ return $OCF_SUCCESS
+}
+
# TODO:
# How can we accurately check if LVs in the given VG are all active?
#
@@ -915,6 +951,9 @@
4)
tagging_activate
;;
+ 5)
+ basic_activate
+ ;;
*)
ocf_exit_reason "VG [${VG}] is not properly configured in
cluster. It's unsafe!"
exit $OCF_ERR_CONFIGURED
@@ -955,6 +994,9 @@
4)
tagging_deactivate
;;
+ 5)
+ basic_deactivate
+ ;;
*)
ocf_exit_reason "VG [${VG}] is not properly configured in
cluster. It's unsafe!"
exit $OCF_SUCCESS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/resource-agents-4.18.0+git105.9ea1183/heartbeat/Makefile.am
new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/Makefile.am
--- old/resource-agents-4.18.0+git105.9ea1183/heartbeat/Makefile.am
2026-10-01 14:28:46.000000000 +0200
+++ new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/Makefile.am
2026-11-11 08:00:29.000000000 +0100
@@ -276,3 +276,18 @@
clean-local:
rm -rf __pycache__ *.pyc
+
+all-local: valkey
+
+valkey: redis
+ cp -p -f redis valkey
+
+install-data-hook:
+ $(INSTALL) -d -m 755 $(DESTDIR)${OCF_RA_DIR_PREFIX}/heartbeat
+ cp -p -f $(DESTDIR)${OCF_RA_DIR_PREFIX}/heartbeat/redis
$(DESTDIR)${OCF_RA_DIR_PREFIX}/heartbeat/valkey
+
+uninstall-hook:
+ rm -f $(DESTDIR)${OCF_RA_DIR_PREFIX}/heartbeat/valkey
+
+distclean-local:
+ rm -f valkey
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/resource-agents-4.18.0+git105.9ea1183/heartbeat/crypt
new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/crypt
--- old/resource-agents-4.18.0+git105.9ea1183/heartbeat/crypt 2026-10-01
14:28:46.000000000 +0200
+++ new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/crypt 2026-11-11
08:00:29.000000000 +0100
@@ -38,6 +38,7 @@
OCF_RESKEY_crypt_type_default=""
OCF_RESKEY_force_stop_default="false"
OCF_RESKEY_use_clevis_default="false"
+OCF_RESKEY_allow_clone_default="false"
: ${OCF_RESKEY_encrypted_dev=${OCF_RESKEY_encrypted_dev_default}}
: ${OCF_RESKEY_crypt_dev=${OCF_RESKEY_crypt_dev_default}}
@@ -45,6 +46,7 @@
: ${OCF_RESKEY_crypt_type=${OCF_RESKEY_crypt_type_default}}
: ${OCF_RESKEY_force_stop=${OCF_RESKEY_force_stop_default}}
: ${OCF_RESKEY_use_clevis=${OCF_RESKEY_use_clevis_default}}
+: ${OCF_RESKEY_allow_clone=${OCF_RESKEY_allow_clone_default}}
#######################################################################
@@ -134,6 +136,17 @@
<content type="boolean" default="${OCF_RESKEY_use_clevis_default}" />
</parameter>
+<parameter name="allow_clone" unique="0" required="0">
+<longdesc lang="en">
+Allow the resource to run as a clone. dm-crypt is not cluster aware.
+Only clone it when each node opens its own non-shared encrypted device,
+such as a LUKS device underneath DRBD. When cloned, define encrypted_dev
+by device path instead of UUID.
+</longdesc>
+<shortdesc lang="en">allow cloning for non-shared encrypted devices</shortdesc>
+<content type="boolean" default="${OCF_RESKEY_allow_clone_default}" />
+</parameter>
+
</parameters>
<actions>
@@ -162,10 +175,11 @@
crypt_type="${OCF_RESKEY_crypt_type}"
force_stop="${OCF_RESKEY_force_stop}"
use_clevis="${OCF_RESKEY_use_clevis}"
+allow_clone="${OCF_RESKEY_allow_clone}"
crypt_validate_all() {
- if ocf_is_clone; then
- ocf_exit_reason "crypt cannot run as a cloned resource"
+ if ocf_is_clone && ! ocf_is_true "$allow_clone"; then
+ ocf_exit_reason "crypt cannot run as a cloned resource unless
allow_clone is set"
return $OCF_ERR_CONFIGURED
fi
if ! have_binary cryptsetup; then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/resource-agents-4.18.0+git105.9ea1183/heartbeat/gcp-pd-move.in
new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/gcp-pd-move.in
--- old/resource-agents-4.18.0+git105.9ea1183/heartbeat/gcp-pd-move.in
2026-10-01 14:28:46.000000000 +0200
+++ new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/gcp-pd-move.in
2026-11-11 08:00:29.000000000 +0100
@@ -50,7 +50,6 @@
PROJECT = None
ZONE = None
REGION = None
-LIST_DISK_ATTACHED_INSTANCES = None
INSTANCE_NAME = None
PARAMETERS = {
@@ -60,12 +59,18 @@
'mode': "READ_WRITE",
'device_name': '',
'stackdriver_logging': 'no',
+ 'api_retries': '3',
}
MANDATORY_PARAMETERS = ['disk_name', 'disk_scope']
METADATA_SERVER = 'http://metadata.google.internal/computeMetadata/v1/'
METADATA_HEADERS = {'Metadata-Flavor': 'Google'}
+METADATA_TIMEOUT_SECS = 5
+MAX_RETRIES = 3
+RETRY_BACKOFF_SECS = 1
+# How long start waits for an attached disk to show up in the metadata server.
+METADATA_ATTACH_WAIT_SECS = 60
METADATA = '''<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="gcp-pd-move" version="1.0">
@@ -102,23 +107,32 @@
<parameter name="device_name">
<longdesc lang="en">An optional name that indicates the disk name the guest
operating system will see.</longdesc>
<shortdesc lang="en">Optional device name</shortdesc>
-<content type="boolean" default="{}" />
+<content type="string" default="{}" />
</parameter>
<parameter name="stackdriver_logging">
<longdesc lang="en">Use stackdriver_logging output to global resource (yes,
true, enabled)</longdesc>
<shortdesc lang="en">Use stackdriver_logging</shortdesc>
<content type="string" default="{}" />
</parameter>
+<parameter name="api_retries">
+<longdesc lang="en">
+Number of times a failed Compute Engine API request is retried, with
+exponential backoff, on transient errors (HTTP 429 and 5xx).
+</longdesc>
+<shortdesc lang="en">Compute Engine API retries</shortdesc>
+<content type="integer" default="{}" />
+</parameter>
</parameters>
<actions>
<action name="start" timeout="300s" />
-<action name="stop" timeout="15s" />
-<action name="monitor" timeout="15s" interval="10s" depth="0" />
+<action name="stop" timeout="120s" />
+<action name="monitor" timeout="60s" interval="60s" depth="0" />
<action name="meta-data" timeout="5s" />
+<action name="validate-all" timeout="15s" />
</actions>
</resource-agent>'''.format(PARAMETERS['disk_name'], PARAMETERS['disk_scope'],
PARAMETERS['disk_csek_file'], PARAMETERS['mode'], PARAMETERS['device_name'],
- PARAMETERS['stackdriver_logging'])
+ PARAMETERS['stackdriver_logging'], PARAMETERS['api_retries'])
def get_metadata(metadata_key, params=None, timeout=None):
@@ -133,56 +147,102 @@
HTTP response from the GET request.
Raises:
- urlerror.HTTPError: raises when the GET request fails.
+ Exception: the last error, when all MAX_RETRIES attempts failed.
"""
- timeout = timeout or 60
+ timeout = timeout or METADATA_TIMEOUT_SECS
metadata_url = os.path.join(METADATA_SERVER, metadata_key)
params = urlparse.urlencode(params or {})
url = '%s?%s' % (metadata_url, params)
- request = urlrequest.Request(url, headers=METADATA_HEADERS)
- request_opener = urlrequest.build_opener(urlrequest.ProxyHandler({}))
- return request_opener.open(request, timeout=timeout *
1.1).read().decode("utf-8")
+ last_error = None
+ for attempt in range(MAX_RETRIES):
+ try:
+ request = urlrequest.Request(url, headers=METADATA_HEADERS)
+ request_opener = urlrequest.build_opener(urlrequest.ProxyHandler({}))
+ return request_opener.open(
+ request, timeout=timeout * 1.1).read().decode("utf-8")
+ except Exception as e:
+ last_error = e
+ logger.warning('Metadata server request for %s failed (attempt %d/%d):
%s'
+ % (metadata_key, attempt + 1, MAX_RETRIES, e))
+ if attempt < MAX_RETRIES - 1:
+ time.sleep(RETRY_BACKOFF_SECS * (attempt + 1))
+ else:
+ break
+ raise last_error
-def populate_vars():
+def get_conn():
+ """Returns a Compute Engine API client, creating it on first use."""
global CONN
- global INSTANCE_NAME
- global PROJECT
- global ZONE
- global REGION
- global LIST_DISK_ATTACHED_INSTANCES
+ if CONN is not None:
+ return CONN
+ last_error = None
+ for attempt in range(MAX_RETRIES):
+ try:
+ CONN = googleapiclient.discovery.build(
+ 'compute', 'v1', cache_discovery=False)
+ return CONN
+ except Exception as e:
+ last_error = e
+ logger.warning('Couldn\'t connect with google api (attempt %d/%d): %s'
+ % (attempt + 1, MAX_RETRIES, e))
+ if attempt < MAX_RETRIES - 1:
+ time.sleep(RETRY_BACKOFF_SECS * (attempt + 1))
+ else:
+ break
+ raise last_error
- # Populate global vars
+
+def get_api_retries():
try:
- CONN = googleapiclient.discovery.build('compute', 'v1')
- except Exception as e:
- logger.error('Couldn\'t connect with google api: ' + str(e))
- sys.exit(ocf.OCF_ERR_GENERIC)
+ return max(0, int(PARAMETERS['api_retries']))
+ except (TypeError, ValueError):
+ logger.warning('Invalid api_retries value %r, using 3'
+ % PARAMETERS['api_retries'])
+ return 3
+
+
+def execute(request):
+ """Executes an API request, retrying transient (429/5xx) errors.
+ googleapiclient retries HTTP 429 and 5xx responses and connection errors
+ with randomized exponential backoff when num_retries > 0.
+ """
+ return request.execute(num_retries=get_api_retries())
+
+
+def load_parameters():
for param in PARAMETERS:
value = os.environ.get('OCF_RESKEY_%s' % param, PARAMETERS[param])
if not value and param in MANDATORY_PARAMETERS:
- logger.error('Missing %s mandatory parameter' % param)
+ ocf.ocf_exit_reason('Missing %s mandatory parameter' % param)
sys.exit(ocf.OCF_ERR_CONFIGURED)
elif value:
PARAMETERS[param] = value
+
+def populate_vars():
+ global INSTANCE_NAME
+ global PROJECT
+ global ZONE
+ global REGION
+
+ # Populate global vars
+ load_parameters()
try:
INSTANCE_NAME = get_metadata('instance/name')
+ PROJECT = get_metadata('project/project-id')
+ if PARAMETERS['disk_scope'] in ['detect', 'regional']:
+ ZONE = get_metadata('instance/zone').split('/')[-1]
+ REGION = ZONE[:-2]
+ else:
+ ZONE = PARAMETERS['disk_scope']
except Exception as e:
- logger.error(
- 'Couldn\'t get instance name, is this running inside GCE?: ' + str(e))
+ ocf.ocf_exit_reason(
+ 'Couldn\'t query the metadata server, is this running inside GCE?: '
+ + str(e))
sys.exit(ocf.OCF_ERR_GENERIC)
- PROJECT = get_metadata('project/project-id')
- if PARAMETERS['disk_scope'] in ['detect', 'regional']:
- ZONE = get_metadata('instance/zone').split('/')[-1]
- REGION = ZONE[:-2]
- else:
- ZONE = PARAMETERS['disk_scope']
- LIST_DISK_ATTACHED_INSTANCES = get_disk_attached_instances(
- PARAMETERS['disk_name'])
-
def configure_logs():
# Prepare logging
@@ -198,7 +258,7 @@
handler = google.cloud.logging.handlers.CloudLoggingHandler(
client, name=INSTANCE_NAME)
handler.setLevel(logging.INFO)
- formatter = logging.Formatter('gcp:alias "%(message)s"')
+ formatter = logging.Formatter('gcp:pd-move "%(message)s"')
handler.setFormatter(formatter)
ocf.log.addHandler(handler)
logger = logging.LoggerAdapter(
@@ -210,10 +270,10 @@
def wait_for_operation(operation):
while True:
- result = CONN.zoneOperations().get(
+ result = execute(get_conn().zoneOperations().get(
project=PROJECT,
zone=ZONE,
- operation=operation['name']).execute()
+ operation=operation['name']))
if result['status'] == 'DONE':
if 'error' in result:
@@ -223,28 +283,110 @@
def get_disk_attached_instances(disk):
- def get_users_list():
- fl = 'name="%s"' % disk
- request = CONN.disks().aggregatedList(project=PROJECT, filter=fl)
- while request is not None:
- response = request.execute()
- locations = response.get('items', {})
- for location in locations.values():
- for d in location.get('disks', []):
- if d['name'] == disk:
- return d.get('users', [])
- request = CONN.instances().aggregatedList_next(
- previous_request=request, previous_response=response)
- raise Exception("Unable to find disk %s" % disk)
+ """Returns the names of the instances the disk is attached to.
+
+ Uses a scoped regionDisks.get / disks.get request. A project-wide
+ disks.aggregatedList is only used for disk_scope=detect.
+ """
+ scope = PARAMETERS['disk_scope']
+ if scope == 'regional':
+ users = execute(get_conn().regionDisks().get(
+ project=PROJECT, region=REGION, disk=disk)).get('users', [])
+ elif scope != 'detect':
+ users = execute(get_conn().disks().get(
+ project=PROJECT, zone=ZONE, disk=disk)).get('users', [])
+ else:
+ users = get_disk_users_aggregated(disk)
+ return [re.sub('.*/instances/', '', user) for user in users]
- def get_only_instance_name(user):
- return re.sub('.*/instances/', '', user)
- return map(get_only_instance_name, get_users_list())
+def get_disk_users_aggregated(disk):
+ # returnPartialSuccess prevents an outage in an unrelated zone or region
+ # from failing the whole project-wide request.
+ fl = 'name="%s"' % disk
+ try:
+ request = get_conn().disks().aggregatedList(
+ project=PROJECT, filter=fl, returnPartialSuccess=True)
+ except TypeError:
+ # Older discovery documents do not know returnPartialSuccess.
+ request = get_conn().disks().aggregatedList(project=PROJECT, filter=fl)
+ while request is not None:
+ response = execute(request)
+ locations = response.get('items', {})
+ for location in locations.values():
+ for d in location.get('disks', []):
+ if d['name'] == disk:
+ return d.get('users', [])
+ request = get_conn().disks().aggregatedList_next(
+ previous_request=request, previous_response=response)
+ raise Exception("Unable to find disk %s" % disk)
+
+
+def get_attached_device_name(instance, disk_name):
+ """Returns the deviceName of disk_name on instance, or None if not attached.
+
+ Uses a single instances.get request scoped to the instance's zone. Instances
+ are always zonal resources, so no regional variant is needed, even for
+ regional disks.
+ """
+ request = get_conn().instances().get(
+ project=PROJECT, zone=ZONE, instance=instance)
+ response = execute(request)
+ for disk in response.get('disks', []):
+ if disk_name == re.sub('.*disks/', "", disk.get('source', '')):
+ return disk['deviceName']
+ return None
+
+
+def get_local_device_names():
+ """Returns the deviceNames of the disks attached to this instance.
+
+ Reads the local metadata server; does not use the Compute Engine API.
+ """
+ disks = json.loads(get_metadata('instance/disks/', {'recursive': 'true'}))
+ return [d.get('deviceName') for d in disks]
-def is_disk_attached(instance):
- return instance in LIST_DISK_ATTACHED_INSTANCES
+def device_name_cache_file():
+ rsctmp = os.environ.get('HA_RSCTMP', '@HA_RSCTMPDIR@')
+ return os.path.join(
+ rsctmp, 'gcp-pd-move-%s.device_name' % PARAMETERS['disk_name'])
+
+
+def read_cached_device_name():
+ try:
+ with open(device_name_cache_file()) as f:
+ return f.read().strip() or None
+ except (IOError, OSError):
+ return None
+
+
+def write_cached_device_name(device_name):
+ try:
+ with open(device_name_cache_file(), 'w') as f:
+ f.write(device_name)
+ except (IOError, OSError) as e:
+ logger.warning('Couldn\'t cache device name in %s: %s'
+ % (device_name_cache_file(), e))
+
+
+def clear_cached_device_name():
+ try:
+ os.remove(device_name_cache_file())
+ except (IOError, OSError):
+ pass
+
+
+def wait_for_local_device(device_name):
+ """Waits until the metadata server lists device_name on this instance."""
+ deadline = time.time() + METADATA_ATTACH_WAIT_SECS
+ while device_name not in get_local_device_names():
+ if time.time() >= deadline:
+ raise Exception('Disk %s (device %s) is attached but not visible in the '
+ 'metadata server after %ds' % (
+ PARAMETERS['disk_name'], device_name,
+ METADATA_ATTACH_WAIT_SECS))
+ time.sleep(1)
def detach_disk(instance, disk_name):
@@ -252,29 +394,20 @@
# Detaching a disk is only possible by using deviceName, which is retrieved
# as a disk parameter when listing the instance information
- request = CONN.instances().get(
- project=PROJECT, zone=ZONE, instance=instance)
- response = request.execute()
-
- device_name = None
- for disk in response['disks']:
- if disk_name == re.sub('.*disks/',"",disk['source']):
- device_name = disk['deviceName']
- break
-
+ device_name = get_attached_device_name(instance, disk_name)
if not device_name:
- logger.error("Didn't find %(d)s deviceName attached to %(i)s" % {
+ logger.info("Disk %(d)s is not attached to %(i)s" % {
'd': disk_name,
'i': instance,
})
return
- request = CONN.instances().detachDisk(
+ request = get_conn().instances().detachDisk(
project=PROJECT, zone=ZONE, instance=instance, deviceName=device_name)
- wait_for_operation(request.execute())
+ wait_for_operation(execute(request))
-def attach_disk(instance, disk_name):
+def attach_disk(instance, disk_name, other_instances=()):
location = 'zones/%s' % ZONE
if PARAMETERS['disk_scope'] == 'regional':
location = 'regions/%s' % REGION
@@ -308,17 +441,17 @@
force_attach = True
else:
# If this disk is attached to some instance, detach it first.
- for other_instance in LIST_DISK_ATTACHED_INSTANCES:
+ for other_instance in other_instances:
logger.info("Detaching disk %(disk_name)s from other instance %(i)s" % {
'disk_name': PARAMETERS['disk_name'],
'i': other_instance,
})
detach_disk(other_instance, PARAMETERS['disk_name'])
- request = CONN.instances().attachDisk(
+ request = get_conn().instances().attachDisk(
project=PROJECT, zone=ZONE, instance=instance, body=body,
forceAttach=force_attach)
- wait_for_operation(request.execute())
+ wait_for_operation(execute(request))
def fetch_data():
@@ -328,33 +461,99 @@
def gcp_pd_move_start():
fetch_data()
- if not is_disk_attached(INSTANCE_NAME):
+ disk_name = PARAMETERS['disk_name']
+ device_name = get_attached_device_name(INSTANCE_NAME, disk_name)
+ if not device_name:
+ other_instances = []
+ if PARAMETERS['disk_scope'] != 'regional':
+ # Zonal disks must be detached from other instances first. Regional
+ # disks are force-attached instead.
+ other_instances = [i for i in get_disk_attached_instances(disk_name)
+ if i != INSTANCE_NAME]
logger.info("Attaching disk %(disk_name)s to %(instance)s" % {
- 'disk_name': PARAMETERS['disk_name'],
+ 'disk_name': disk_name,
'instance': INSTANCE_NAME,
})
- attach_disk(INSTANCE_NAME, PARAMETERS['disk_name'])
+ attach_disk(INSTANCE_NAME, disk_name, other_instances)
+ device_name = get_attached_device_name(INSTANCE_NAME, disk_name)
+ if not device_name:
+ raise Exception('Disk %s is not attached to %s after attachDisk '
+ 'completed' % (disk_name, INSTANCE_NAME))
+
+ # monitor uses the cached device name to check the attachment through the
+ # local metadata server, without calling the Compute Engine API.
+ write_cached_device_name(device_name)
+ wait_for_local_device(device_name)
def gcp_pd_move_stop():
fetch_data()
- if is_disk_attached(INSTANCE_NAME):
- logger.info("Detaching disk %(disk_name)s to %(instance)s" % {
- 'disk_name': PARAMETERS['disk_name'],
- 'instance': INSTANCE_NAME,
- })
- detach_disk(INSTANCE_NAME, PARAMETERS['disk_name'])
+ logger.info("Detaching disk %(disk_name)s from %(instance)s" % {
+ 'disk_name': PARAMETERS['disk_name'],
+ 'instance': INSTANCE_NAME,
+ })
+ detach_disk(INSTANCE_NAME, PARAMETERS['disk_name'])
+ clear_cached_device_name()
def gcp_pd_move_status():
- fetch_data()
- if is_disk_attached(INSTANCE_NAME):
- logger.debug("Disk %(disk_name)s is correctly attached to %(instance)s" % {
- 'disk_name': PARAMETERS['disk_name'],
- 'instance': INSTANCE_NAME,
+ configure_logs()
+ load_parameters()
+ disk_name = PARAMETERS['disk_name']
+
+ # Fast path: check the local metadata server only. This is the normal case
+ # for a running resource and does not depend on the Compute Engine API, so
+ # API latency or errors cannot fail the monitor.
+ device_name = read_cached_device_name() or PARAMETERS['device_name']
+ if device_name and device_name in get_local_device_names():
+ logger.debug("Disk %(disk_name)s is attached as %(device)s" % {
+ 'disk_name': disk_name,
+ 'device': device_name,
})
- else:
+ return
+
+ # Slow path: no known device name (probe, or first monitor after an
+ # upgrade), or the device is not visible locally. Ask the API once.
+ populate_vars()
+ device_name = get_attached_device_name(INSTANCE_NAME, disk_name)
+ if not device_name:
+ clear_cached_device_name()
sys.exit(ocf.OCF_NOT_RUNNING)
+ write_cached_device_name(device_name)
+ logger.debug("Disk %(disk_name)s is correctly attached to %(instance)s" % {
+ 'disk_name': disk_name,
+ 'instance': INSTANCE_NAME,
+ })
+
+
+def gcp_pd_move_validate():
+ configure_logs()
+ load_parameters()
+ if 'googleapiclient.discovery' not in sys.modules:
+ ocf.ocf_exit_reason('Couldn\'t import googleapiclient, is '
+ 'google-api-python-client installed?')
+ sys.exit(ocf.OCF_ERR_INSTALLED)
+ scope = PARAMETERS['disk_scope']
+ if scope not in ('detect', 'regional') and not re.match(
+ r'^[a-z]+-[a-z]+[0-9]+-[a-z]$', scope):
+ ocf.ocf_exit_reason(
+ 'Invalid disk_scope %r: use detect, regional or a zone name' % scope)
+ sys.exit(ocf.OCF_ERR_CONFIGURED)
+ if PARAMETERS['mode'] not in ('READ_WRITE', 'READ_ONLY'):
+ ocf.ocf_exit_reason('Invalid mode %r: use READ_WRITE or READ_ONLY'
+ % PARAMETERS['mode'])
+ sys.exit(ocf.OCF_ERR_CONFIGURED)
+ try:
+ if int(PARAMETERS['api_retries']) < 0:
+ raise ValueError()
+ except ValueError:
+ ocf.ocf_exit_reason('Invalid api_retries %r: use a non-negative integer'
+ % PARAMETERS['api_retries'])
+ sys.exit(ocf.OCF_ERR_CONFIGURED)
+ csek_file = PARAMETERS['disk_csek_file']
+ if csek_file and not os.access(csek_file, os.R_OK):
+ ocf.ocf_exit_reason('Couldn\'t read disk_csek_file %s' % csek_file)
+ sys.exit(ocf.OCF_ERR_CONFIGURED)
def main():
@@ -363,19 +562,30 @@
return
command = sys.argv[1]
- if 'meta-data' in command:
+ if command == 'meta-data':
print(METADATA)
return
- if command in 'start':
- gcp_pd_move_start()
- elif command in 'stop':
- gcp_pd_move_stop()
- elif command in ('monitor', 'status'):
- gcp_pd_move_status()
- else:
+ actions = {
+ 'start': gcp_pd_move_start,
+ 'stop': gcp_pd_move_stop,
+ 'monitor': gcp_pd_move_status,
+ 'status': gcp_pd_move_status,
+ 'validate-all': gcp_pd_move_validate,
+ }
+ if command not in actions:
configure_logs()
- logger.error('no such function %s' % str(command))
+ ocf.ocf_exit_reason('no such function %s' % str(command))
+ sys.exit(ocf.OCF_ERR_UNIMPLEMENTED)
+
+ try:
+ actions[command]()
+ except Exception as e:
+ # API and metadata errors that survive retries are reported as a generic
+ # (recoverable) error, never as OCF_ERR_CONFIGURED, so that Pacemaker
+ # recovers the resource instead of treating it as permanently failed.
+ ocf.ocf_exit_reason('%s failed: %s' % (command, e))
+ sys.exit(ocf.OCF_ERR_GENERIC)
if __name__ == "__main__":
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/resource-agents-4.18.0+git105.9ea1183/heartbeat/podman-etcd
new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/podman-etcd
--- old/resource-agents-4.18.0+git105.9ea1183/heartbeat/podman-etcd
2026-10-01 14:28:46.000000000 +0200
+++ new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/podman-etcd
2026-11-11 08:00:29.000000000 +0100
@@ -1173,21 +1173,121 @@
return $OCF_ERR_GENERIC
}
-set_force_new_cluster()
+# Claim force_new_cluster for this node. The value is the claim time
+# (epoch seconds), the same scheme as member_removal_lock.
+#
+# Pre-check: if we already hold the claim this is a no-op; if the peer
+# holds it we can't win, so return 2 without writing.
+# Post-check: after writing, let the CIB settle and re-read. If the peer
+# also claimed and wins (fnc_conflict_verdict), withdraw our claim and
+# return 2. If the claims can't be read, withdraw and return 1.
+#
+# The post-set guard in podman_start still refuses to proceed while two
+# claims exist, for the case where the peer's write is slower to
+# propagate than the settle time.
+#
+# Return codes:
+# 0 - we hold force_new_cluster
+# 1 - crm/CIB error (caller: soft-fail)
+# 2 - the peer holds force_new_cluster (caller: defer/yield)
+try_set_force_new_cluster()
{
- local rc
+ local rc fnc_holders holder claim_epoch fnc_verdict
+
+ if ! fnc_holders=$(get_force_new_cluster); then
+ ocf_log err "could not query force_new_cluster holders before
setting"
+ return 1
+ fi
+
+ for holder in $fnc_holders; do
+ if [ "$holder" != "$NODENAME" ]; then
+ ocf_log info "force_new_cluster already held by
${fnc_holders% }: not setting"
+ return 2
+ fi
+ done
+
+ if [ -n "$fnc_holders" ]; then
+ ocf_log info "$NODENAME already holds force_new_cluster"
+ return 0
+ fi
if [ -n "$OCF_RESKEY_test_race_delay" ]; then
- ocf_log notice "TEST: race delay ${OCF_RESKEY_test_race_delay}s
before force_new_cluster write"
+ ocf_log notice "TEST: race delay ${OCF_RESKEY_test_race_delay}s
between force_new_cluster pre-check and write"
sleep "$OCF_RESKEY_test_race_delay"
fi
- crm_attribute --lifetime reboot --node "$NODENAME" --name
"force_new_cluster" --update "$NODENAME"
+ claim_epoch=$(date +%s)
+ crm_attribute --lifetime reboot --node "$NODENAME" --name
"force_new_cluster" --update "$claim_epoch"
rc=$?
if [ $rc -ne 0 ]; then
- ocf_log err "could not set force_new_cluster attribute to
$NODENAME"
+ ocf_log err "could not set force_new_cluster attribute on
$NODENAME"
+ return 1
+ fi
+ ocf_log info "$NODENAME: force_new_cluster claimed at $claim_epoch"
+
+ # Post-check: did the peer claim at the same time?
+ sleep "$FNC_CLAIM_SETTLE_SEC"
+ if ! fnc_holders=$(get_force_new_cluster); then
+ ocf_log err "could not re-read force_new_cluster holders after
claiming: withdrawing our claim"
+ fnc_withdraw_claim
+ return 1
+ fi
+ if ! echo "$fnc_holders" | grep -q -w "$NODENAME"; then
+ # Our write isn't visible yet. If the peer's claim is, we can't
+ # show ours is earlier: withdraw (in case ours lands later) and
+ # defer. If nothing is visible, the post-set guard waits for it.
+ if [ -n "$(echo "$fnc_holders" | tr -d ' ')" ]; then
+ ocf_log notice "own force_new_cluster claim not visible
after ${FNC_CLAIM_SETTLE_SEC}s but $fnc_holders holds one: withdrawing and
deferring"
+ fnc_withdraw_claim
+ return 2
+ fi
+ return 0
+ fi
+ if [ "$(echo "$fnc_holders" | wc -w)" -le 1 ]; then
+ return 0
+ fi
+ fnc_verdict=$(fnc_conflict_verdict)
+ case "$fnc_verdict" in
+ "$NODENAME")
+ ocf_log notice "force_new_cluster claimed by both nodes
($fnc_holders): $NODENAME wins, keeping claim"
+ return 0
+ ;;
+ EQUAL)
+ # Same revision and cluster_id: nobody needs force_new_cluster.
+ # Both sides withdraw; the next start takes the normal path.
+ ocf_log notice "force_new_cluster claimed by both nodes
($fnc_holders) with equal revision and cluster_id: withdrawing our claim"
+ fnc_withdraw_claim
+ return 2
+ ;;
+ ADMIN)
+ ocf_log err "force_new_cluster claimed by both nodes
($fnc_holders) and no data to decide safely: withdrawing our claim"
+ fnc_withdraw_claim
+ return 1
+ ;;
+ *)
+ ocf_log notice "force_new_cluster claimed by both nodes
($fnc_holders): peer wins, withdrawing our claim"
+ fnc_withdraw_claim
+ return 2
+ ;;
+ esac
+}
+
+# Delete our own force_new_cluster claim. Unlike clear_force_new_cluster
+# this doesn't query holders first, so it also works after a CIB read
+# error; deleting an absent attribute is harmless.
+fnc_withdraw_claim()
+{
+ if ! crm_attribute --delete --lifetime reboot --node "$NODENAME" --name
"force_new_cluster"; then
+ ocf_log err "could not withdraw force_new_cluster claim of
$NODENAME"
fi
- return $rc
+}
+
+# Echo the force_new_cluster claim of node $1: epoch seconds, or a legacy
+# node-name value written by an older writer. Empty when unset; non-zero
+# return only on a CIB read error.
+get_fnc_claim()
+{
+ get_cib_transient_attribute "$1" "force_new_cluster"
}
# get_force_new_cluster returns a space-separated list of nodes that have the
force_new_cluster attribute set.
@@ -1346,9 +1446,18 @@
# both clear their claim and start normally
# ADMIN - no data to decide safely: never guess, soft-fail
# with recovery guidance
-# All inputs read from CIB (symmetric); each node wrote revision and
-# cluster_id before setting FNC, so both are visible wherever both
-# FNC attributes are.
+# Eligibility comes first (member_removal_lock: a node that left the
+# member list is never a safe seed), then claim time: the earlier claim
+# wins. When claim time isn't definitive (a claim that isn't a timestamp,
+# written by an older agent or an older CEO, or both claimed in the same
+# second), fall back to the revision comparison older agents use, so
+# both sides agree.
+# All inputs are read from CIB, so both nodes reach the same verdict.
+#
+# The verdict only decides who yields. It never lets a node proceed while
+# the peer's claim still exists: the post-set guard enforces that via CIB
+# ordering, so wall-clock skew between the nodes cannot cause two
+# force-new-clusters, only an extra retry before the loser yields.
fnc_conflict_verdict()
{
local local_rev peer_rev peer_node_name
@@ -1379,8 +1488,40 @@
echo "$NODENAME"
return
fi
- # Both hold lock or neither — fall through to revision comparison
+ # Both hold lock or neither — fall through to claim time
+ local local_claim peer_claim
+ if ! local_claim=$(get_fnc_claim "$NODENAME") || \
+ ! peer_claim=$(get_fnc_claim "$peer_node_name"); then
+ ocf_log err "fnc_conflict_verdict: could not read
force_new_cluster claims (CIB error)"
+ echo "ADMIN"
+ return
+ fi
+ ocf_log info "FNC conflict claims: $NODENAME=$local_claim
$peer_node_name=$peer_claim"
+
+ # A claim cleared since the holder list was read (e.g. the peer already
+ # yielded) leaves a single holder: it wins.
+ if [ -z "$peer_claim" ]; then
+ echo "$NODENAME"
+ return
+ elif [ -z "$local_claim" ]; then
+ echo "$peer_node_name"
+ return
+ fi
+
+ # Claim time decides when both claims are timestamps from different
+ # seconds.
+ if ocf_is_decimal "$local_claim" && ocf_is_decimal "$peer_claim" && \
+ [ "$local_claim" -ne "$peer_claim" ]; then
+ if [ "$local_claim" -lt "$peer_claim" ]; then
+ echo "$NODENAME"
+ else
+ echo "$peer_node_name"
+ fi
+ return
+ fi
+
+ # Claim time isn't definitive: fall back to the revision comparison.
local_rev=$(get_cib_permanent_attribute "$NODENAME" "revision")
peer_rev=$(get_cib_permanent_attribute "$peer_node_name" "revision")
ocf_log info "FNC conflict inputs: $NODENAME=$local_rev
$peer_node_name=$peer_rev"
@@ -1754,9 +1895,30 @@
ocf_log info "one endpoint only: checking status errors"
endpoint_status_errors=$(printf "%s" "$endpoint_status_json" |
jq -r ".[0].Status.errors")
if echo "$endpoint_status_errors" | grep -q "no leader"; then
- set_force_new_cluster
- set_standalone_node
- ocf_exit_reason "$NODENAME must force a new cluster"
+ # The claim adds a few CIB queries and a short settle
wait
+ # (FNC_CLAIM_SETTLE_SEC) on an already-failing path.
+ try_set_force_new_cluster
+ case $? in
+ 0)
+ set_standalone_node
+ ocf_exit_reason "$NODENAME must force a new
cluster"
+ ;;
+ 2)
+ # Peer already claimed recovery: do NOT assert
standalone.
+ # The restart triggered below lands in
podman_start, which
+ # sees the peer's FNC and joins as learner.
+ # If the holder crashed after claiming, its
reboot-lifetime
+ # attribute persists until pacemaker registers
membership
+ # loss; we defer to a stale claim during that
window.
+ # Bounded by fencing timeout — same exposure as
the
+ # single-holder early-learner path.
+ ocf_log notice "leadership lost but peer
already holds force_new_cluster: deferring to peer"
+ ocf_exit_reason "$NODENAME deferring recovery
to force_new_cluster holder"
+ ;;
+ *)
+ ocf_exit_reason "could not set or verify
force_new_cluster during leadership-loss recovery"
+ ;;
+ esac
return $OCF_ERR_GENERIC
fi
if [ "$endpoint_status_errors" != "null" ]; then
@@ -2590,7 +2752,22 @@
elif [ -n "$peer_removal_lock" ]; then
ocf_log notice "member_removal_lock held by peer
$startup_peer_node (epoch=$peer_removal_lock): we are the surviving voter -
forcing new cluster to seed"
if ! is_force_new_cluster; then
- if ! set_force_new_cluster; then
+ try_set_force_new_cluster
+ rc=$?
+ if [ $rc -eq 2 ]; then
+ # The peer's member_removal_lock proves
it left the member
+ # list, and its own start routes it to
learner, so its
+ # force_new_cluster claim is stale:
clear it and claim.
+ ocf_log notice "peer $startup_peer_node
holds a stale force_new_cluster claim despite having departed via
member_removal_lock: clearing it"
+ if ! crm_attribute --delete --lifetime
reboot --node "$startup_peer_node" --name "force_new_cluster"; then
+ ocf_exit_reason "$NODENAME:
could not clear stale force_new_cluster claim of departed peer
$startup_peer_node"
+ return "$OCF_ERR_GENERIC"
+ fi
+ try_set_force_new_cluster
+ rc=$?
+ fi
+ if [ $rc -ne 0 ]; then
+ ocf_exit_reason "$NODENAME: could not
set force_new_cluster to seed cluster"
return "$OCF_ERR_GENERIC"
fi
fi
@@ -2631,7 +2808,7 @@
# neither starting nor active (per this
transition's fresh
# notify vars) and has no in-flight
start in the CIB, its
# agent will never yield - a banned
peer's reboot-lifetime
- # attribute persists until membership
loss. The data-backed
+ # attribute persists until membership
loss. The verdict
# winner clears it; winner-only
deletion cannot double-fire.
local fnc_peer fnc_start_total
fnc_active_total
fnc_peer=$(get_peer_node_name)
@@ -2659,8 +2836,8 @@
return "$OCF_ERR_GENERIC"
;;
*)
- # Verdict named the peer: it has the
newer data.
- # Yield our claim and rejoin as learner.
+ # Verdict named the peer: it claimed
first or
+ # has the newer data. Yield and rejoin
as learner.
fnc_yield
;;
esac
@@ -2753,9 +2930,18 @@
# If our revision is the same
as or newer than the peer's last saved
# revision, and the peer agent
isn't currently starting, we can
# restore e-quorum by forcing a
new cluster.
- if ! set_force_new_cluster; then
+ try_set_force_new_cluster
+ case $? in
+ 0) ;;
+ 2)
+ ocf_log notice "peer
claimed force_new_cluster first: joining as learner"
+ JOIN_AS_LEARNER=true
+ ;;
+ *)
+ ocf_exit_reason
"$NODENAME: could not set or verify force_new_cluster attribute"
return
"$OCF_ERR_GENERIC"
- fi
+ ;;
+ esac
else
ocf_log err "local revision is
older and peer is not starting: cannot start"
ocf_exit_reason "local revision
is older and peer is not starting: cannot start"
@@ -2766,9 +2952,23 @@
# TODO: can we start "normally",
regardless the revisions, if the container-id is the same on both nodes?
ocf_log info "peer starting"
if [ "$revision_compare_result" =
"newer" ]; then
- if ! set_force_new_cluster; then
+ try_set_force_new_cluster
+ case $? in
+ 0) ;;
+ 2)
+ # Peer claimed first
despite our "newer"
+ # revision comparison.
Deferring matches the
+ # dual-claim rule
(earlier claim wins; see
+ #
fnc_conflict_verdict), so contesting would
+ # only cost a retry
before we yield anyway.
+ ocf_log notice "peer
claimed force_new_cluster first: joining as learner"
+ JOIN_AS_LEARNER=true
+ ;;
+ *)
+ ocf_exit_reason
"$NODENAME: could not set or verify force_new_cluster attribute"
return
"$OCF_ERR_GENERIC"
- fi
+ ;;
+ esac
elif [ "$revision_compare_result" =
"older" ]; then
ocf_log info "$NODENAME shall
join as learner"
JOIN_AS_LEARNER=true
@@ -3470,6 +3670,7 @@
# This is intentional - reboots are controlled stops, not failures requiring
detection.
CONTAINER_HEARTBEAT_FILE=${HA_RSCTMP}/podman-container-last-running
DELAY_SECOND_NODE_LEAVE_SEC=10
+FNC_CLAIM_SETTLE_SEC=2
# Shorter etcdctl command-timeout for monitor-path calls to prevent
# consuming the 25s monitor budget. Non-monitor callers use the default 5s.
MONITOR_ETCDCTL_TIMEOUT="3s"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/resource-agents-4.18.0+git105.9ea1183/heartbeat/redis.in
new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/redis.in
--- old/resource-agents-4.18.0+git105.9ea1183/heartbeat/redis.in
2026-10-01 14:28:46.000000000 +0200
+++ new/resource-agents-4.18.0+git118.8806b1e9/heartbeat/redis.in
2026-11-11 08:00:29.000000000 +0100
@@ -33,17 +33,26 @@
# Parameter defaults
-OCF_RESKEY_bin_default="/usr/bin/redis-server"
-OCF_RESKEY_client_bin_default="/usr/bin/redis-cli"
-if [ -f "/etc/redis.conf" ]; then
- OCF_RESKEY_config_default="/etc/redis.conf"
+OCF_RESKEY_bin_default="/usr/bin/${__SCRIPT_NAME}-server"
+OCF_RESKEY_client_bin_default="/usr/bin/${__SCRIPT_NAME}-cli"
+OCF_RESKEY_user_default="${__SCRIPT_NAME}"
+OCF_RESKEY_rundir_default="/var/run/${__SCRIPT_NAME}"
+OCF_RESKEY_socket_name_default="${__SCRIPT_NAME}.sock"
+
+if [ -f "/etc/${__SCRIPT_NAME}.conf" ]; then
+ OCF_RESKEY_config_default="/etc/${__SCRIPT_NAME}.conf"
+else
+ OCF_RESKEY_config_default="/etc/${__SCRIPT_NAME}/${__SCRIPT_NAME}.conf"
+fi
+
+if [ "$__SCRIPT_NAME" = "valkey" ]; then
+ OCF_RESKEY_pidfile_name_default="valkey.pid"
+ REDIS_CHECK_DUMP="/usr/bin/valkey-check-rdb"
else
- OCF_RESKEY_config_default="/etc/redis/redis.conf"
+ OCF_RESKEY_pidfile_name_default="redis-server.pid"
+ REDIS_CHECK_DUMP="/usr/bin/redis-check-dump"
fi
-OCF_RESKEY_user_default="redis"
-OCF_RESKEY_rundir_default="/var/run/redis"
-OCF_RESKEY_pidfile_name_default="redis-server.pid"
-OCF_RESKEY_socket_name_default="redis.sock"
+
OCF_RESKEY_port_default="6379"
OCF_RESKEY_tunnel_host_default="127.0.0.1"
OCF_RESKEY_tunnel_port_map_default=""
@@ -63,7 +72,6 @@
CHECK_SLAVE_STATE=0
-REDIS_CHECK_DUMP="/usr/bin/redis-check-dump"
REDIS_SERVER="$OCF_RESKEY_bin"
REDIS_CLIENT="$OCF_RESKEY_client_bin"
REDIS_CONFIG="$OCF_RESKEY_config"
@@ -74,63 +82,63 @@
REDIS_REPLICATION_PORT="$OCF_RESKEY_port"
if ! [ -f $REDIS_CHECK_DUMP ]; then
- REDIS_CHECK_DUMP="$(which redis-check-dump 2>/dev/null)"
+ REDIS_CHECK_DUMP="$(which ${__SCRIPT_NAME}-check-dump 2>/dev/null)"
fi
if [ -z "$REDIS_CHECK_DUMP" ]; then
- REDIS_CHECK_DUMP="$(which redis-check-rdb 2>/dev/null)"
+ REDIS_CHECK_DUMP="$(which ${__SCRIPT_NAME}-check-rdb 2>/dev/null)"
fi
if [ -r "$REDIS_CONFIG" ]; then
REDIS_DUMP_DIR="$(grep "^\s*dir\s" < "$REDIS_CONFIG" | awk '{ print $2
}' 2>/dev/null)"
REDIS_DUMP_FILE="$(grep "^\s*dbfilename\s" < "$REDIS_CONFIG" | awk '{
print $2 }' 2>/dev/null)"
fi
-: ${REDIS_DUMP_DIR:=/var/lib/redis/}
+: ${REDIS_DUMP_DIR:=/var/lib/${__SCRIPT_NAME}/}
: ${REDIS_DUMP_FILE:=dump.rdb}
redis_meta_data() {
cat <<EOI
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
-<resource-agent name="redis" version="1.0">
+<resource-agent name="${__SCRIPT_NAME}" version="1.0">
<version>1.0</version>
<longdesc lang="en">
-Resource agent script for redis server.
+Resource agent script for ${__SCRIPT_NAME} server.
-This resource fully supports master/slave replication. The master preference
of a node is determined by the 'slave_priority' parameter of the redis config.
+This resource fully supports master/slave replication. The master preference
of a node is determined by the 'slave_priority' parameter of the
${__SCRIPT_NAME} config.
When taking the resource from 'unmanaged' to 'managed', the currently active
master will be given a priority of 1000 (plus 1 for each active connection).
The default 'slave_priority' is 100, so the master will stay master. For a
slave to become master after converting the resource to managed, set a
slave_priority greater than 1000.
</longdesc>
-<shortdesc lang="en">Redis server</shortdesc>
+<shortdesc lang="en">${__SCRIPT_NAME} server</shortdesc>
<parameters>
<parameter name="bin" unique="0" required="0">
<longdesc lang="en">
-Path to \`redis-server\`
+Path to \`${__SCRIPT_NAME}-server\`
</longdesc>
-<shortdesc lang="en">Path to \`redis-server\`</shortdesc>
+<shortdesc lang="en">Path to \`${__SCRIPT_NAME}-server\`</shortdesc>
<content type="string" default="${OCF_RESKEY_bin_default}" />
</parameter>
<parameter name="client_bin" unique="0" required="0">
<longdesc lang="en">
-Path to \`redis-cli\`
+Path to \`${__SCRIPT_NAME}-cli\`
</longdesc>
-<shortdesc lang="en">Path to \`redis-cli\`</shortdesc>
+<shortdesc lang="en">Path to \`${__SCRIPT_NAME}-cli\`</shortdesc>
<content type="string" default="${OCF_RESKEY_client_bin_default}" />
</parameter>
<parameter name="config" unique="1" required="0">
<longdesc lang="en">
-Path to 'redis.conf'
+Path to '${__SCRIPT_NAME}.conf'
</longdesc>
-<shortdesc lang="en">Path to 'redis.conf'</shortdesc>
+<shortdesc lang="en">Path to '${__SCRIPT_NAME}.conf'</shortdesc>
<content type="string" default="${OCF_RESKEY_config_default}" />
</parameter>
<parameter name="user" unique="0" required="0">
<longdesc lang="en">
-User to run redis as
+User to run ${__SCRIPT_NAME} as
</longdesc>
<shortdesc lang="en">Redis user</shortdesc>
<content type="string" default="${OCF_RESKEY_user_default}" />
@@ -140,7 +148,7 @@
<longdesc lang="en">
Directory to store socket and pid file in
</longdesc>
-<shortdesc lang="en">Redis var/run dir</shortdesc>
+<shortdesc lang="en">${__SCRIPT_NAME} var/run dir</shortdesc>
<content type="string" default="${OCF_RESKEY_rundir_default}"/>
</parameter>
@@ -149,7 +157,7 @@
The filename to use for the pidfile. Will be created in the rundir.
Should only be a basename, not a full path.
</longdesc>
-<shortdesc lang="en">Redis pidfile name</shortdesc>
+<shortdesc lang="en">${__SCRIPT_NAME} pidfile name</shortdesc>
<content type="string" default="${OCF_RESKEY_pidfile_name_default}"/>
</parameter>
@@ -158,7 +166,7 @@
The filename to use for the socket. Will be crated in the rundir.
Should only be a basename, not a full path.
</longdesc>
-<shortdesc lang="en">Redis socket name</shortdesc>
+<shortdesc lang="en">${__SCRIPT_NAME} socket name</shortdesc>
<content type="string" default="${OCF_RESKEY_socket_name_default}"/>
</parameter>
@@ -173,8 +181,8 @@
<parameter name="tunnel_host" unique="0" required="0">
<longdesc lang="en">
When replication traffic is tunnelled, this is the host to target
-to forward outgoing traffic to the redis master. The resource
-agent configures the redis slave to target the master via
+to forward outgoing traffic to the ${__SCRIPT_NAME} master. The resource
+agent configures the ${__SCRIPT_NAME} slave to target the master via
tunnel_host:tunnel_port.
Note that in order to enable replication traffic tunneling,
@@ -186,26 +194,26 @@
<parameter name="tunnel_port_map" unique="0" required="0">
<longdesc lang="en">
-A mapping of pacemaker node names to redis port number.
+A mapping of pacemaker node names to ${__SCRIPT_NAME} port number.
-To be used when redis servers need to tunnel replication traffic.
-On every node where the redis resource is running, the redis server
-listens to a different port. Each redis server can access its peers
+To be used when ${__SCRIPT_NAME} servers need to tunnel replication traffic.
+On every node where the ${__SCRIPT_NAME} resource is running, the
${__SCRIPT_NAME} server
+listens to a different port. Each ${__SCRIPT_NAME} server can access its peers
for replication traffic via a tunnel accessible at {tunnel_host}:port.
The mapping the form of:
-pcmk1-name:port-for-redis1;pcmk2-name:port-for-redis2;pcmk3-name:port-for-redis3
+pcmk1-name:port-for-${__SCRIPT_NAME}1;pcmk2-name:port-for-${__SCRIPT_NAME}2;pcmk3-name:port-for-${__SCRIPT_NAME}3
-where the redis resource started on node pcmk1-name would listen on
-port port-for-redis1
+where the ${__SCRIPT_NAME} resource started on node pcmk1-name would listen on
+port port-for-${__SCRIPT_NAME}1
</longdesc>
-<shortdesc lang="en">Mapping of Redis server name to redis port</shortdesc>
+<shortdesc lang="en">Mapping of ${__SCRIPT_NAME} server name to
${__SCRIPT_NAME} port</shortdesc>
<content type="string" default="${OCF_RESKEY_tunnel_port_map_default}"/>
</parameter>
<parameter name="wait_last_known_master" unique="0" required="0">
<longdesc lang="en">
-During redis cluster bootstrap, wait for the last known master to be
+During ${__SCRIPT_NAME} cluster bootstrap, wait for the last known master to be
promoted before allowing any other instances in the cluster to be
promoted. This lessens the risk of data loss when persistent data
is in use.
@@ -232,7 +240,7 @@
}
INSTANCE_ATTR_NAME=$(echo "${OCF_RESOURCE_INSTANCE}" | awk -F : '{print $1}')
-CRM_ATTR_REPL_INFO="${HA_SBIN_DIR}/crm_attribute --type crm_config --name
${INSTANCE_ATTR_NAME}_REPL_INFO -s redis_replication"
+CRM_ATTR_REPL_INFO="${HA_SBIN_DIR}/crm_attribute --type crm_config --name
${INSTANCE_ATTR_NAME}_REPL_INFO -s ${__SCRIPT_NAME}_replication"
MASTER_HOST=""
MASTER_ACTIVE_CACHED=""
MASTER_ACTIVE=""
@@ -242,8 +250,11 @@
redis_cli_features()
{
-
- CLI_VER=$("$REDIS_CLIENT" -v | awk '{print $NF}')
+ if [ -x "$REDIS_CLIENT" ]; then
+ CLI_VER=$("$REDIS_CLIENT" -v | awk '{print $NF}')
+ else
+ CLI_VER="0.0.0" # So to by-pass build for Valkey
+ fi
# Starting with 4.0.10 there is a warning on stderr when using a pass
# Starting with 5.0.0 there is an argument to silence the warning:
--no-auth-warning
# Starting with 5.0.3 there is an option to use REDISCLI_AUTH
evironment variable for password, no warning in this case
@@ -356,9 +367,9 @@
}
redis_client() {
- ocf_log debug "redis_client: '$REDIS_CLIENT' -s '$REDIS_SOCKET' $*"
+ ocf_log debug "${__SCRIPT_NAME}_client: '$REDIS_CLIENT' -s
'$REDIS_SOCKET' $*"
if [ -n "$clientpasswd" ]; then
- # Consider redis-cli features to choose optimal password
passing method and warning filtering workaround
+ # Consider ${__SCRIPT_NAME}-cli features to choose optimal
password passing method and warning filtering workaround
if [[ CLI_HAVE_ENV_AUTH -eq 1 ]]; then
REDISCLI_AUTH=$clientpasswd "$REDIS_CLIENT" -s
"$REDIS_SOCKET" "$@" | sed 's/\r//'
elif [[ CLI_HAVE_ARG_NO_AUTH_WARNING -eq 1 ]]; then
@@ -383,7 +394,7 @@
pid="$(<"$REDIS_PIDFILE")"
pidof $(basename "$REDIS_SERVER") | grep -q "\<$pid\>" || return
$OCF_NOT_RUNNING
- ocf_log debug "monitor: redis-server running under pid $pid"
+ ocf_log debug "monitor: ${__SCRIPT_NAME}-server running under pid $pid"
return $OCF_SUCCESS
}
@@ -413,7 +424,7 @@
if ocf_is_ms; then
# Here we see if a score has already been set.
- # If score isn't set we the redis setting 'slave_priority'.
+ # If score isn't set we the redis/valkey setting
'slave_priority'.
# If that isn't set, we default to 1000 for a master, and 1 for
slave.
# We then add 1 for each connected client
score="$(crm_master_reboot -G --quiet 2>/dev/null)"
@@ -440,7 +451,7 @@
last_known_master_port=$(redis_node_to_port $(last_known_master))
if [[ "${info[master_host]}" !=
"${OCF_RESKEY_tunnel_host}" ]] ||
[[ "${info[master_port]}" !=
"${last_known_master_port}" ]]; then
- ocf_log err "monitor: Slave
mode current tunnelled connection to redis server does not match running
master. tunnelled='${info[master_host]}:${info[master_port]} (${master_name})',
running='$(last_known_master)'"
+ ocf_log err "monitor: Slave
mode current tunnelled connection to ${__SCRIPT_NAME} server does not match
running master. tunnelled='${info[master_host]}:${info[master_port]}
(${master_name})', running='$(last_known_master)'"
return $OCF_ERR_GENERIC
fi
else
@@ -492,7 +503,7 @@
status=$?
if (( status == OCF_SUCCESS )) || (( status == OCF_RUNNING_MASTER ));
then
- ocf_log info "start: redis is already running"
+ ocf_log info "start: ${__SCRIPT_NAME} is already running"
return $OCF_SUCCESS
fi
@@ -517,7 +528,7 @@
output="$(su "$REDIS_USER" -s /bin/sh -c "cd '$REDIS_RUNDIR'; exec
'$REDIS_SERVER' '$REDIS_CONFIG' --daemonize yes --unixsocket '$REDIS_SOCKET'
--pidfile '$REDIS_PIDFILE'" 2>&1)"
while true; do
- # wait for redis to start
+ # wait for redis/valkey to start
typeset -A info
while read line; do
[[ "$line" == "#"* ]] && continue
@@ -538,7 +549,7 @@
sleep 1
else
check_output="$(check_dump_file)"
- ocf_log err "start: Unknown error waiting for redis to
start. redis-check-dump output=${check_output//$'\n'/; }"
+ ocf_log err "start: Unknown error waiting for
${__SCRIPT_NAME} to start. ${__SCRIPT_NAME}-check-dump
output=${check_output//$'\n'/; }"
return $OCF_ERR_GENERIC
fi
done
@@ -557,7 +568,7 @@
fi
check_output="$(check_dump_file)"
- ocf_log err "start: Unknown error starting redis. redis-server
output=${output//$'\n'/; } redis-check-dump output=${check_output//$'\n'/; }"
+ ocf_log err "start: Unknown error starting ${__SCRIPT_NAME}.
${__SCRIPT_NAME}-server output=${output//$'\n'/; } ${__SCRIPT_NAME}-check-dump
output=${check_output//$'\n'/; }"
return $status
}
@@ -566,7 +577,7 @@
status=$?
if (( status == OCF_NOT_RUNNING )); then
- ocf_log info "stop: redis is already stopped"
+ ocf_log info "stop: ${__SCRIPT_NAME} is already stopped"
crm_master_reboot -D
return $OCF_SUCCESS
fi
@@ -629,7 +640,7 @@
ocf_log info "demote: Already running as slave"
return $OCF_SUCCESS
elif (( status == OCF_NOT_RUNNING )); then
- ocf_log err "demote: Failed to demote, redis not running."
+ ocf_log err "demote: Failed to demote, ${__SCRIPT_NAME} not
running."
return $OCF_NOT_RUNNING
fi
@@ -667,7 +678,7 @@
# Wait forever for the slave to connect to the master and finish the
# sync. Timeout is controlled by Pacemaker "op start timeout=XX".
#
- # hint: redis master_link_status will only come "up" when
+ # hint: redis/valkey master_link_status will only come "up" when
# the SYNC with the master has completed.
# This can take an arbitraty time (data) and should
# only be parametrized by the start operation timeout