[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#864199: unblock: resource-agents/1:4.0.0~rc1-4



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package resource-agents. The new version fixes a
regression from jessie [*]. In PostgreSQL 9.6 synchronous replication
setups, setting the synchronous replication target failed if the
hostnames contained dashes ("pg-node-1"). The new version cherry-picks
changes from upstream.

[*] Strictly speaking, pacemaker is not in jessie, but it is in
jessie-backports and wheezy (no backports), so sync rep users would be
affected anyway.

Problem verified as existing in 1:4.0.0~rc1-3 and fixed in
1:4.0.0~rc1-4 in a manual test setup. (Hard to test automatically
because it needs two corosync nodes.)


diff -Nru resource-agents-4.0.0~rc1/debian/changelog resource-agents-4.0.0~rc1/debian/changelog
--- resource-agents-4.0.0~rc1/debian/changelog	2017-03-14 08:36:06.000000000 +0100
+++ resource-agents-4.0.0~rc1/debian/changelog	2017-06-04 09:30:30.000000000 +0200
@@ -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@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 -Nru resource-agents-4.0.0~rc1/debian/patches/pgsql-9.6 resource-agents-4.0.0~rc1/debian/patches/pgsql-9.6
--- resource-agents-4.0.0~rc1/debian/patches/pgsql-9.6	1970-01-01 01:00:00.000000000 +0100
+++ resource-agents-4.0.0~rc1/debian/patches/pgsql-9.6	2017-06-04 09:28:07.000000000 +0200
@@ -0,0 +1,47 @@
+commit 6e91193f0e4d3f72d22564e1fe393e7391691f9d
+Author: Andreas Ntaflos <andreas.ntaflos@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@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 -Nru resource-agents-4.0.0~rc1/debian/patches/series resource-agents-4.0.0~rc1/debian/patches/series
--- resource-agents-4.0.0~rc1/debian/patches/series	2017-01-18 14:38:11.000000000 +0100
+++ resource-agents-4.0.0~rc1/debian/patches/series	2017-06-04 09:28:07.000000000 +0200
@@ -5,3 +5,4 @@
 ipv6-linux-only
 850787-fix-typo
 ocft-configs.patch
+pgsql-9.6


unblock resource-agents/1:4.0.0~rc1-4


Thanks,
Christoph

Attachment: signature.asc
Description: PGP signature


Reply to: