- pgsqlms: use monitor_user and monitor_password for monitor operations

Includes fixes for stop operation failure when incorrect
  monitor_user/monitor_password is specified

  Resolves: RHEL-150842
This commit is contained in:
Arslan Ahmad 2026-06-01 18:32:10 +05:30
parent d78db29f92
commit 78871e7bdb
2 changed files with 41 additions and 7 deletions

View File

@ -117,3 +117,37 @@
<parameter name="bindir" unique="0" required="0">
<longdesc lang="en">
Path to the directory storing the PostgreSQL binaries. The agent uses psql, pg_isready, pg_controldata and pg_ctl.
@@ -1523,6 +1567,7 @@
my $rc;
my $state;
my $pidfile = "$datadir/postmaster.pid";
+ my $pgisready_rc;
# Add 60s to the timeout or use a 24h timeout fallback to make sure
# Pacemaker will give up before us and take decisions
my $timeout = ( _get_action_timeout() || 60*60*24 ) + 60;
@@ -1536,9 +1581,22 @@
return $OCF_SUCCESS;
}
elsif ( $rc != $OCF_SUCCESS and $rc != $OCF_RUNNING_MASTER ) {
- ocf_exit_reason( 'Unexpected state for instance "%s" (returned %d)',
- $OCF_RESOURCE_INSTANCE, $rc );
- return $OCF_ERR_GENERIC;
+ ocf_log( 'debug', 'pgsql_stop: monitor failed (rc=%d), checking with pg_isready', $rc );
+
+ $pgisready_rc = _pg_isready();
+ if ( $pgisready_rc == 0 or $pgisready_rc == 1 ) {
+ ocf_log( 'info', 'Instance "%s" is running (pg_isready=%d), proceeding with stop despite monitor failure',
+ $OCF_RESOURCE_INSTANCE, $pgisready_rc );
+ }
+ elsif ( $pgisready_rc == 2 ) {
+ ocf_log( 'debug', 'pgsql_stop: pg_isready indicates instance is not listening' );
+ return _confirm_stopped();
+ }
+ else {
+ ocf_exit_reason( 'Unexpected state for instance "%s" (monitor returned %d, pg_isready returned %d)',
+ $OCF_RESOURCE_INSTANCE, $rc, $pgisready_rc );
+ return $OCF_ERR_GENERIC;
+ }
}
#

View File

@ -45,7 +45,7 @@
Name: resource-agents
Summary: Open Source HA Reusable Cluster Resource Scripts
Version: 4.10.0
Release: 120%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
Release: 121%{?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
@ -859,6 +859,12 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents
%{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm
%changelog
* Mon Jun 01 2026 Arslan Ahmad <arahmad@redhat.com> - 4.10.0-121
- pgsqlms: use monitor_user for monitor-calls and use .pgpass when
monitor_password is not specified
Resolves: RHEL-150842
* Thu May 28 2026 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.10.0-120
- iSCSILogicalUnit: add block size override and backstore type selection
@ -870,12 +876,6 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents
Resolves: RHEL-179069
* Mon May 25 2026 Arslan Ahmad <arahmad@redhat.com> - 4.10.0-118
- pgsqlms: use monitor_user for monitor-calls and use .pgpass when
monitor_password is not specified
Resolves: RHEL-150842
* Wed May 20 2026 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.10.0-117
- podman-etcd: fix port 2380 binding race
- podman-etcd: fix machine deletion deadlock