[Debian-ha-commits] [resource-agents] 01/06: pgsql: quote synchronous_standby_names contents

Valentin Vidic vvidic-guest at moszumanska.debian.org
Thu Aug 3 12:32:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

vvidic-guest pushed a commit to branch master
in repository resource-agents.

commit 345c498a667cbb74ad5a8725c6d2ce90be420ccc
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Thu Aug 3 13:17:39 2017 +0200

    pgsql: quote synchronous_standby_names contents
    
    Import half of the patch still needed from stretch branch.
---
 debian/patches/pgsql-9.6 | 38 ++++++++++++++++++++++++++++++++++++++
 debian/patches/series    |  1 +
 2 files changed, 39 insertions(+)

diff --git a/debian/patches/pgsql-9.6 b/debian/patches/pgsql-9.6
new file mode 100644
index 0000000..9cbf0a0
--- /dev/null
+++ b/debian/patches/pgsql-9.6
@@ -0,0 +1,38 @@
+commit 6e91193f0e4d3f72d22564e1fe393e7391691f9d
+Author: Andreas Ntaflos <andreas.ntaflos at rise-world.com>
+Date:   Mon Dec 12 14:43:59 2016 +0100
+
+    Double-quote value of synchronous_standby_names in rep_mode.conf
+    
+    PostgreSQL 9.6 introduced a new syntax for specifying
+    synchronous_standby_names. The old syntax, used by the pgsql RA, is
+    still valid but PostgreSQL now treats the standby-names in
+    synchronous_standby_names as SQL identifiers. This means such values
+    need to be double-quoted since they can easily contain dashes or other
+    characters that are not valid in a bare SQL identifier.
+    
+    See the docs for synchronous_standby_names in
+    https://www.postgresql.org/docs/9.6/static/runtime-config-replication.html
+    for confirmation and
+    https://www.postgresql.org/message-id/21183.1481253534%40sss.pgh.pa.us
+    for a short discussion.
+
+commit 6ad25cf64e00cebe5d90ec96430d94a38b240d31
+Author: Gianluca De Cicco <gnlcdccc at gmail.com>
+Date:   Thu Mar 23 15:12:24 2017 +0100
+
+    fix regex in set async mode
+
+Index: resource-agents/heartbeat/pgsql
+===================================================================
+--- resource-agents.orig/heartbeat/pgsql
++++ resource-agents/heartbeat/pgsql
+@@ -1474,7 +1474,7 @@ set_async_mode_all() {
+ }
+ 
+ set_async_mode() {
+-    cat $REP_MODE_CONF |  grep -q -e "[,' ]$1[,' ]"
++    cat $REP_MODE_CONF |  grep -q -E "(\"$1\")|([,' ]$1[,' ])"
+     if [ $? -eq 0 ]; then
+         ocf_log info "Setup $1 into async mode."
+         runasowner -q err "echo \"synchronous_standby_names = ''\" > \"$REP_MODE_CONF\""
diff --git a/debian/patches/series b/debian/patches/series
index c18827d..51cf8e5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ mysql-path.patch
 no-dirty-version
 ipv6-linux-only
 ocft-configs.patch
+pgsql-9.6

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/resource-agents.git



More information about the Debian-HA-Commits mailing list