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

Christoph Berg myon at debian.org
Sun Jun 4 19:00:49 UTC 2017


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

myon pushed a commit to branch stretch
in repository resource-agents.

commit ae26febb01d85bbc4e12a67519d51952e99f77c6
Author: Christoph Berg <myon at debian.org>
Date:   Sun Jun 4 09:36:13 2017 +0200

    pgsql: quote synchronous_standby_names contents
    
    pgsql: postgresql-9.6 treats the contents of synchronous_standby_names as SQL identifiers, they need to be quoted for dashes etc. (Closes: #862719)
---
 debian/changelog         |  7 +++++++
 debian/patches/pgsql-9.6 | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series    |  1 +
 3 files changed, 55 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 74044fe..13c5228 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+resource-agents (1:4.0.0~rc1-4) unstable; urgency=medium
+
+  * pgsql: postgresql-9.6 treats the contents of synchronous_standby_names as
+    SQL identifiers, they need to be quoted for dashes etc. (Closes: #862719)
+
+ -- Christoph Berg <myon at debian.org>  Sun, 04 Jun 2017 09:30:30 +0200
+
 resource-agents (1:4.0.0~rc1-3) unstable; urgency=medium
 
   * debian/control: add net-tools to Recommends (Closes: #857368)
diff --git a/debian/patches/pgsql-9.6 b/debian/patches/pgsql-9.6
new file mode 100644
index 0000000..50ae74d
--- /dev/null
+++ b/debian/patches/pgsql-9.6
@@ -0,0 +1,47 @@
+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\""
+@@ -1493,7 +1493,7 @@ set_sync_mode() {
+         ocf_log debug "$sync_node_in_conf is already sync mode."
+     else
+         ocf_log info "Setup $1 into sync mode."
+-        runasowner -q err "echo \"synchronous_standby_names = '$1'\" > \"$REP_MODE_CONF\""
++        runasowner -q err "echo \"synchronous_standby_names = '\\\"$1\\\"'\" > \"$REP_MODE_CONF\""
+         [ "$RE_CONTROL_SLAVE" = "false" ] && RE_CONTROL_SLAVE="true"
+         exec_with_retry 0 reload_conf
+     fi
diff --git a/debian/patches/series b/debian/patches/series
index b8d9fd6..c1784b1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@ no-dirty-version
 ipv6-linux-only
 850787-fix-typo
 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