Your message dated Mon, 12 Aug 2019 19:17:25 +0000
with message-id <e1hxfor-000ee3...@fasolo.debian.org>
and subject line Bug#931635: fixed in postgresql-common 200+deb10u2
has caused the Debian Bug report #931635,
regarding pg_upgradecluster writes data_directory to postgresql.auto.conf, and
gets confused by it on the next upgrade [DATA LOSS]
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
931635: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931635
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: postgresql-common
Version: 200
Severity: critical
Tags: buster sid
In postgresql-common 200, pg_upgradecluster learned how to copy the
contents of postgresql.auto.conf (where ALTER SYSTEM stores its data;
#810615).
Internally, adapt_conffiles() gets invoked twice, once for
postgresql.conf and once for postgresql.auto.conf. This function is
also responsible for setting data_directory in the new cluster.
Unfortunately, it does this both for postgresql.conf (correct) and
postgresql.auto.conf (where ALTER SYSTEM itself refuses to set
data_directory, but having a file with it is syntactically ok).
At this point, both clusters operate normally, and no harm is done
because postgresql.auto.conf contains the correct data_directory
setting.
However, if this cluster gets upgraded *again*, this extra
postgresql.auto.conf setting will confuse the "update config file"
logic in postgresql-common's PgCommon.pm. The effect is that on the
second upgrade, the new data_directory setting for the 3rd cluster
will be written to the postgresql.auto.conf file of the *2nd* cluster.
(And the 3rd cluster has a verbatim copy of the old postgresql.auto.conf
from the 2nd cluster.) At this point, all three clusters still operate
normally because pg_ctlcluster/pg_ctl can still launch the clusters,
despite the bad data_directory settings in postgresql.auto.conf.
Symptoms of the problem at this point are:
* `pg_lsclusters` shows the wrong Data directory for the 2nd and 3rd cluster
Ver Cluster Port Status Owner Data directory Log file
9.5 main 5433 down postgres /var/lib/postgresql/9.6/main
/var/log/postgresql/postgresql-9.5-main.log
9.6 main 5432 online postgres /var/lib/postgresql/9.5/main
/var/log/postgresql/postgresql-9.6-main.log
* `ps` shows the wrong data directory on the postgres command line:
/usr/lib/postgresql/9.6/bin/postgres -D /var/lib/postgresql/9.5/main -c
config_file=/etc/postgresql/9.6/main/postgresql.conf
The really bad problem now using `pg_dropcluster` will wipe the data
directory OF THE WRONG CLUSTER. Oops. (And sorry.)
I have a patch ready, including testsuite coverage. I'll also upload a
200+deb10u2 package to buster-proposed-updates.
Christoph
--- End Message ---
--- Begin Message ---
Source: postgresql-common
Source-Version: 200+deb10u2
We believe that the bug you reported is fixed in the latest version of
postgresql-common, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 931...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Christoph Berg <m...@debian.org> (supplier of updated postgresql-common package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Thu, 25 Jul 2019 23:04:54 +0200
Source: postgresql-common
Architecture: source
Version: 200+deb10u2
Distribution: buster
Urgency: high
Maintainer: Debian PostgreSQL Maintainers <team+postgre...@tracker.debian.org>
Changed-By: Christoph Berg <m...@debian.org>
Closes: 931635
Changes:
postgresql-common (200+deb10u2) buster; urgency=high
.
DATA LOSS WARNING: pg_upgradecluster from postgresql-common 200,
200+deb10u1, 201, and 202 will corrupt the data_directory setting when used
*twice* to upgrade a cluster (e.g. 9.6 -> 10 -> 11). This update fixes the
original problem, and also heals affected clusters on the next upgrade. No
additional steps are required.
.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931635
.
* pg_upgradecluster: Don't accidentally set (the wrong!) data_directory in
postgresql.auto.conf. (Closes: #931635)
* PgCommon.pm: Ignore data_directory when set in postgresql.auto.conf.
* pg_upgradecluster: Delete data_directory from postgresql.auto.conf in new
cluster.
Checksums-Sha1:
396d1771c039b78d032015c4bb232667cd271901 2341 postgresql-common_200+deb10u2.dsc
a3f4043c67994c1adc2f6fd52729434c26f375ed 213152
postgresql-common_200+deb10u2.tar.xz
Checksums-Sha256:
30121085794a4198bafee5e503333f19a87d6e8ede145ce13f014b153d1bf304 2341
postgresql-common_200+deb10u2.dsc
8c2cfc561a235025508ada8dd6980782a09697763dc5f86b7b0c303a45bf65ba 213152
postgresql-common_200+deb10u2.tar.xz
Files:
efe82cd2cfecf9725654a28476d20d55 2341 database optional
postgresql-common_200+deb10u2.dsc
6efb450d74ca4cd555dd08770b7e2863 213152 database optional
postgresql-common_200+deb10u2.tar.xz
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEXEj+YVf0kXlZcIfGTFprqxLSp64FAl06IRgACgkQTFprqxLS
p64I1g//RYvyuyEdL0dOmajAscgHECAthtZBPX4Yee1oeVjOo1esQ1ovJt93u7vm
GtQjuTbbHyPjbEDLJROXr+qMCj1VgmqqZhxXqAipMI9FUzsp54aENlJz9jXMXwtd
cvsTKrISSrxDprIAJj3+IHg3/KQOzW5cKklid6wYNVjFL1gYBIGIoft2p4D987Ka
74C+tYGy1xVW2n6KP7fl3P6Sjxy1/cW6/pEOLDD/oU2LFB7EZgBAmbfP7m1w3nTm
GEe6cc1s3f8peKLN6/1SCQcf3u/pdsUMV3QJM+7337NhPmfCQHCfEINj/jpusrsd
CaYOXDza1U2U1Cq9G7R1qZ5Au8K5p3a6A9cY4bX1a1K5xZabhruNm6g73TC/fvX8
ES7MQiXV4Ga4c3kcM+m1vE16aF01yJpVGldrFNOrdcvbBP5FvavBJIPSa1+Mfacb
9zTMKu3QFsyU28bif+2d8COx7tQFSMJ0kOiJPyhRWhfO45OiSKpJn1bnj/VMePRc
VhR3nmwF0GRIKHfz6hgc1IY4o1bgrLwbCAtyeFla3+4ibOPOLWQGOe17XBhGZqSv
o+Ji2cws4ugSdxMJwGnE0XW2BVL67LvPGYZmItYXiRr/cfAmKGbvM3q/VI/smou+
fqxkc0zRkpFF/pzlieYnyLWeo8ZSkUph720neglLnA9OYdz/xvg=
=JiNc
-----END PGP SIGNATURE-----
--- End Message ---