- oralsnr: support for multiple listeners per Oracle SID

Resolves: RHEL-139361
This commit is contained in:
Arslan Ahmad 2026-09-04 13:03:37 +05:30
parent 61770f12e2
commit ccc7436523
2 changed files with 118 additions and 1 deletions

View File

@ -0,0 +1,110 @@
From b071d36f00e02d3b2f56b9e70b6abb456bf78c14 Mon Sep 17 00:00:00 2001
From: Arslan Ahmad <arahmad@redhat.com>
Date: Mon, 29 Jun 2026 19:13:22 +0530
Subject: [PATCH] oralsnr: enable support for multiple listeners per SID
Previously, configuring multiple listeners for the same SID caused
validation warnings and false positive monitor operations.
One can configure several listeners per instance, one for front-end
applications, another for backup etc. To properly support this
architecture, this commit introduces the following changes:
* Removed the `unique` constraint on the `sid` parameter, as the
`listener` parameter is the true unique identifier for the OS-level
process.
* Added a new resource option `tns_svc_name` to allow cluster
administrators to specify a custom TNS alias (e.g. pointing to a
specific port) for the monitor operation.
* Updated `test_tnsping()` to use the new `tns_svc_name` parameter
instead of hardcoded `$ORACLE_SID`. This parameter dynamically defaults
to the database SID, ensuring complete backward compatibility for
existing single-listener setups.
---
heartbeat/oralsnr | 33 ++++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/heartbeat/oralsnr b/heartbeat/oralsnr
index dd0df1c614..7db73ecde3 100755
--- a/heartbeat/oralsnr
+++ b/heartbeat/oralsnr
@@ -25,6 +25,7 @@
# OCF_RESKEY_home (optional; else read it from /etc/oratab)
# OCF_RESKEY_user (optional; user to run the listener)
# OCF_RESKEY_listener (optional; defaults to LISTENER)
+# OCF_RESKEY_tns_svc_name (optional; defaults to Oracle SID)
#
# Initialization:
@@ -44,6 +45,9 @@ OCF_RESKEY_listener_default="LISTENER"
: ${OCF_RESKEY_user=${OCF_RESKEY_user_default}}
: ${OCF_RESKEY_listener=${OCF_RESKEY_listener_default}}
+OCF_RESKEY_tns_svc_name_default="${OCF_RESKEY_sid}"
+: ${OCF_RESKEY_tns_svc_name=${OCF_RESKEY_tns_svc_name_default}}
+
#######################################################################
SH=/bin/sh
@@ -81,10 +85,10 @@ Oracle Listener instance as an HA resource.
<parameters>
-<parameter name="sid" unique="1" required="1">
+<parameter name="sid" unique="0" required="1">
<longdesc lang="en">
-The Oracle SID (aka ORACLE_SID). Necessary for the monitor op,
-i.e. to do tnsping SID.
+The Oracle SID (aka ORACLE_SID). Used for the monitor op, when
+alias is undefined i.e. to do tnsping SID.
</longdesc>
<shortdesc lang="en">sid</shortdesc>
<content type="string" default="${OCF_RESKEY_sid_default}" />
@@ -118,16 +122,27 @@ Defaults to LISTENER.
<parameter name="tns_admin" required="0" unique="0">
<longdesc lang="en">
- Full path to the directory that contains the Oracle
- listener tnsnames.ora configuration file. The shell
- variable TNS_ADMIN is set to the value provided.
+Full path to the directory that contains the Oracle
+listener tnsnames.ora configuration file. The shell
+variable TNS_ADMIN is set to the value provided.
</longdesc>
<shortdesc lang="en">
- Full path to the directory containing tnsnames.ora
+Full path to the directory containing tnsnames.ora
</shortdesc>
<content type="string"/>
</parameter>
+<parameter name="tns_svc_name" unique="1" required="0">
+<longdesc lang="en">
+The TNS alias (aka net_service_name) to ping during the
+monitor operation. Defaults to the Oracle SID.
+</longdesc>
+<shortdesc lang="en">
+TNS alias to ping
+</shortdesc>
+<content type="string" />
+</parameter>
+
</parameters>
<actions>
@@ -237,11 +252,11 @@ test_listener() {
# and does it work?
test_tnsping() {
local output
- output=`tnsping $ORACLE_SID`
+ output=`tnsping ${OCF_RESKEY_tns_svc_name}`
if echo "$output" | tail -1 | grep -qs '^OK'; then
return $OCF_SUCCESS
else
- ocf_exit_reason "tnsping $ORACLE_SID failed: $output"
+ ocf_exit_reason "tnsping ${OCF_RESKEY_tns_svc_name} failed: $output"
return $OCF_ERR_GENERIC
fi
}

View File

@ -45,7 +45,7 @@
Name: resource-agents
Summary: Open Source HA Reusable Cluster Resource Scripts
Version: 4.16.0
Release: 76%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
Release: 77%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
License: GPL-2.0-or-later AND LGPL-2.1-or-later
URL: https://github.com/ClusterLabs/resource-agents
Source0: %{upstream_prefix}-%{upstream_version}.tar.gz
@ -154,6 +154,7 @@ Patch101: RHEL-235065-podman-etcd-scope-sync-to-etcd-filesystem-to-avoid-CephFS-
Patch102: RHEL-239956-podman-etcd-resolve-force_new_cluster-race-during-simultaneous-dual-start.patch
Patch103: RHEL-239878-1-podman-etcd-add-restart_no_leave-CRM-attribute-guard-to-skip-member-removal.patch
Patch104: RHEL-239878-2-podman-etcd-treat-attribute-not-found-as-empty.patch
Patch105: RHEL-139361-oralsnr-support-for-multiple-listener-per-oracle-sid.patch
# bundled ha-cloud-support libs
Patch500: ha-cloud-support-aliyun.patch
@ -429,6 +430,7 @@ exit 1
%patch -p1 -P 102
%patch -p1 -P 103
%patch -p1 -P 104
%patch -p1 -P 105
# bundled ha-cloud-support libs
%patch -p1 -P 500
@ -761,6 +763,11 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents
%{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm
%changelog
* Fri Sep 04 2026 Arslan Ahmad <arahmad@redhat.com> - 4.16.0-77
- oralsnr: support for multiple listeners per Oracle SID
Resolves: RHEL-139361
* Thu Sep 3 2026 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.16.0-76
- podman-etcd: remove cert monitoring
- podman-etcd: add support for single-node operation