Blame SOURCES/bz1795535-pgsql-2-fix-uppercase-hostname-support.patch

bcdf71
From e56d0e1727bf84d0664db544a129a0237a1757c0 Mon Sep 17 00:00:00 2001
bcdf71
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
bcdf71
Date: Fri, 11 Sep 2020 10:12:21 +0200
bcdf71
Subject: [PATCH 1/2] pgsql: lower-case application_name to avoid issues with
bcdf71
 upper-case hostnames
bcdf71
bcdf71
---
bcdf71
 heartbeat/pgsql | 2 +-
bcdf71
 1 file changed, 1 insertion(+), 1 deletion(-)
bcdf71
bcdf71
diff --git a/heartbeat/pgsql b/heartbeat/pgsql
bcdf71
index 99e074287..de9f750c5 100755
bcdf71
--- a/heartbeat/pgsql
bcdf71
+++ b/heartbeat/pgsql
bcdf71
@@ -1960,7 +1960,7 @@ pgsql_validate_all() {
bcdf71
         else
bcdf71
             CHECK_XLOG_LOC_SQL="select pg_last_xlog_replay_location(),pg_last_xlog_receive_location()"
bcdf71
         fi
bcdf71
-        CHECK_REPLICATION_STATE_SQL="select application_name,upper(state),upper(sync_state) from pg_stat_replication"
bcdf71
+        CHECK_REPLICATION_STATE_SQL="select lower(application_name),upper(state),upper(sync_state) from pg_stat_replication"
bcdf71
 
bcdf71
         PGSQL_STATUS_ATTR="${RESOURCE_NAME}-status"
bcdf71
         PGSQL_DATA_STATUS_ATTR="${RESOURCE_NAME}-data-status"
bcdf71
bcdf71
From 5aee799878180bb8daca82aebc2290c2735045eb Mon Sep 17 00:00:00 2001
bcdf71
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
bcdf71
Date: Fri, 11 Sep 2020 10:13:47 +0200
bcdf71
Subject: [PATCH 2/2] pgsql: set exit-reason when failing due to remaining
bcdf71
 PGSQL.lock
bcdf71
bcdf71
---
bcdf71
 heartbeat/pgsql | 3 +++
bcdf71
 1 file changed, 3 insertions(+)
bcdf71
bcdf71
diff --git a/heartbeat/pgsql b/heartbeat/pgsql
bcdf71
index de9f750c5..5a0628b7a 100755
bcdf71
--- a/heartbeat/pgsql
bcdf71
+++ b/heartbeat/pgsql
bcdf71
@@ -966,6 +966,9 @@ pgsql_real_monitor() {
bcdf71
     if ! pgsql_status
bcdf71
     then
bcdf71
         ocf_log info "PostgreSQL is down"
bcdf71
+        if [ "$__OCF_ACTION" = "monitor" ] && ! ocf_is_probe && [ -f $PGSQL_LOCK ]; then
bcdf71
+            ocf_exit_reason "My data may be inconsistent. You have to remove $PGSQL_LOCK file to force start."
bcdf71
+        fi
bcdf71
         return $OCF_NOT_RUNNING
bcdf71
     fi
bcdf71