[Pkg-postgresql-public] Bug#819326: jessie-pu: package postgresql-common/165+deb8u1

Christoph Berg myon at debian.org
Sat Mar 26 18:07:04 UTC 2016


Package: release.debian.org
Severity: normal
Tags: jessie
User: release.debian.org at packages.debian.org
Usertags: pu

Hi,

I'd like to include the patch quoted below in jessie, would this be
ok?

diff --git a/debian/changelog b/debian/changelog
index 7751170..0d6bd4f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,24 @@
+postgresql-common (165+deb8u1) jessie; urgency=medium
+
+  * pg_upgradecluster: Set default dynamic_shared_memory_type = mmap.
+    (Closes: #784005, #812206)
+
+    This primarily avoids problems with upgrading existing clusters in a LXC
+    container. As earlier PG versions did not have d_s_m_t, the upgraded
+    postgresql.conf won't have this setting either, yielding the compiled-in
+    default of 'posix' which doesn't work in LXC. Pick something else here to
+    avoid that problem. Notably, it's important that this problem is fixed in
+    pg_upgradecluster itself because working around the problem is hard as the
+    upgrade will fail early without the possibility of manually fixing the
+    config. (Newly created clusters do not have that problem because initdb
+    probes for a method working in the given system.)
+
+  * t/040_upgrade.t: Skip testing pg_upgrade with datallowconn = f, it does
+    not support that anymore as of May 2015.
+    (Cherry-pick from master to allow testing the pg_upgradecluster fix)
+
+ -- Christoph Berg <myon at debian.org>  Sat, 26 Mar 2016 16:52:30 +0100
+
 postgresql-common (165) unstable; urgency=medium
 
   * Debconf translation updates, thanks!
diff --git a/pg_upgradecluster b/pg_upgradecluster
index db541be..876a0af 100755
--- a/pg_upgradecluster
+++ b/pg_upgradecluster
@@ -170,6 +170,11 @@ sub adapt_conffiles {
 
     if ($newversion >= '9.4') {
         deprecate \%c, 'krb_srvname', 'native krb5 authentication deprecated in favor of GSSAPI';
+        # d_s_m_t defaults to 'posix', but that has various problems. Pick a safer variant here
+        unless ($c{dynamic_shared_memory_type}) {
+            PgCommon::set_conf_value $newversion, $cluster, 'postgresql.conf',
+                'dynamic_shared_memory_type', 'mmap';
+        }
     }
 }
 
diff --git a/t/040_upgrade.t b/t/040_upgrade.t
index 00c1c17..5edf305 100644
--- a/t/040_upgrade.t
+++ b/t/040_upgrade.t
@@ -32,8 +32,11 @@ is ((exec_as 'postgres', 'createuser nobody -D -R -s && createdb -O nobody test
 is ((exec_as 'nobody', 'psql test -c "CREATE TABLE phone (name varchar(255) PRIMARY KEY, tel int NOT NULL)"'), 
     0, 'create table');
 is ((exec_as 'nobody', 'psql test -c "INSERT INTO phone VALUES (\'Alice\', 2)"'), 0, 'insert Alice into phone table');
-is ((exec_as 'postgres', 'psql template1 -c "UPDATE pg_database SET datallowconn = \'f\' WHERE datname = \'testnc\'"'), 
-    0, 'disallow connection to testnc');
+SKIP: {
+    skip 'datallowconn = f not supported with pg_upgrade', 1 if $upgrade_options =~ /upgrade/;
+    is ((exec_as 'postgres', 'psql template1 -c "UPDATE pg_database SET datallowconn = \'f\' WHERE datname = \'testnc\'"'),
+        0, 'disallow connection to testnc');
+}
 is ((exec_as 'nobody', 'psql testro -c "CREATE TABLE nums (num int NOT NULL); INSERT INTO nums VALUES (1)"'), 0, 'create table in testro');
 SKIP: {
     skip 'read-only not supported with pg_upgrade', 2 if $upgrade_options =~ /upgrade/;
@@ -195,14 +198,15 @@ SKIP: {
     skip 'upgrading databases with datallowcon = false not supported by pg_upgrade', 2 if $upgrade_options =~ /upgrade/;
 
     # Check connection permissions
+    my $testnc_conn = $upgrade_options =~ /upgrade/ ? 't' : 'f';
     is_program_out 'nobody', 'psql -tAc "SELECT datname, datallowconn FROM pg_database ORDER BY datname" template1', 0,
-    'postgres|t
+    "postgres|t
 template0|f
 template1|t
 test|t
-testnc|f
+testnc|$testnc_conn
 testro|t
-', 'dataallowconn values';
+", 'dataallowconn values';
 }
 
 # check ACLs

Christoph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-postgresql-public/attachments/20160326/cdc6af86/attachment.sig>


More information about the Pkg-postgresql-public mailing list