Compare commits
402 commits
debian/1.4
...
master
Author | SHA1 | Date | |
---|---|---|---|
941e358015 | |||
e3e474e941 | |||
a20c84dccc | |||
237a471872 | |||
1696b49173 | |||
6080e04541 | |||
3fa4d74c3d | |||
fc47254fde | |||
8325643e03 | |||
f27a4dcb87 | |||
9a65ac8b54 | |||
2a3aed8b82 | |||
e33cc5df37 | |||
2f75f4a6fe | |||
0528d0d46c | |||
cc4a79a666 | |||
783a564fbd | |||
edaa60c5be | |||
60c9d2c9de | |||
d1ffa2f934 | |||
b4db543273 | |||
46ccaa2b8e | |||
3db79981f8 | |||
8de2bb7462 | |||
769889707d | |||
0a71194a9b | |||
9a33c75cc9 | |||
efd23c9778 | |||
0153ff40e6 | |||
6e267093c7 | |||
c0a458a620 | |||
5681786be3 | |||
cb31e3dce3 | |||
e879c212ea | |||
64a5a762c5 | |||
9761d8f991 | |||
6481cfe02c | |||
80f2dfcc3f | |||
c8548c1499 | |||
d53c5a55b0 | |||
6870df7681 | |||
e15c7c0b60 | |||
bb19fd1462 | |||
cefbea9eb6 | |||
efda13edd9 | |||
894b3d56ab | |||
957b531788 | |||
1e0b3773c6 | |||
245282c90f | |||
673bc4ac18 | |||
538cc5f0f9 | |||
b6238b501a | |||
5d992c2efe | |||
2c599f9c46 | |||
b6215af13a | |||
ae8f30e7bd | |||
9f5c5c6af1 | |||
9c3fa0ce30 | |||
6282052f22 | |||
4956e9786d | |||
65900f0147 | |||
646fff424b | |||
643f00b666 | |||
f5ce504df4 | |||
c7be5fde50 | |||
1a818f3a2d | |||
1c0c9069d4 | |||
b3cede2442 | |||
504752fc12 | |||
eba244cde4 | |||
2d77bd18bc | |||
58f28f4e5a | |||
2e63c66698 | |||
b98c5799f6 | |||
da9c94933a | |||
8e4a470fe9 | |||
8b99f7607a | |||
40bc5f98a5 | |||
a5f859df4a | |||
44b7539063 | |||
e185b18ae6 | |||
dc689cc6e7 | |||
e2dbd68398 | |||
5bbbd8a5bb | |||
f5ba0478ef | |||
2a118588e7 | |||
4f4460c3af | |||
73e419a03c | |||
1cf2f4cc49 | |||
b4ffd1d4e9 | |||
95d35040aa | |||
58d57edcd9 | |||
9be9d10bcb | |||
17abe57e74 | |||
be747576de | |||
6019c28f6f | |||
c516a97bfe | |||
203a503656 | |||
1ef60d9178 | |||
61f3a3293e | |||
fd6d67fb8d | |||
a6cbcc2477 | |||
60f14e55b9 | |||
079695e476 | |||
0c6629c6eb | |||
0260a840e7 | |||
267406462d | |||
80c97ced97 | |||
932a1911a8 | |||
ae3072dce0 | |||
1824929f99 | |||
7f96403eba | |||
4660f02234 | |||
5700e7ed2e | |||
fbaaf9a3d6 | |||
9d1f56ecee | |||
ae7d4931fa | |||
52732c150a | |||
09a136ed63 | |||
2d2f3abf17 | |||
62284e0ddd | |||
b311970612 | |||
4b316748a8 | |||
c4a95d0d07 | |||
34a819de67 | |||
7a6534680d | |||
2bf2efe55b | |||
eacb4406b2 | |||
c4c68c1528 | |||
51e776e2dc | |||
123dbcaa78 | |||
caea578acf | |||
1e8ffecbe2 | |||
d212009af3 | |||
bd110e468d | |||
08dd948377 | |||
e162d13210 | |||
23c9f24672 | |||
98213cc260 | |||
531db713eb | |||
39318f56fd | |||
15d15b60a2 | |||
f2b7f40628 | |||
538d5412e2 | |||
aa2d5bc588 | |||
21cfa15bab | |||
47dd5410dd | |||
d7a65bb738 | |||
e51c5c0ae1 | |||
96d0534ac1 | |||
ec13d27493 | |||
c49ecb7f92 | |||
6fee48f191 | |||
7bd32192af | |||
1b736f02fe | |||
b80cf41f26 | |||
24f7c0f0ba | |||
0e2444a5fd | |||
8711c80dba | |||
e8163f4165 | |||
1bb99b2170 | |||
af96198d16 | |||
3812c8d23b | |||
929e69dd0a | |||
f871088904 | |||
61e86f0980 | |||
8716cf7fe8 | |||
30cfd5313f | |||
77c9f93829 | |||
21ff79486e | |||
822dd1f3cc | |||
ab6875b9c0 | |||
57f4bc23ea | |||
d29bbb457f | |||
b5036eb6a7 | |||
8a4d005db1 | |||
402f3a32cb | |||
b45fefff2a | |||
9621dc8dc6 | |||
ff2cdb3974 | |||
2a34f4eb6b | |||
13e4e1950f | |||
c22bd42699 | |||
9d00847de6 | |||
f221fd3be6 | |||
bd3d91513b | |||
02134202f9 | |||
19a85cfd58 | |||
a1171ffef7 | |||
6fa5240f72 | |||
d0aa441487 | |||
f6b94358ba | |||
6600908d91 | |||
366a21ba40 | |||
dd02ea182b | |||
e571814340 | |||
24442e1410 | |||
6e8e643700 | |||
2dfc33b913 | |||
74b781686d | |||
0847a1340f | |||
aa406aea32 | |||
0ddaf39598 | |||
e1d38a3070 | |||
a708d50f6a | |||
ebc0bdb0bd | |||
0b9dd988ad | |||
e6413a09d5 | |||
c9e40b4ddc | |||
91ed216419 | |||
69f8f7d410 | |||
5d0a1b71cc | |||
370d0172fd | |||
9802cab245 | |||
7617e29052 | |||
8c2c318eba | |||
3f819ade7a | |||
9481fbe92b | |||
9e32b6be9b | |||
cb7ad1d1be | |||
ffbf792964 | |||
0d8c5d7776 | |||
24b1062933 | |||
c52a478304 | |||
3d12adbb69 | |||
d2c87e9e76 | |||
658e5b4dd0 | |||
b66fbfc101 | |||
6e919a8ad3 | |||
39bf90fbef | |||
7d1e81e853 | |||
caaeb33188 | |||
cbf2329990 | |||
a57e0af6f6 | |||
ec96dc075d | |||
bb564a258d | |||
cfc3c81075 | |||
fbfd686a2b | |||
7dbc251dd2 | |||
5e6c49a5b9 | |||
ff5b45ec8b | |||
d23215fafe | |||
7dc45d72e7 | |||
85a4ca636b | |||
8a65afb554 | |||
14b1f81df2 | |||
9dac6883f9 | |||
a5a0313dfd | |||
dda6f96501 | |||
06a63bcc70 | |||
73515105b2 | |||
88f6008c75 | |||
faea09fd0d | |||
d5ae64fb91 | |||
b74f8e56f7 | |||
6416e181cd | |||
7ad46a1ff2 | |||
3066313182 | |||
d1d4bf1b0c | |||
1d92f074a2 | |||
dec37dfc3b | |||
1b29d48c5f | |||
c816a536ff | |||
c6dae1036f | |||
0efd0e0171 | |||
a8522c6f39 | |||
5b93c19bbf | |||
3be7688421 | |||
70bf5293cd | |||
31dc61cb97 | |||
a6f28d48a1 | |||
d0b38d952e | |||
65557e4cc6 | |||
2f91093efa | |||
a475f58697 | |||
e306123dcb | |||
d5b94c318e | |||
e062f5f988 | |||
292f99ab6f | |||
a18cb0565c | |||
384c7875c7 | |||
337d8160e6 | |||
b50ab38d43 | |||
27d8f4f163 | |||
928d713614 | |||
109fe3c4f4 | |||
48cc554f41 | |||
f0d6e56a90 | |||
2cdbe859ba | |||
abcaa56c75 | |||
452f26f844 | |||
78e026f8c5 | |||
e22dafae50 | |||
9c475d93c7 | |||
ba9d9787cd | |||
fc45e29545 | |||
1331953756 | |||
adfe126ba0 | |||
85dc05c201 | |||
fd3cdc0bd3 | |||
9e805ae63c | |||
16654bdd45 | |||
4724130eb7 | |||
182ad5782e | |||
6101d04172 | |||
07db0240e9 | |||
f2bb21ab2c | |||
b54ffd557c | |||
66706ec370 | |||
7793595535 | |||
9e547c98a3 | |||
729ed72a47 | |||
0afd6f4c99 | |||
9bebf50f35 | |||
efc6f5da3e | |||
a9e6731ada | |||
b2261bfc33 | |||
b5f3b0581a | |||
8cb3cbda6e | |||
0a80df53c0 | |||
43a3e01148 | |||
9ff4404c53 | |||
8c43b5d47c | |||
1d9c39925c | |||
246e6d899f | |||
c757537b63 | |||
db0c920a4d | |||
780873360b | |||
8aab65cd6c | |||
d11ed3d0ec | |||
ecc6a0d5ff | |||
2071225e9c | |||
46edb4cdda | |||
845a19f6be | |||
fd51675c64 | |||
9adda90e16 | |||
33c0d27f50 | |||
f62ffa35c4 | |||
549c7f09bd | |||
15c5167267 | |||
b70083cb11 | |||
f9ee2d0854 | |||
5c467495c6 | |||
ceebdde404 | |||
0225eb54cd | |||
56e243eacd | |||
9bdeaf8613 | |||
5c84823b7d | |||
e786df09ce | |||
181258f8c7 | |||
0f5cbaadd6 | |||
1ea95db2ca | |||
6cb85d7e83 | |||
46e7849587 | |||
1ab4ba48c6 | |||
94f9410868 | |||
081cec3569 | |||
bdcb4aca79 | |||
43a21dd2b0 | |||
1e38bd2f51 | |||
75a8d4b613 | |||
c2d94ded1d | |||
4c4b5174b4 | |||
f730765425 | |||
3ea22ef0dd | |||
acb7de0bb4 | |||
a9ee748279 | |||
807339fc05 | |||
c20ca08716 | |||
e7e1f16c77 | |||
1e58cd96f7 | |||
24099e2a50 | |||
54d5b7cb43 | |||
1d861acf0a | |||
64133220c1 | |||
7dacfb6fbc | |||
321618c953 | |||
9e72d2b676 | |||
c6994861e0 | |||
df088977ed | |||
53b04dc0a0 | |||
11fbb641e0 | |||
8eb2f96262 | |||
af75147b58 | |||
e7ec4fc0e8 | |||
142d97bc95 | |||
559b7c2c17 | |||
ce1da1ca62 | |||
c480cdff80 | |||
98f36e6735 | |||
020bb733b7 | |||
db355e8724 | |||
2ccbf062ff | |||
02784e00e6 | |||
2187271458 | |||
3f97900790 | |||
3a40b44f76 | |||
342efedb7d | |||
9741f0a4fe | |||
923eb10e44 | |||
80bc218266 | |||
effb163942 |
105
debian/README.Debian
vendored
Normal file
105
debian/README.Debian
vendored
Normal file
|
@ -0,0 +1,105 @@
|
|||
Patroni for Debian
|
||||
------------------
|
||||
|
||||
The Debian patroni package has been adjusted in order to interoperate with
|
||||
Debian's postgresql-common (pg-common) framework for the administration of
|
||||
PostgreSQL instances. A particular pg-common instance (or cluster) is
|
||||
identified by the PostgreSQL major version (e.g. 10) and the cluster name
|
||||
(e.g. `main' as the default cluster), i.e. `10/main' or `10-main'.
|
||||
|
||||
Automatic Patroni configuration generation
|
||||
------------------------------------------
|
||||
|
||||
The Debian patroni package provides the pg_createconfig_patroni program that
|
||||
allows one to create a Patroni configuration for the desired Debian pg-common
|
||||
cluster, e.g. /etc/patroni/10-main for the `10/main' or `10-main' cluster,
|
||||
similar to pg_createcluster:
|
||||
|
||||
# pg_createconfig_patroni 10 main
|
||||
|
||||
The configuration is assembled from the /etc/patroni/dcs.yml fragment for the
|
||||
DCS configuration (see below) and a generic /etc/patroni/config.yml.in. The
|
||||
cluster-specific variables are substituted from config.yml.in into the specific
|
||||
instance configuration file.
|
||||
|
||||
Distributed Consensus Store (DCS)
|
||||
---------------------------------
|
||||
|
||||
A DCS needs to be configured and this is out-of-scope for the patroni package.
|
||||
The DCS-specific parts of the Patroni configuration can be configured in
|
||||
/etc/patroni/dcs.yml and will get integrated by pg_createconfig_patroni.
|
||||
|
||||
Patroni service
|
||||
---------------
|
||||
|
||||
Similar to the postgresql@ service, a patroni@ service unit is provided that
|
||||
allows the administration of an arbitrary pg-common cluster without having to
|
||||
define a systemd unit for each cluster, e.g.:
|
||||
|
||||
# systemctl start patroni@10-main
|
||||
|
||||
Due to systemd limitations, the cluster definition has to be provided with a `-'
|
||||
not a `/' between version and cluster name.
|
||||
|
||||
Note that due to Patron insisting on managing the Postgres server, the
|
||||
corresponding systemd service (postgresql@10-main) cannot be used anymore. It
|
||||
is possible to reload the Postgres configuration via `pg_ctlcluster 10 main
|
||||
reload', though.
|
||||
|
||||
Integration of vip-manager
|
||||
--------------------------
|
||||
|
||||
The vip-manager package allows to expose a virtual ip (VIP) for the leader node
|
||||
by monitoring the leader key in the DCS and setting or removing the configured
|
||||
VIP for the local node depending on leader status.
|
||||
|
||||
The Debian vip-manager package provides a /etc/patroni/vip.in template which
|
||||
can be used to write a vip-manager configuration for a patroni cluster via
|
||||
the --vip option:
|
||||
|
||||
# pg_createconfig_patroni --vip=10.0.1.1 10 main
|
||||
|
||||
Similarly to the patroni package, the vip-manager service can then be started
|
||||
via a systemd unit specific for the cluster:
|
||||
|
||||
# systemctl start vip-manager@10-main
|
||||
|
||||
Cluster Bootstrap
|
||||
-----------------
|
||||
|
||||
After Patroni is started on a node for a particular cluster, it tried to acquire
|
||||
the leader lock in the DCS. If it can acquire the lock, it will be the master of
|
||||
the cluster and bootstrap the instance. The pg_createconfig_patroni-generated
|
||||
configuration defines a custom bootstrap via the pg_createcluster_patroni
|
||||
script, which is a shell wrapper around the usual pg_createcluster utility.
|
||||
|
||||
The standby nodes cannot be bootstrapped this way, as the cluster id is
|
||||
unique and Patroni expects a single cluster id among all members. To this end,
|
||||
the pg_clonecluster_patroni shell script is provided, which sets up a cluster
|
||||
and then clones from the master node via pg_basebackup.
|
||||
|
||||
pg_hba.conf
|
||||
-----------
|
||||
|
||||
In order to have the identical pg_hba.conf on each cluster node, the default
|
||||
pg_hba.conf gets overwritten by the lines specified in the
|
||||
bootstrap.dcs.postgresql section of the Patroni configuration. By default,
|
||||
replication connections from the local network and regular password (md5) based
|
||||
connections from localhost are allowed.
|
||||
|
||||
pg_rewind and postgres password
|
||||
-------------------------------
|
||||
|
||||
By default, no postgres database password is set; i.e. the postgres superuser
|
||||
can only connect via the local socket. Likewise, pg_rewind is disabled (as
|
||||
pg_rewind requires remote superuser access) and Patroni will re-clone a former
|
||||
primary if its timeline has diverged from the cluster.
|
||||
|
||||
If pg_rewind is to be used, then the `bootstrap.use_pg_rewind' parameter in
|
||||
/etc/patroni/config.yml.in needs to be set to `true' and either the
|
||||
`postgresql.authentication.superuser.password' parameter needs to be set to the
|
||||
desired postgres password or (for PostgreSQL versions 11 and up) the
|
||||
`postgresql.authenticaion.rewind.{user,password}` needs to be set. If the
|
||||
`rewind` user is set, Patroni will grant it the necessary rights to run
|
||||
pg_rewind without superuser privileges. Finally, password (md5) connections
|
||||
need to be allowed on the local network.
|
748
debian/changelog
vendored
748
debian/changelog
vendored
|
@ -1,3 +1,751 @@
|
|||
patroni (3.0.1-2) UNRELEASED; urgency=medium
|
||||
|
||||
|
||||
-- Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org> Fri, 17 Feb 2023 09:34:22 +0100
|
||||
|
||||
patroni (3.0.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/control (Uploaders): Updated.
|
||||
|
||||
-- Michael Banck <mbanck@debian.org> Fri, 17 Feb 2023 09:33:48 +0100
|
||||
|
||||
patroni (3.0.0-1) unstable; urgency=medium
|
||||
|
||||
* New major upstream release.
|
||||
* debian/patches/acceptance_tests_system_patroni.patch: Refreshed.
|
||||
* debian/patches/avoid_overwriting_configuration_during_boostrap.patch:
|
||||
Likewise.
|
||||
* debian/tests/control: Add procps as dependency and skip DCS failsafe mode
|
||||
acceptance tests on zookeeper.
|
||||
* debian/patches/regression_tests_skip_citus_test.patch: New patch, skips
|
||||
the citus unit test for now as it fails on some configurations.
|
||||
* debian/control (Depends): Removed obsolete lsb-base.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Tue, 31 Jan 2023 22:27:24 +0100
|
||||
|
||||
patroni (2.1.7-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/acceptance_tests_reenable_etcdv2.patch: Removed, no longer
|
||||
needed.
|
||||
* debian/patches/compatibility_with_old_modules.patch: Likewise.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 23 Jan 2023 21:24:46 +0100
|
||||
|
||||
patroni (2.1.6-2) unstable; urgency=medium
|
||||
|
||||
[ Shengjing Zhu ]
|
||||
* debian/tests/acceptance: Ensure no etcd server is running before acceptance
|
||||
tests. Otherwise, acceptance tests can't spin up a new etcd server which
|
||||
uses the same port (Closes: #1027707).
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Sun, 08 Jan 2023 22:06:02 +0100
|
||||
|
||||
patroni (2.1.6-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/acceptance_tests_system_patroni.patch: Refreshed.
|
||||
* debian/patches/acceptance_tests_reenable_etcdv2.patch: New patch,
|
||||
re-enables V2 API on etcd-3.4 and later.
|
||||
* debian/tests/control: Add etcd3 behave test.
|
||||
* debian/patches/compatibility_with_old_modules.patch: New patch, fixes
|
||||
unit test failures with older modules, taken from upstream commit 442bd3f.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Wed, 04 Jan 2023 10:51:02 +0100
|
||||
|
||||
patroni (2.1.5-1) unstable; urgency=medium
|
||||
|
||||
* Team upload.
|
||||
* New upstream release.
|
||||
* Mark Consul test as skip-not-installable (not in testing, see #1017982).
|
||||
|
||||
-- Christoph Berg <myon@debian.org> Mon, 28 Nov 2022 13:07:28 +0100
|
||||
|
||||
patroni (2.1.4-3) unstable; urgency=medium
|
||||
|
||||
* Enable RAFT support and add python3-pysyncobj to dep alternatives.
|
||||
|
||||
-- Christoph Berg <myon@debian.org> Thu, 17 Nov 2022 16:14:33 +0100
|
||||
|
||||
patroni (2.1.4-2) unstable; urgency=medium
|
||||
|
||||
* Team upload.
|
||||
|
||||
[ Michael Banck ]
|
||||
* debian/patches/avoid_overwriting_configuration_during_boostrap.patch: New
|
||||
patch, avoids streaming a backup of the primary's postgresql.conf file
|
||||
during bootstrap, overwriting the standby's postgresql.base.conf and
|
||||
possible preventing PostgreSQL to start up.
|
||||
* debian/patches/acceptance_tests_speedup.patch: New patch, reduces loop_wait
|
||||
to 2 thus speeding up the behave tests, taken from upstream commit ead798.
|
||||
|
||||
[ Christoph Berg ]
|
||||
* Add a test using etcd running basic_replication.feature only, and mark the
|
||||
full tests as flaky. (Closes: #1017527)
|
||||
|
||||
-- Christoph Berg <myon@debian.org> Thu, 08 Sep 2022 17:04:35 +0200
|
||||
|
||||
patroni (2.1.4-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/pg_rewind_fix_get_guc_value.patch: Removed, no longer
|
||||
needed.
|
||||
* debian/control, debian/tests/control: Replaced python3-boto with
|
||||
python3-boto3.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Thu, 02 Jun 2022 16:58:10 +0200
|
||||
|
||||
patroni (2.1.3-3) unstable; urgency=medium
|
||||
|
||||
* debian/patches/regression_tests_disable_raft_tests.py: Drop unrelated
|
||||
etcd3 validator removal, pointed out by Kirill Petrov.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 29 Apr 2022 19:17:12 +0200
|
||||
|
||||
patroni (2.1.3-2) unstable; urgency=medium
|
||||
|
||||
* debian/patches/pg_rewind_fix_get_guc_value.patch: New patch, changes the
|
||||
pg_rewind calling behaviour so that it can deal with postgresql.conf not
|
||||
being in the data directory; taken from upstream commit 7626b5f by Nick
|
||||
Bluth.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Thu, 24 Mar 2022 22:22:16 +0100
|
||||
|
||||
patroni (2.1.3-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/regression_tests_disable_requirement_download.patch:
|
||||
Removed, no longer needed.
|
||||
* debian/patches/regression_tests_psutil_compat.patch: Likewise.
|
||||
* debian/config.yml.in: Update configuration:
|
||||
- Set use_pg_rewind, use_slots and check_timeline to true.
|
||||
- Update comments and formatting.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 18 Feb 2022 22:16:13 +0100
|
||||
|
||||
patroni (2.1.2-3) unstable; urgency=medium
|
||||
|
||||
* debian/patches/regression_tests_psutil_compat.patch: New patch, add
|
||||
compatibility for newer psutil in the regression tests (Closes: #1003562).
|
||||
* debian/changelog: Fix whitespace.
|
||||
* debian/tests/acceptance: Skip standby_cluster/logical_slots_in_sync
|
||||
scenario on v10, as it is not supported there.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Tue, 15 Feb 2022 23:06:15 +0100
|
||||
|
||||
patroni (2.1.2-2) unstable; urgency=medium
|
||||
|
||||
* Team upload.
|
||||
* debian/clean: Remove patroni.egg-info/.
|
||||
* debian/py3dist-overrides: Tell dh_python3 to find "ipaddress" in python3
|
||||
>= 3.3.
|
||||
* debian/tests/control: Mark zookeeper test as skip-not-installable.
|
||||
* debian/tests/acceptance: `set -o pipefail` so failures aren't masked by
|
||||
`ts`.
|
||||
|
||||
-- Christoph Berg <myon@debian.org> Wed, 22 Dec 2021 15:22:09 +0100
|
||||
|
||||
patroni (2.1.2-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
|
||||
[ Christoph Berg ]
|
||||
* patroni@.service: Remove redundant (and broken) WorkingDirectory.
|
||||
Thanks Ludovic Gasc!
|
||||
* debian/tests/control: Give Test-Commands meaningful names.
|
||||
|
||||
[ Michael Banck ]
|
||||
* debian/patches/acceptance_tests_system_patroni.patch: Refreshed.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 03 Dec 2021 17:13:13 +0100
|
||||
|
||||
patroni (2.1.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/regression_tests_disable_raft_tests.py: Refreshed.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 20 Aug 2021 10:53:23 +0200
|
||||
|
||||
patroni (2.1.0-1) experimental; urgency=medium
|
||||
|
||||
* New upstream major release. New features:
|
||||
+ Compatibility with PostgreSQL v14
|
||||
+ Failover logical slots
|
||||
+ Allowlist for Patroni REST API
|
||||
+ Support of replication connections via unix socket
|
||||
+ Health check on user-defined tags
|
||||
+ Prometheus /metrics endpoint
|
||||
+ Reduced chattiness of Patroni logs
|
||||
* debian/patches/regression_tests_disable_requirement_download.patch:
|
||||
Refreshed.
|
||||
* debian/patches/requirements_cdiff.patch: Likewise.
|
||||
* debian/patches/requirements_setuptools.patch: Likewise.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 09 Jul 2021 16:58:39 +0200
|
||||
|
||||
patroni (2.0.2-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/acceptance_tests_system_patroni.patch: Refreshed.
|
||||
* debian/patches/regression_tests_disable_requirement_download.patch:
|
||||
Likewise.
|
||||
* debian/patches/regression_tests_disable_raft_tests.py: New patch, reverts
|
||||
upstream commit 3a87d0e.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Thu, 04 Mar 2021 08:59:40 +0100
|
||||
|
||||
patroni (2.0.1-3) unstable; urgency=medium
|
||||
|
||||
* debian/pg_clonecluster_patroni: Supress pg_createcluster output as it can
|
||||
be misleading.
|
||||
* debian/pg_clonecluster_patroni: Remove postgresql.base.conf before running
|
||||
pg_dropcluster.
|
||||
* debian/config.yml.in: Make base data directory a template variable
|
||||
@DATADIR_BASE@.
|
||||
* debian/pg_createconfig_patroni: Use data_directory setting from
|
||||
/etc/postgresql-common/createcluster.conf as DATADIR_BASE if set.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 22 Jan 2021 12:45:15 +0100
|
||||
|
||||
patroni (2.0.1-2) unstable; urgency=medium
|
||||
|
||||
* debian/tests/control: Added moreutils to acceptance-test Depends.
|
||||
* debian/tests/acceptance: Pipe test outputs to ts in oder to
|
||||
display timestamps.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Thu, 10 Dec 2020 13:33:18 +0100
|
||||
|
||||
patroni (2.0.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream major release.
|
||||
* debian/README.Debian: Add note about rewind user.
|
||||
* debian/patches/offline_intersphinx.patch: Refreshed.
|
||||
* debian/patches/requirements_setuptools.patch: Refreshed.
|
||||
* debian/patches/startup_scripts.patch: Refreshed.
|
||||
* debian/control (patroni/Depends): Added python3-cdiff.
|
||||
* debian/patches/regression_tests_disable_requirement_download.patch: New
|
||||
patch, disables downloading python packages during regression tests.
|
||||
* debian/tests/test: Remove Raft tests for now (not yet packaged pysyncobj
|
||||
module).
|
||||
* debian/patches/requirements_cdiff.patch: New patches, changes ydiff (not
|
||||
yet packaged python module) back to cdiff in requirements.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Tue, 06 Oct 2020 18:10:10 +0200
|
||||
|
||||
patroni (1.6.5-5) unstable; urgency=medium
|
||||
|
||||
[ Dominik George ]
|
||||
* debian/pg_createconfig_patroni: Correctly determine prefix length
|
||||
in $NETWORK.
|
||||
|
||||
[ Michael Banck ]
|
||||
* debian/config.yml.in: Listen to all interfaces by default.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Wed, 26 Aug 2020 15:33:04 +0200
|
||||
|
||||
patroni (1.6.5-4) unstable; urgency=medium
|
||||
|
||||
* debian/config.yml, debian/dcs.yml: Update example consul configuration,
|
||||
addresses upstream issue #1574.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Wed, 03 Jun 2020 16:10:59 +0200
|
||||
|
||||
patroni (1.6.5-3) unstable; urgency=medium
|
||||
|
||||
* debian/pg_clonecluster_patroni: Always use explicit pg_basebackup version,
|
||||
in case more than one major version of PostgreSQL is installed.
|
||||
* debian/config.yml.in: Add commented out section on a rewind user, that can
|
||||
be used on PostgreSQL 11+ to run pg_rewind as a non-superuser.
|
||||
* debian/pg_createconfig_patroni: Parse multiple DCS endpoints correctly,
|
||||
patch by Tomas Pospisek (Closes: #953197).
|
||||
* debian/tests/acceptance: Start zookeeper manually.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 08 May 2020 21:06:58 +0200
|
||||
|
||||
patroni (1.6.5-2) unstable; urgency=medium
|
||||
|
||||
* debian/pg_createconfig_patroni: Allow re-creating configuration file for
|
||||
already existing clusters/ports, patch by Tomas Pospisek (Closes: #953162).
|
||||
* debian/pg_createcluster_patroni: Pass $DATADIR variable to pg_createcluster
|
||||
if specified.
|
||||
* debian/patroni@.service: Append scope to syslog identifier.
|
||||
* debian/pg_clonecluster_patroni: Pass $DATADIR variable to pg_createcluster.
|
||||
* debian/config.yml.in: Add some comments about option passing for
|
||||
pg_createcluster_patroni/pg_clonecluster_patroni.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Thu, 07 May 2020 13:41:32 +0200
|
||||
|
||||
patroni (1.6.5-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/fix_failing_tests.patch: Removed, no longer needed.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 27 Apr 2020 18:24:43 +0200
|
||||
|
||||
patroni (1.6.4-2) unstable; urgency=medium
|
||||
|
||||
* debian/pg_clonecluster_patroni: quote connstr in pg_createcluster
|
||||
invocation (Closes: #953623).
|
||||
* debian/pg_createconfig_patroni: remove vip-manager file before appending
|
||||
to it, patch by Tomas Pospisek (Closes: #953147).
|
||||
* debian/pg_createconfig_patroni: Improve parsing of pg_lsclusters output
|
||||
when determining port number, patch by Tomas Pospisek (Closes: #953157).
|
||||
* debian/tests/acceptance: Set ETCD_UNSUPPORTED_ARCH to arm/arm64 according
|
||||
to $DEB_HOST_ARCH (Closes: #952535).
|
||||
* debian/config.yml.in: Add commented-out exemplary bootstrap/initdb and
|
||||
bootstrap/users sections.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Sat, 28 Mar 2020 10:19:53 +0100
|
||||
|
||||
patroni (1.6.4-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/check_postmaster.patch: Removed.
|
||||
* debian/patches/acceptance_tests_system_patroni.patch: Refreshed.
|
||||
* debian/patches/v12_fix_recovery.conf_parameters.patch: Removed, no longer
|
||||
needed.
|
||||
* debian/patches/urlparse_compat.patch: Removed, no longer needed.
|
||||
* debian/patches/fix_failing_tests.patch: New patch, fixes a failing
|
||||
regression test case.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 10 Feb 2020 10:01:27 +0100
|
||||
|
||||
patroni (1.6.3-2) unstable; urgency=medium
|
||||
|
||||
* debian/patches/v12_fix_recovery.conf_parameters.patch: New patch, fixes a
|
||||
regression in Patroni 1.6.{1-3} where setting restore_command in
|
||||
postgresql.conf no longer worked.
|
||||
* debian/tests/control: Strip down depends to test-related packages.
|
||||
* debian/patches/requirements_setuptools.patch: New patch, add setuptools to
|
||||
requirements, so that python3-pkg-resources is picked up as package
|
||||
dependency by dh_python3.
|
||||
* debian/patches/offline_intersphinx.patch: New patch, force usage of offline
|
||||
objects.inv from python-doc package instead of downloading it (Closes:
|
||||
#941127).
|
||||
* debian/control (Build-Depends): Added python3-doc.
|
||||
* debian/patches/urlparse_compat.patch: New patch, fixes a regression test
|
||||
suite failure due to a behaviour change in python3's urlparse, taken from
|
||||
upstream pull request #1368.
|
||||
* debian/pg_createcluster_patroni: Allow clusternames with multiple dashes,
|
||||
patch by Chris Hofstaedtler (Closes: #946156).
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 24 Jan 2020 10:08:04 +0100
|
||||
|
||||
patroni (1.6.3-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/consul_import.patch: Removed, applied upstream.
|
||||
* debian/patches/acceptance_tests_timeouts.patch: Likewise.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Tue, 10 Dec 2019 22:35:17 +0100
|
||||
|
||||
patroni (1.6.1-2) unstable; urgency=medium
|
||||
|
||||
* debian/pg_createconfig_patroni: Add --endpoint option for explicit setting
|
||||
of VIP_ENDPOINT, make dcs.yml parsing a bit more robust and add sanity
|
||||
checking for VIP_ENDPOINT.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Sat, 16 Nov 2019 15:44:09 +0100
|
||||
|
||||
patroni (1.6.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/check_postmaster.patch: Refreshed.
|
||||
* debian/patches/avoid_distutils_spawn.patch: Removed, no longer needed.
|
||||
* debian/patches/disable_postgresql.conf_chmod.patch: Likewise.
|
||||
* debian/pg_createconfig_patroni: Add --vip option and write out a
|
||||
vip-manager configuration if present.
|
||||
* debian/config.yml.in: Add @LISTEN_VIP@ tag.
|
||||
* debian/control: Add vip-manager to Suggests.
|
||||
* debian/README.Debian: Add section on vip-manager integration.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 15 Nov 2019 19:49:30 +0100
|
||||
|
||||
patroni (1.6.0-4) unstable; urgency=medium
|
||||
|
||||
* debian/patches/avoid_distutils_spawn.patch: New patch, implements
|
||||
find_executable() method and drops import of distutils.spawn.
|
||||
* debian/control (patroni/Depends): Removed python3-distutils.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Tue, 08 Oct 2019 12:58:22 +0200
|
||||
|
||||
patroni (1.6.0-3) unstable; urgency=medium
|
||||
|
||||
* debian/control (patroni/Depends): Added python3-distutils.
|
||||
* debian/patches/acceptance_tests_timeouts.patch: New patch, increases a
|
||||
timeout of an often failing autopkgtest test.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 07 Oct 2019 20:41:25 +0200
|
||||
|
||||
patroni (1.6.0-2) unstable; urgency=medium
|
||||
|
||||
* debian/control: Recommend iproute2.
|
||||
* debian/pg_createconfig_patroni: Exit gracefully if iproute2 is not
|
||||
installed.
|
||||
* debian/patches/disable_postgresql.conf_chmod.patch: New patch, disables
|
||||
setting the postgresql.conf permissions to 600, reported by Peter J.
|
||||
Holzer.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 20 Sep 2019 20:29:43 +0200
|
||||
|
||||
patroni (1.6.0-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/check_postmaster.patch: Updated.
|
||||
* debian/control (Depends): Added python3-psycopg2.
|
||||
* debian/tests/control: Added python3-psycopg2.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Wed, 21 Aug 2019 13:17:41 +0200
|
||||
|
||||
patroni (1.5.6-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/check_postmaster.patch: Refreshed.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Sun, 16 Jun 2019 23:42:07 +0200
|
||||
|
||||
patroni (1.5.5-2) unstable; urgency=medium
|
||||
|
||||
* debian/pg_createconfig_patroni: Filter out comments from
|
||||
/etc/patroni/dcs.yml when assembling the Patroni configuration file
|
||||
(Closes: #930016).
|
||||
* debian/pg_createconfig_patroni: Fix determination of host IP/network if `ip
|
||||
route get' reports additional output (Closes: #930015).
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 07 Jun 2019 13:11:18 +0200
|
||||
|
||||
patroni (1.5.5-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* debian/patches/behave_failure_logging.patch: Removed, applied upstream.
|
||||
* debian/patches/acceptance_tests_coverage_binary.patch: Likewise.
|
||||
* debian/patches/automatic_primary_reinit.patch: Likewise.
|
||||
* debian/patches/automatic_primary_reinit.patch: Likewise.
|
||||
* debian/patches/patronictl_timeline_info.patch: Likewise.
|
||||
* debian/patches/acceptance_tests_postgres_port.patch: Likewise.
|
||||
* debian/patches/fix_replication_connection.patch: Likewise.
|
||||
* debian/patches/consul_import.patch: Refreshed.
|
||||
* debian/patches/reclone-unable-pg_rewind.patch: Removed, no longer needed.
|
||||
* debian/config.yml.in: Set use_pg_rewind to false again.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Sat, 16 Feb 2019 07:30:02 +0100
|
||||
|
||||
patroni (1.5.4-8) unstable; urgency=medium
|
||||
|
||||
* debian/pg_createconfig_patroni: Remove debugging output and fix premature
|
||||
exit.
|
||||
* debian/patches/acceptance_tests_coverage_binary.patch: Updated according to
|
||||
upstream feedback.
|
||||
* debian/patches/behave_failure_logging.patch: Likewise.
|
||||
* debian/patches/acceptance_tests_postgres_port.patch: Refreshed.
|
||||
* debian/patches/acceptance_tests_system_patroni.patch: Likewise.
|
||||
* debian/patches/reclone-unable-pg_rewind.patch: New patch, reclones from the
|
||||
primary if use_pg_rewind and remove_data_directory_on_rewind_failure are
|
||||
set, but the postgres password is empty.
|
||||
* debian/config.yml.in: Set remove_data_directory_on_rewind_failure and
|
||||
use_pg_rewind to true.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 08 Feb 2019 17:44:53 +0100
|
||||
|
||||
patroni (1.5.4-7) unstable; urgency=medium
|
||||
|
||||
* debian/pg_createconfig_patroni: Remove --scope option in favor of
|
||||
pg_createcluster's regular "[options] <version> <cluster name>" syntax.
|
||||
* debian/README.Debian: Updated accordingly.
|
||||
* debian/patches/sphinx_no_mathjax.patch: Removed, no longer needed.
|
||||
* debian/patches/coverage_binary.patch: Removed, and replaced with ...
|
||||
* debian/patches/acceptance_tests_coverage_binary.patch: ... this patch,
|
||||
which is generally applicable.
|
||||
* debian/patches/acceptance_tests_system_patroni.patch: Refreshed.
|
||||
* debian/patches/acceptance_tests_postgres_port.patch: Likewise.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Thu, 07 Feb 2019 18:13:05 +0100
|
||||
|
||||
patroni (1.5.4-6) unstable; urgency=medium
|
||||
|
||||
* debian/tests/acceptance: Fix DCS check for zookeeper in case etcd-server is
|
||||
installed as well.
|
||||
* debian/pg_createconfig_patroni: Determine Patroni API port dynamically and
|
||||
add @API_PORT@ substitution.
|
||||
* debian/config.yml.in: Replace API port by @API_PORT@.
|
||||
* debian/tests/acceptance: Set shell to bash.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 04 Feb 2019 21:12:00 +0100
|
||||
|
||||
patroni (1.5.4-5) unstable; urgency=medium
|
||||
|
||||
* debian/config.yml.in: Set postgresql.pgpass option and add a commented-out
|
||||
pg_hba line for md5 connections from the local network.
|
||||
* debian/tests/control: Use `Test-Command' directive with relative path
|
||||
instead of `Tests' and pass it the DCS as argument.
|
||||
* debian/tests/acceptance: Set DCS variable as provided by the command-line
|
||||
argument.
|
||||
* debian/README.Debian: Add sections on pg_hba.conf and pg_rewind/postgres
|
||||
database password.
|
||||
* debian/config.yml.in: Create pgpass file under /var/lib/postgresql.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 04 Feb 2019 12:15:11 +0100
|
||||
|
||||
patroni (1.5.4-4) unstable; urgency=medium
|
||||
|
||||
* debian/pg_clonecluster_patroni: Create stub instance with start.conf set to
|
||||
manual instead of disabled, in lines with pg_creatcluster_patroni.
|
||||
* debian/config.yml.in: Make PostgreSQL to also listen to 127.0.0.1 by
|
||||
default.
|
||||
* debian/patches/fix_replication_connection.patch: New patch, fixes the
|
||||
initiation of replication connections for version 10 and up, taken from
|
||||
proposed upstream commit e285e159.
|
||||
* debian/config.yml.in: Set pg_hba in bootstrap.dcs.postgresql section. This
|
||||
way, it will be picked up by replicas as well. As the pg_hba.conf file is
|
||||
created from scratch in this case, also add the default values.
|
||||
* debian/tests/acceptance: Wait 5 seconds after starting zookeeper.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Tue, 29 Jan 2019 11:22:26 +0100
|
||||
|
||||
patroni (1.5.4-3) unstable; urgency=medium
|
||||
|
||||
[ Christoph Berg ]
|
||||
* Remove myself from uploaders.
|
||||
|
||||
[ Michael Banck ]
|
||||
* debian/patches/patronictl_timeline_info.patch: New patch, shows timeline
|
||||
information in patronictl list, taken from proposed upstream commit
|
||||
fcc28c1b.
|
||||
* debian/patches/automatic_primary_reinit.patch: New patch, allows to
|
||||
automatically reinit a former primary if a rewind is not possible, taken
|
||||
from proposed upstream commit 3a509cab.
|
||||
* debian/patches/acceptance_tests_postgres_port.patch: New patch, set base
|
||||
port for acceptance tests to 5420 in order not to conflict with possible
|
||||
system clusters.
|
||||
* debian/tests/acceptance: Set JAVA_OPTS to "-Djava.net.preferIPv4Stack=true"
|
||||
in /etc/default/zookeepr if DCS is zookeeper.
|
||||
* debian/config.yml.in: Set use_pg_rewind to false and add
|
||||
remove_data_directory_on_diverged_timelines option.
|
||||
* debian/tests/acceptance: Add support for consul as DCS.
|
||||
* debian/tests/control: Add additional acceptance tests runs with zookeeper
|
||||
and consul as DCS.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Sun, 27 Jan 2019 14:21:26 +0100
|
||||
|
||||
patroni (1.5.4-2) unstable; urgency=medium
|
||||
|
||||
* debian/config.yml.in: Remove DCS-related commented-out lines and replace
|
||||
them with @DCS_CONFIG@ placeholder.
|
||||
* debian/pg_createconfig_patroni: Load DCS configuration into $DCS_CONFIG
|
||||
variable and replace both @HOSTNAME@ and @DCS_CONFIG@ placeholders in
|
||||
config template.
|
||||
* debian/config.yml.in: Commented out pgpass directive.
|
||||
* debian/pg_createcluster_patroni: Put clusters in manual mode, rather than
|
||||
disabled mode during creation.
|
||||
* debian/pg_createconfig_patroni: Add support for --network switch and set
|
||||
$NETWORK variable to local network if not set.
|
||||
* debian/config.yml.in: Allow replication and client connections from
|
||||
@NETWORK@ network.
|
||||
* debian/README.Debian: Updated.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 21 Jan 2019 17:10:33 +0100
|
||||
|
||||
patroni (1.5.4-1) unstable; urgency=medium
|
||||
|
||||
* New upstream point release.
|
||||
* debian/patches/acceptance_tests_system_patroni.patch: Refreshed.
|
||||
* debian/patches/behave_failure_logging.patch: Likewise.
|
||||
* debian/patches/check_postmaster.patch: Likewise.
|
||||
* debian/patches/consul_import.patch: Likewise.
|
||||
* debian/patches/coverage_binary.patch: Likewise.
|
||||
* debian/README.Debian: New file (Closes: #916186).
|
||||
* debian/config.yml.in: Add @PORT@ option.
|
||||
* debian/pg_createconfig_patroni: Add --port option and automatically assign
|
||||
the next free pg-common port if not specified.
|
||||
* debian/pg_createconfig_patroni: Make sure $HOSTIP has no spaces.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Tue, 15 Jan 2019 19:12:15 +0100
|
||||
|
||||
patroni (1.5.3-2) unstable; urgency=medium
|
||||
|
||||
* debian/pg_createconfig_patroni: Set owner of Patroni configuration file to
|
||||
postgres.
|
||||
* debian/config.yml.in: Updated with more comments and using the postgres
|
||||
user with local sockets as default mode.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 14 Jan 2019 22:28:41 +0100
|
||||
|
||||
patroni (1.5.3-1) unstable; urgency=medium
|
||||
|
||||
* New upstream point release.
|
||||
|
||||
[ Michael Banck ]
|
||||
* debian/patches/startup_scripts.patch: Split out patroni@.service into ...
|
||||
* debian/patroni@.service: ... this.
|
||||
* debian/patroni.install: Adjusted.
|
||||
* debian/patroni@.service: Set environment file to /etc/patroni/env.conf.
|
||||
|
||||
[ Christoph Berg ]
|
||||
* Use shared gitlab-ci.yml file from postgresql-common.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 14 Jan 2019 12:24:42 +0100
|
||||
|
||||
patroni (1.5.1-2) unstable; urgency=medium
|
||||
|
||||
* debian/pg_createconfig_patroni: Make variable-substitution globally.
|
||||
* debian/pg_createcluster_patroni, debian/pg_clonecluster_patroni: Set
|
||||
start mode to disabled.
|
||||
* debian/patches/startup_scripts.patch: Add RuntimeDirectory option, set to
|
||||
create the instance temporary statistics direcotry %v-%c.pg_stat_tmp.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Sat, 10 Nov 2018 18:36:25 +0100
|
||||
|
||||
patroni (1.5.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
|
||||
[ Michael Banck ]
|
||||
* debian/patches/behave_failure_logging.patch: Refreshed.
|
||||
* debian/patches/consul_import.patch: Likewise.
|
||||
* debian/patches/coverage_binary.patch: Likewise.
|
||||
* debian/patches/startup_scripts.patch: Likewise.
|
||||
* debian/pg_createconfig_patroni: New script.
|
||||
* debian/dcs.yml, debian/config.yml.in: New configuration templates.
|
||||
* debian/patroni.install: Install new script to /usr/bin and configuration
|
||||
templates to /etc/patroni.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 05 Nov 2018 08:49:46 +0100
|
||||
|
||||
patroni (1.5.0-12) unstable; urgency=medium
|
||||
|
||||
* debian/patroni.install: Install binaries as well.
|
||||
* debian/patches/acceptance_tests_system_patroni.patch: New patch, use the
|
||||
system installed patroni for acceptance tests.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 02 Nov 2018 19:21:54 +0100
|
||||
|
||||
patroni (1.5.0-11) unstable; urgency=medium
|
||||
|
||||
* debian/patroni.install: Install debian/tmp/usr/lib into patroni package.
|
||||
* debian/pg_clonecluster_patroni, debian/pg_createcluster_patroni: Support
|
||||
both '/' and '-' as version/clustername separator.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 26 Oct 2018 14:47:09 +0100
|
||||
|
||||
patroni (1.5.0-10) unstable; urgency=medium
|
||||
|
||||
* debian/control (patroni-doc): New package.
|
||||
* debian/patroni.install: Move installation of HTML documentation to ...
|
||||
* debian/patroni-doc.install: ... this new file.
|
||||
* debian/rules (override_dh_installinit): Install init scripts in
|
||||
patroni package only.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 26 Oct 2018 12:43:07 +0100
|
||||
|
||||
patroni (1.5.0-9) unstable; urgency=medium
|
||||
|
||||
* debian/patches/startup_scripts.patch: Add patroni service template
|
||||
patroni@.service.
|
||||
* debian/patroni.install: Install it.
|
||||
* debian/pg_createcluster_patroni, debian/pg_clonecluster_patroni: New files,
|
||||
wrapper scripts that can be used for Patroni bootstrap or standby setup.
|
||||
* debian/patroni.install: Install them in /usr/share/patroni.
|
||||
* debian/control (Depends): Replace python3-sphinx-rtd-theme and
|
||||
libjs-sphinxdoc with ${sphinxdoc:Depends}.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 22 Oct 2018 18:56:11 +0200
|
||||
|
||||
patroni (1.5.0-8) unstable; urgency=medium
|
||||
|
||||
* debian/control (Depends): Added python3-sphinx-rtd-theme and
|
||||
libjs-sphinxdoc (Closes: #910427).
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Sat, 06 Oct 2018 11:57:03 +0200
|
||||
|
||||
patroni (1.5.0-7) unstable; urgency=medium
|
||||
|
||||
* debian/control (Depends): Add explicit Depends on one of the DCS client
|
||||
modules (python3-etcd, python3-consul, python3-kazoo and
|
||||
python3-kubernetes) with python3-etcd as first option.
|
||||
* debian/tests/acceptance: Add ETCD_UNSUPPORTED_ARCH=386 to invocation for
|
||||
i386.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 05 Oct 2018 12:20:40 +0200
|
||||
|
||||
patroni (1.5.0-6) unstable; urgency=medium
|
||||
|
||||
* debian/config.yml: Updated with recent changes from upstream config
|
||||
example.
|
||||
* debian/patches/patroni_service.patch: Removed, and folded into ...
|
||||
* debian/patches/startup_scripts.patch: ... this.
|
||||
* debian/patroni.dirs: New file, create /etc/patroni directory.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Mon, 01 Oct 2018 15:10:02 +0200
|
||||
|
||||
patroni (1.5.0-5) unstable; urgency=medium
|
||||
|
||||
* debian/patches/check_postmaster.patch: Update unit tests as well.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Wed, 26 Sep 2018 16:08:50 +0200
|
||||
|
||||
patroni (1.5.0-4) unstable; urgency=medium
|
||||
|
||||
* debian/gitlab-ci.yml: Updated.
|
||||
* debian/patches/check_postmaster.patch: New patch, replaces the process
|
||||
creation time check for postmaster presense with sending signal 0, similar
|
||||
to what pg_ctl does. Closes: #909532.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Wed, 26 Sep 2018 14:27:50 +0200
|
||||
|
||||
patroni (1.5.0-3) unstable; urgency=medium
|
||||
|
||||
* debian/gitlab-ci.yml: New file.
|
||||
* debian/patches/behave_failure_logging.patch: New patch, copy over output
|
||||
directory of a failed feature with `_failed' at the end.
|
||||
* debian/tests/acceptance: Dump logs for failed features.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Tue, 25 Sep 2018 15:45:04 +0200
|
||||
|
||||
patroni (1.5.0-2) unstable; urgency=medium
|
||||
|
||||
* debian/tests/acceptance: Run all tests again.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Sun, 23 Sep 2018 12:40:53 +0200
|
||||
|
||||
patroni (1.5.0-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
|
||||
[ Christoph Berg ]
|
||||
* Mention Kubernetes in description.
|
||||
|
||||
[ Michael Banck ]
|
||||
* debian/patches/relax_requirements.patch: Removed, no longer needed.
|
||||
* debian/patches/python3.7: Likewise.
|
||||
* debian/patches/coverage_binary.patch: Refreshed.
|
||||
* debian/patches/startup_scripts.patch: Likewise.
|
||||
|
||||
-- Michael Banck <michael.banck@credativ.de> Fri, 21 Sep 2018 11:40:46 +0200
|
||||
|
||||
patroni (1.4.4-2) unstable; urgency=medium
|
||||
|
||||
* Move maintainer address to team+postgresql@tracker.debian.org.
|
||||
* Avoid using "async" which is a keyword in python3.7. Closes: #904369.
|
||||
|
||||
-- Christoph Berg <myon@debian.org> Tue, 24 Jul 2018 20:45:19 +0200
|
||||
|
||||
patroni (1.4.4-1) unstable; urgency=medium
|
||||
|
||||
* Team upload.
|
||||
* New upstream version.
|
||||
* Run first basic replication test only.
|
||||
|
||||
-- Christoph Berg <myon@debian.org> Mon, 04 Jun 2018 23:16:20 +0200
|
||||
|
||||
patroni (1.4.3-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version.
|
||||
* Add python3-coverage to acceptance test depends.
|
||||
Reported by Matthias Klose, thanks! Closes: #894235.
|
||||
|
||||
-- Christoph Berg <christoph.berg@credativ.de> Fri, 06 Apr 2018 12:13:27 +0200
|
||||
|
||||
patroni (1.4.2-2) unstable; urgency=medium
|
||||
|
||||
* Team upload.
|
||||
|
|
1
debian/clean
vendored
Normal file
1
debian/clean
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
patroni.egg-info/
|
16
debian/config.yml
vendored
16
debian/config.yml
vendored
|
@ -11,12 +11,16 @@ restapi:
|
|||
# username: username
|
||||
# password: password
|
||||
|
||||
# ctl:
|
||||
# insecure: false # Allow connections to SSL sites without certs
|
||||
# certfile: /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||
# cacert: /etc/ssl/certs/ssl-cacert-snakeoil.pem
|
||||
|
||||
#etcd:
|
||||
# host: 127.0.0.1:2379
|
||||
|
||||
#consul:
|
||||
# host: http://127.0.0.1:8500
|
||||
# host: https://127.0.0.1:8500
|
||||
# host: 127.0.0.1:8500
|
||||
|
||||
zookeeper:
|
||||
hosts: 127.0.0.1:2181
|
||||
|
@ -31,6 +35,10 @@ bootstrap:
|
|||
maximum_lag_on_failover: 1048576
|
||||
# master_start_timeout: 300
|
||||
# synchronous_mode: false
|
||||
# standby_cluster:
|
||||
# host: 127.0.0.1
|
||||
# port: 1111
|
||||
# primary_slot_name: patroni
|
||||
postgresql:
|
||||
use_pg_rewind: true
|
||||
# use_slots: true
|
||||
|
@ -38,8 +46,8 @@ bootstrap:
|
|||
# wal_level: hot_standby
|
||||
# hot_standby: "on"
|
||||
# wal_keep_segments: 8
|
||||
# max_wal_senders: 5
|
||||
# max_replication_slots: 5
|
||||
# max_wal_senders: 10
|
||||
# max_replication_slots: 10
|
||||
# wal_log_hints: "on"
|
||||
# archive_mode: "on"
|
||||
# archive_timeout: 1800s
|
||||
|
|
140
debian/config.yml.in
vendored
Normal file
140
debian/config.yml.in
vendored
Normal file
|
@ -0,0 +1,140 @@
|
|||
scope: "@VERSION@-@CLUSTER@"
|
||||
namespace: "/postgresql-common/"
|
||||
name: @HOSTNAME@
|
||||
|
||||
@DCS_CONFIG@
|
||||
|
||||
restapi:
|
||||
listen: @HOSTIP@:@API_PORT@
|
||||
connect_address: @HOSTIP@:@API_PORT@
|
||||
# certfile: /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||
# keyfile: /etc/ssl/private/ssl-cert-snakeoil.key
|
||||
# authentication:
|
||||
# username: username
|
||||
# password: password
|
||||
|
||||
# ctl:
|
||||
# insecure: false # Allow connections to SSL sites without certs
|
||||
# certfile: /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||
# cacert: /etc/ssl/certs/ssl-cacert-snakeoil.pem
|
||||
|
||||
bootstrap:
|
||||
# Custom bootstrap method
|
||||
# The options --scope= and --datadir= are passed to the custom script by
|
||||
# patroni and passed on to pg_createcluster by pg_createcluster_patroni
|
||||
method: pg_createcluster
|
||||
pg_createcluster:
|
||||
command: /usr/share/patroni/pg_createcluster_patroni
|
||||
|
||||
# This section will be written into /<namespace>/<scope>/config after
|
||||
# initializing a new cluster and all other cluster members will use it as a
|
||||
# `global configuration`
|
||||
dcs:
|
||||
ttl: 30
|
||||
loop_wait: 10
|
||||
retry_timeout: 10
|
||||
maximum_lag_on_failover: 1048576
|
||||
check_timeline: true
|
||||
# master_start_timeout: 300
|
||||
# synchronous_mode: false
|
||||
# standby_cluster:
|
||||
# host: 127.0.0.1
|
||||
# port: 1111
|
||||
# primary_slot_name: patroni
|
||||
postgresql:
|
||||
use_pg_rewind: true
|
||||
remove_data_directory_on_rewind_failure: true
|
||||
remove_data_directory_on_diverged_timelines: true
|
||||
use_slots: true
|
||||
# The following parameters are given as command line options
|
||||
# overriding the settings in postgresql.conf.
|
||||
parameters:
|
||||
# wal_level: hot_standby
|
||||
# hot_standby: "on"
|
||||
# wal_keep_segments: 8
|
||||
# max_wal_senders: 10
|
||||
# max_replication_slots: 10
|
||||
# max_worker_processes = 8
|
||||
# wal_log_hints: "on"
|
||||
# track_commit_timestamp = "off"
|
||||
# recovery_conf:
|
||||
# restore_command: cp ../wal_archive/%f %p
|
||||
# Set pg_hba.conf to the following values after bootstrapping or cloning.
|
||||
# If you want to allow regular connections from the local network, or
|
||||
# want to use pg_rewind, you need to uncomment the fourth entry.
|
||||
pg_hba:
|
||||
- local all all peer
|
||||
- host all all 127.0.0.1/32 md5
|
||||
- host all all ::1/128 md5
|
||||
# - host all all @NETWORK@ md5
|
||||
- local replication all peer
|
||||
- host replication all 127.0.0.1/32 md5
|
||||
- host replication all ::1/128 md5
|
||||
- host replication all @NETWORK@ md5
|
||||
# # Some possibly desired options for 'initdb'. Note: It needs to be a list
|
||||
# # (some options need values, others are # switches)
|
||||
# initdb:
|
||||
# - encoding: UTF8
|
||||
# - data-checksums
|
||||
|
||||
# # Additional script to be launched after initial cluster creation (will be
|
||||
# # passed the connection URL as parameter)
|
||||
# post_init: /usr/local/bin/setup_cluster.sh
|
||||
|
||||
# # Additional users to be created after initializing the cluster
|
||||
# users:
|
||||
# foo:
|
||||
# password: bar
|
||||
# options:
|
||||
# - createrole
|
||||
# - createdb
|
||||
|
||||
postgresql:
|
||||
# Custom clone method
|
||||
# The options --scope= and --datadir= are passed to the custom script by
|
||||
# patroni and passed on to pg_createcluster by pg_clonecluster_patroni
|
||||
create_replica_method:
|
||||
- pg_clonecluster
|
||||
pg_clonecluster:
|
||||
command: /usr/share/patroni/pg_clonecluster_patroni
|
||||
|
||||
# Listen to all interfaces by default, this makes vip-manager work
|
||||
# out-of-the-box without having to set net.ipv4.ip_nonlocal_bind or similar.
|
||||
# If you prefer to only listen on some interfaces, edit the below:
|
||||
# listen: "@HOSTIP@@LISTEN_VIP@,127.0.0.1:@PORT@"
|
||||
listen: "*:@PORT@"
|
||||
connect_address: @HOSTIP@:@PORT@
|
||||
use_unix_socket: true
|
||||
# Default Debian/Ubuntu directory layout
|
||||
data_dir: @DATADIR_BASE@/@VERSION@/@CLUSTER@
|
||||
bin_dir: /usr/lib/postgresql/@VERSION@/bin
|
||||
config_dir: /etc/postgresql/@VERSION@/@CLUSTER@
|
||||
pgpass: /var/lib/postgresql/@VERSION@-@CLUSTER@.pgpass
|
||||
authentication:
|
||||
replication:
|
||||
username: "replicator"
|
||||
password: "rep-pass"
|
||||
# A superuser role is required in order for Patroni to manage the local
|
||||
# Postgres instance. If the option `use_unix_socket' is set to `true',
|
||||
# then specifying an empty password results in no md5 password for the
|
||||
# superuser being set and sockets being used for authentication. The
|
||||
# `password:' line is nevertheless required. Note that pg_rewind will not
|
||||
# work if no md5 password is set unless a rewind user is configured, see
|
||||
# below.
|
||||
superuser:
|
||||
username: "postgres"
|
||||
password:
|
||||
# A rewind role can be specified in order for Patroni to use on PostgreSQL
|
||||
# 11 or later for pg_rewind, i.e. rewinding a former primary after failover
|
||||
# without having to re-clone it. Patroni will assign this user the
|
||||
# necessary permissions (that only exist from PostgreSQL)
|
||||
# rewind:
|
||||
# username: "rewind"
|
||||
# password: "rewind-pass"
|
||||
|
||||
parameters:
|
||||
unix_socket_directories: '/var/run/postgresql/'
|
||||
# Emulate default Debian/Ubuntu logging
|
||||
logging_collector: 'on'
|
||||
log_directory: '/var/log/postgresql'
|
||||
log_filename: 'postgresql-@VERSION@-@CLUSTER@.log'
|
35
debian/control
vendored
35
debian/control
vendored
|
@ -1,8 +1,8 @@
|
|||
Source: patroni
|
||||
Section: database
|
||||
Priority: optional
|
||||
Maintainer: Debian PostgreSQL Maintainers <pkg-postgresql-public@lists.alioth.debian.org>
|
||||
Uploaders: Michael Banck <michael.banck@credativ.de>,
|
||||
Maintainer: Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org>
|
||||
Uploaders: Michael Banck <mbanck@debian.org>,
|
||||
Adrian Vondendriesch <adrian.vondendriesch@credativ.de>,
|
||||
Build-Depends:
|
||||
debhelper (>= 10),
|
||||
|
@ -12,12 +12,13 @@ Build-Depends:
|
|||
libjs-underscore,
|
||||
pyflakes3,
|
||||
python3,
|
||||
python3-boto,
|
||||
python3-boto3,
|
||||
python3-cdiff,
|
||||
python3-click (>= 4.1),
|
||||
python3-consul (>= 0.7.0),
|
||||
python3-dateutil,
|
||||
python3-dnspython,
|
||||
python3-doc,
|
||||
python3-etcd (>= 0.4.3),
|
||||
python3-flake8,
|
||||
python3-kazoo,
|
||||
|
@ -37,7 +38,7 @@ Build-Depends:
|
|||
python3-tzlocal,
|
||||
python3-yaml,
|
||||
sphinx-common
|
||||
Standards-Version: 4.1.3
|
||||
Standards-Version: 4.1.5
|
||||
X-Python3-Version: >= 3.5
|
||||
Vcs-Browser: https://salsa.debian.org/postgresql/patroni
|
||||
Vcs-Git: https://salsa.debian.org/postgresql/patroni.git
|
||||
|
@ -45,10 +46,26 @@ Homepage: https://github.com/zalando/patroni
|
|||
|
||||
Package: patroni
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}, ${python3:Depends}, lsb-base (>= 3.0-6)
|
||||
Suggests: postgresql, etcd-server | consul | zookeeperd, haproxy
|
||||
Description: Template for PostgreSQL High Availability
|
||||
Depends: ${misc:Depends}, ${python3:Depends}, python3-psycopg2,
|
||||
python3-etcd (>= 0.4.3) | python3-consul (>= 0.7.0) | python3-kazoo |
|
||||
python3-kubernetes | python3-pysyncobj, python3-cdiff
|
||||
Recommends: iproute2
|
||||
Suggests: postgresql, etcd-server | consul | zookeeperd, vip-manager, haproxy, patroni-doc
|
||||
Description: PostgreSQL High Availability with ZooKeeper, etcd, Consul, or Kubernetes
|
||||
Patroni is a template for a customized, high-availability PostgreSQL solution
|
||||
using Python and a distributed configuration store (ZooKeeper, etcd or
|
||||
Consul). It provides a REST API on each Postgres node of the cluster allowing
|
||||
for remote management and monitoring.
|
||||
Consul), or Kubernetes. It provides a REST API on each Postgres node of the
|
||||
cluster allowing for remote management and monitoring.
|
||||
|
||||
Package: patroni-doc
|
||||
Section: doc
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}, ${sphinxdoc:Depends}
|
||||
Suggests: postgresql, etcd-server | consul | zookeeperd, haproxy
|
||||
Description: PostgreSQL High Availability (documentation)
|
||||
Patroni is a template for a customized, high-availability PostgreSQL solution
|
||||
using Python and a distributed configuration store (ZooKeeper, etcd or
|
||||
Consul), or Kubernetes. It provides a REST API on each Postgres node of the
|
||||
cluster allowing for remote management and monitoring.
|
||||
.
|
||||
This package provides the documentation.
|
||||
|
|
8
debian/dcs.yml
vendored
Normal file
8
debian/dcs.yml
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
#etcd:
|
||||
# host: 127.0.0.1:2379
|
||||
|
||||
#consul:
|
||||
# host: 127.0.0.1:8500
|
||||
|
||||
zookeeper:
|
||||
hosts: 127.0.0.1:2181
|
269
debian/design.md
vendored
Normal file
269
debian/design.md
vendored
Normal file
|
@ -0,0 +1,269 @@
|
|||
Integrating Patroni with Debian
|
||||
===============================
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Patroni manages PostgreSQL instances and mostly expects a blank sheet, i.e
|
||||
prefers to initialize and insists to start and stop the database itself. Debian
|
||||
on the other hand includes the `postgresql-common` (called pg-common in the
|
||||
following) framework that manages concurrent major versions of PostgreSQL and
|
||||
possibly database instances for each of them. This document details a design on
|
||||
how to integrate Patroni (in form of the Debian `patroni` package, preferable
|
||||
provided by PGDG's apt repository) with Debian's pg-common framework and
|
||||
policies.
|
||||
|
||||
pg-common nomenclature and directory layout
|
||||
-------------------------------------------
|
||||
|
||||
pg-common enhances the usual `libpq` environment variables like `PGHOST` and
|
||||
`PGDATABASE` with `PGCLUSTER`, that is the Debian standard way of addressing a
|
||||
specific version/instance combination. The `PGCLUSTER` environment variable
|
||||
consists of two parts, the PostgreSQL major version and the instance name
|
||||
(`main` being the default instance name), serarated by a '/', e.g. `'10/main'`.
|
||||
The two components are usually abbreviated or referred to as '%v' and '%c',
|
||||
respectively.
|
||||
|
||||
The versioned binaries and libraries are located in
|
||||
`/usr/lib/postgresql/%v/{bin,lib}`. The configuration files usually reside in
|
||||
`/etc/postgresql/%v/%c/` and the default log file (set via the `pg_ctlcluster`
|
||||
wrapper) is `/var/log/postgresql/postgresql-%v-%c.log`. The default data
|
||||
directory is `/var/lib/postgresql/%v/%c` and the listening sockets are located
|
||||
in `/var/run/postgresql/`.
|
||||
|
||||
Patroni configuration
|
||||
---------------------
|
||||
|
||||
The Patroni configuration is in YAML format. Different Patroni instances or
|
||||
installations are identified by the `scope` configuration option, which mostly
|
||||
maps to an instance name.
|
||||
|
||||
As Patroni is usually started via Docker or another container runtime, there is
|
||||
no opinioated default file system layout or even configuratin file location.
|
||||
|
||||
It would be desirable to create/maintain a Patroni configuration for each
|
||||
pg-common instance as `/etc/patroni/%v-%c.yml`, i.e. e.g.
|
||||
`/etc/patroni/10-main.yml`. Another possibility would be to prefix the
|
||||
configuration file name with `patroni-`.
|
||||
|
||||
Automatic generation of Patroni configuration
|
||||
---------------------------------------------
|
||||
|
||||
Currently, the pg-common instance specific configuration file
|
||||
`/etc/patroni/%v-%c.yml` needs to be deployed/adopted manually as the pg-common
|
||||
framework and `pg_createcluster` have no possibilty to run external programs as
|
||||
hooks after instance creation.
|
||||
|
||||
Another possibilty is to create the configuration file via an external config
|
||||
management program like Ansible or Puppet.
|
||||
|
||||
Regardless of this, a simple program that creates the instance-specific
|
||||
configuration from a template (e.g. `/etc/patroni/patroni.yml.in`) would be
|
||||
desirable and could be shipped in the `patroni` Debian package.
|
||||
|
||||
Debian-adopted Patroni configuration
|
||||
------------------------------------
|
||||
|
||||
it is possble to mimick the default Debian layout via the following
|
||||
configuration parameters:
|
||||
|
||||
```
|
||||
data_dir = "/var/lib/postgresql/%v/%c"
|
||||
bin_dir = "/usr/lib/postgresql/%v/bin"
|
||||
config_dir: "/etc/postgresql/%v/%c"
|
||||
```
|
||||
|
||||
The logfile location and filename as well as the socket directory have to be
|
||||
explicitly set via the configuration file:
|
||||
|
||||
```
|
||||
unix_socket_directories = '/var/run/postgresql/'
|
||||
log_directory = '/var/log/postgresql'
|
||||
log_filename = 'postgresql-%v-%c.log'
|
||||
```
|
||||
|
||||
The `postgresql.conf` configuration file
|
||||
----------------------------------------
|
||||
|
||||
Patroni expects to deploy a configuration file and to be able to change it and
|
||||
keep it in sync across nodes. If a configuration file `postgresql.conf` is
|
||||
already present in the `config_dir`, it renames it to `postgresql.base.conf` and
|
||||
includes it at the top of the `postgresql.conf` it writes instead.
|
||||
|
||||
Initialization of the first and standby instances
|
||||
-------------------------------------------------
|
||||
|
||||
Patroni by default runs `initdb` on the data directory during bootrap while
|
||||
pg-common provides the `pg_createcluster` command for this purpose.
|
||||
|
||||
It is possible to tell Patroni to run an external bootstrap command which is
|
||||
passed the `--scope` and `--datadir` command-line options. This makes it
|
||||
possible to have a small wrapper script like the following that runs
|
||||
`pg_createcluster` instead:
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
--scope=*)
|
||||
SCOPE="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--datadir=*)
|
||||
DATADIR="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
VERSION=$(echo $SCOPE | sed -e 's/\/.*//')
|
||||
CLUSTER=$(echo $SCOPE | sed -e 's/.*\///')
|
||||
|
||||
pg_createcluster $VERSION $CLUSTER
|
||||
exit $?
|
||||
```
|
||||
|
||||
This requires the following in the Patroni YAML configuratio:
|
||||
|
||||
```
|
||||
bootstrap:
|
||||
# Custom bootstrap method
|
||||
method: pg_createcluster
|
||||
pg_createcluster:
|
||||
command: <custom script above>
|
||||
```
|
||||
|
||||
Subsequent nodes are boostrapped from the primary via base backups. Just running
|
||||
`pg_createcluster` on them is not possible as then the cluster IDs (the
|
||||
'Database system identifier' in the `pg_controldata` output) would differ.
|
||||
|
||||
Again, it is possible to provide an external clone program, which can run
|
||||
`pg_basebackup` itself. The pg-common framework currently does not provide for
|
||||
this, but it is possible to run `pg_basebackup` after `pg_createcluster` (which
|
||||
creates the configuration directory) and purging the data directory:
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
--scope=*)
|
||||
SCOPE="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--role=*)
|
||||
ROLE="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--datadir=*)
|
||||
DATADIR="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--connstring=*)
|
||||
CONNSTR="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
VERSION=$(echo $SCOPE | sed -e 's/\/.*//')
|
||||
CLUSTER=$(echo $SCOPE | sed -e 's/.*\///')
|
||||
|
||||
if [ -f /etc/postgresql/$VERSION/$CLUSTER/postgresql.conf ]
|
||||
then
|
||||
pg_dropcluster $VERSION $CLUSTER
|
||||
fi
|
||||
|
||||
pg_createcluster $VERSION $CLUSTER && rm -rf $DATADIR && pg_basebackup --pgdata $DATADIR -X stream --dbname=$CONNSTR
|
||||
exit $?
|
||||
```
|
||||
|
||||
Those two scripts could be shipped in the `patroni` Debian package e.g. as
|
||||
`/usr/share/patroni/pg_createcluster_patroni` and
|
||||
`/usr/share/patroni/pg_clonecluster_patroni`.
|
||||
|
||||
Systemd services
|
||||
----------------
|
||||
|
||||
The Patroni daemon/agent needs to be started for each configuration file in
|
||||
`/etc/patroni`, i.e. a systemd service unit is required for each. This can be
|
||||
facilitated via the `patroni@.service` that acts as a wild card and could have
|
||||
the following pg-common specific content:
|
||||
|
||||
```
|
||||
[Unit]
|
||||
ConditionPathExists=/etc/patroni/%i.yml
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/patroni /etc/patroni/%i.yml
|
||||
```
|
||||
|
||||
This makes it possible to e.g. start Patroni for the '10/main' instance with
|
||||
`systemctl start patroni@10/main`.
|
||||
|
||||
DCS Debian availability
|
||||
-----------------------
|
||||
|
||||
The only DCS server available in Debian 9 (stretch) is zookeeper. Both etcd and
|
||||
consul were blacklisted before release by the Debian security team due to being
|
||||
written in Go.
|
||||
|
||||
Current testing (buster) also includes etcd and consul.
|
||||
|
||||
The latest Patroni Debian package is available for both Debian stable and
|
||||
testing/unstable via the PGDG APT repository.
|
||||
|
||||
DCS setup
|
||||
---------
|
||||
|
||||
One outstanding issue with providing a general Patroni configuration template
|
||||
and possibly a program that creates a Patroni configuration file per pg-common
|
||||
instance is the distributed consensus store, which also needs to be configured
|
||||
in the Patroni YAML file.
|
||||
|
||||
One possibility would be to introduce a file `/etc/default/patroni` where the
|
||||
DCS and it's ip-address(es) could be configured which could be sourced by the
|
||||
configuration file generator.
|
||||
|
||||
Security
|
||||
--------
|
||||
|
||||
The proposed/current setup should be considered a Proof of Concept. In
|
||||
particular, care must be taken that the postgres db/system user password is not
|
||||
leaked and that the DCS access is secured/hardened.
|
||||
|
||||
Making `patronictl` pg-common aware
|
||||
-----------------------------------
|
||||
|
||||
The `patronictl` CLI currently looks for a configuration file
|
||||
`~/.config/patronictl.yml`. This could potentially be a symlink to the
|
||||
configuration under `/etc/patroni/`. In the pg-common scope, it could
|
||||
addtionally either display all pg-common instances and/or accept the '%v/%c'
|
||||
instance notation in order to select a specific instance to display or act on.
|
||||
|
||||
Current status
|
||||
--------------
|
||||
|
||||
As of the postgresql-common_194 and patroni_1.5.0-9 packages, the following
|
||||
steps are still needed for each pg-common instance %v/%c:
|
||||
|
||||
1. Setup DCS and possibly install its client python packages
|
||||
2. Install postgresql-common package
|
||||
3. Disable automatic instance creation in
|
||||
/etc/postgresql-common/createcluster.conf
|
||||
4. Install postgresql-%v package
|
||||
5. Setup authentication via pgpass or otherwise
|
||||
6. Create a /etc/patroni/%v-%c.yml configuration file
|
||||
7. Start the patroni systemd service for the instance
|
||||
|
||||
In particular, no changes are required to the Patroni or postgresql-common
|
||||
upstream codebases.
|
1
debian/gitlab-ci.yml
vendored
Normal file
1
debian/gitlab-ci.yml
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
include: https://salsa.debian.org/postgresql/postgresql-common/raw/master/gitlab/gitlab-ci.yml
|
13
debian/patches/acceptance_tests_system_patroni.patch
vendored
Normal file
13
debian/patches/acceptance_tests_system_patroni.patch
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
Index: patroni/features/environment.py
|
||||
===================================================================
|
||||
--- patroni.orig/features/environment.py
|
||||
+++ patroni/features/environment.py
|
||||
@@ -150,7 +150,7 @@ class PatroniController(AbstractControll
|
||||
if os.name == 'nt':
|
||||
env['BEHAVE_DEBUG'] = 'true'
|
||||
patroni = subprocess.Popen([sys.executable, '-m', 'coverage', 'run',
|
||||
- '--source=patroni', '-p', 'patroni.py', self._config], env=env,
|
||||
+ '-p', '/usr/bin/patroni', self._config], env=env,
|
||||
stdout=self._log, stderr=subprocess.STDOUT, cwd=self._work_directory)
|
||||
if os.name == 'nt':
|
||||
patroni.terminate = self.terminate
|
41
debian/patches/avoid_overwriting_configuration_during_boostrap.patch
vendored
Normal file
41
debian/patches/avoid_overwriting_configuration_during_boostrap.patch
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
commit a3776e0dfb2f0c5a9e5174f948122b8fb33ceebc
|
||||
Author: Michael Banck <michael.banck@credativ.de>
|
||||
Date: Fri Jul 29 14:55:15 2022 +0200
|
||||
|
||||
Make backup copies of configuration files in config_dir.
|
||||
|
||||
Before, the .backup files were always done in the data directory. However, if
|
||||
there is a distinct configuration directory, it seems logical to put them
|
||||
there. If config_dir is not configured, it defaults back to the data directory,
|
||||
so this will not change things for setups where postgresql.conf is in the data
|
||||
directory.
|
||||
|
||||
On the other hand, it will help with setups where postgresql.conf is outside
|
||||
the data directory and has local changes. In this case, those no longer get
|
||||
overwritten on boostrap/clone from the primary's backup configuration file that
|
||||
is streamed to the boostrapped node.
|
||||
|
||||
Close #2370
|
||||
|
||||
Index: patroni/patroni/postgresql/config.py
|
||||
===================================================================
|
||||
--- patroni.orig/patroni/postgresql/config.py
|
||||
+++ patroni/patroni/postgresql/config.py
|
||||
@@ -355,7 +355,7 @@ class ConfigHandler(object):
|
||||
try:
|
||||
for f in self._configuration_to_save:
|
||||
config_file = os.path.join(self._config_dir, f)
|
||||
- backup_file = os.path.join(self._postgresql.data_dir, f + '.backup')
|
||||
+ backup_file = os.path.join(self._config_dir, f + '.backup')
|
||||
if os.path.isfile(config_file):
|
||||
shutil.copy(config_file, backup_file)
|
||||
except IOError:
|
||||
@@ -367,7 +367,7 @@ class ConfigHandler(object):
|
||||
try:
|
||||
for f in self._configuration_to_save:
|
||||
config_file = os.path.join(self._config_dir, f)
|
||||
- backup_file = os.path.join(self._postgresql.data_dir, f + '.backup')
|
||||
+ backup_file = os.path.join(self._config_dir, f + '.backup')
|
||||
if not os.path.isfile(config_file):
|
||||
if os.path.isfile(backup_file):
|
||||
shutil.copy(backup_file, config_file)
|
20
debian/patches/consul_import.patch
vendored
20
debian/patches/consul_import.patch
vendored
|
@ -1,20 +0,0 @@
|
|||
Move consul import to ConsulController class
|
||||
|
||||
Facilitates building on stretch where this module is not available
|
||||
|
||||
--- a/features/environment.py
|
||||
+++ b/features/environment.py
|
||||
@@ -1,5 +1,4 @@
|
||||
import abc
|
||||
-import consul
|
||||
import datetime
|
||||
import etcd
|
||||
import kazoo.client
|
||||
@@ -361,6 +360,7 @@ class AbstractDcsController(AbstractCont
|
||||
class ConsulController(AbstractDcsController):
|
||||
|
||||
def __init__(self, context):
|
||||
+ import consul
|
||||
super(ConsulController, self).__init__(context)
|
||||
os.environ['PATRONI_CONSUL_HOST'] = 'localhost:8500'
|
||||
self._client = consul.Consul()
|
37
debian/patches/coverage_binary.patch
vendored
37
debian/patches/coverage_binary.patch
vendored
|
@ -1,37 +0,0 @@
|
|||
Index: patroni/features/environment.py
|
||||
===================================================================
|
||||
--- patroni.orig/features/environment.py
|
||||
+++ patroni/features/environment.py
|
||||
@@ -130,7 +130,7 @@ class PatroniController(AbstractControll
|
||||
if isinstance(self._context.dcs_ctl, KubernetesController):
|
||||
self._context.dcs_ctl.create_pod(self._name[8:], self._scope)
|
||||
os.environ['PATRONI_KUBERNETES_POD_IP'] = '10.0.0.' + self._name[-1]
|
||||
- return subprocess.Popen(['coverage', 'run', '--source=patroni', '-p', 'patroni.py', self._config],
|
||||
+ return subprocess.Popen(['python3-coverage', 'run', '--source=patroni', '-p', 'patroni.py', self._config],
|
||||
stdout=self._log, stderr=subprocess.STDOUT, cwd=self._work_directory)
|
||||
|
||||
def stop(self, kill=False, timeout=15, postgres=False):
|
||||
@@ -792,8 +792,8 @@ def before_all(context):
|
||||
|
||||
def after_all(context):
|
||||
context.dcs_ctl.stop()
|
||||
- subprocess.call(['coverage', 'combine'])
|
||||
- subprocess.call(['coverage', 'report'])
|
||||
+ subprocess.call(['python3-coverage', 'combine'])
|
||||
+ subprocess.call(['python3-coverage', 'report'])
|
||||
|
||||
|
||||
def before_feature(context, feature):
|
||||
Index: patroni/features/steps/patroni_api.py
|
||||
===================================================================
|
||||
--- patroni.orig/features/steps/patroni_api.py
|
||||
+++ patroni/features/steps/patroni_api.py
|
||||
@@ -95,7 +95,7 @@ def do_request(context, request_method,
|
||||
|
||||
@step('I run {cmd}')
|
||||
def do_run(context, cmd):
|
||||
- cmd = ['coverage', 'run', '--source=patroni', '-p'] + shlex.split(cmd)
|
||||
+ cmd = ['python3-coverage', 'run', '--source=patroni', '-p'] + shlex.split(cmd)
|
||||
try:
|
||||
# XXX: Dirty hack! We need to take name/passwd from the config!
|
||||
env = os.environ.copy()
|
23
debian/patches/offline_intersphinx.patch
vendored
Normal file
23
debian/patches/offline_intersphinx.patch
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
Index: patroni/docs/conf.py
|
||||
===================================================================
|
||||
--- patroni.orig/docs/conf.py
|
||||
+++ patroni/docs/conf.py
|
||||
@@ -189,7 +189,17 @@ epub_exclude_files = ['search.html']
|
||||
|
||||
|
||||
# Example configuration for intersphinx: refer to the Python standard library.
|
||||
-intersphinx_mapping = {'https://docs.python.org/': None}
|
||||
+def check_object_path(key, url, path):
|
||||
+ if os.path.isfile(path):
|
||||
+ return {key: (url, path)}
|
||||
+ return {}
|
||||
+
|
||||
+intersphinx_mapping = {}
|
||||
+intersphinx_mapping.update(check_object_path('python',
|
||||
+ 'http://docs.python.org/',
|
||||
+ '/usr/share/doc/python'
|
||||
+ + '.'.join([str(x) for x in sys.version_info[0:2]])
|
||||
+ + '/html/objects.inv'))
|
||||
|
||||
# A possibility to have an own stylesheet, to add new rules or override existing ones
|
||||
# For the latter case, the CSS specificity of the rules should be higher than the default ones
|
10
debian/patches/patroni_service.patch
vendored
10
debian/patches/patroni_service.patch
vendored
|
@ -1,10 +0,0 @@
|
|||
--- a/extras/startup-scripts/patroni.service
|
||||
+++ b/extras/startup-scripts/patroni.service
|
||||
@@ -1,6 +1,7 @@
|
||||
[Unit]
|
||||
Description=Runners to orchestrate a high-availability PostgreSQL
|
||||
After=network.target
|
||||
+ConditionPathExists=/etc/patroni/config.yml
|
||||
|
||||
[Service]
|
||||
Type=simple
|
13
debian/patches/regression_tests_skip_citus_test.patch
vendored
Normal file
13
debian/patches/regression_tests_skip_citus_test.patch
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
--- ./tests/test_citus.py.orig 2023-01-31 09:22:20.849730475 +0100
|
||||
+++ ./tests/test_citus.py 2023-01-31 09:22:46.673632646 +0100
|
||||
@@ -4,7 +4,10 @@
|
||||
from . import BaseTestPostgresql, MockCursor, psycopg_connect, SleepException
|
||||
from .test_ha import get_cluster_initialized_with_leader
|
||||
|
||||
+import unittest
|
||||
|
||||
+
|
||||
+@unittest.skipIf(True, "Citus not tested")
|
||||
@patch('patroni.postgresql.citus.Thread', Mock())
|
||||
@patch('patroni.psycopg.connect', psycopg_connect)
|
||||
class TestCitus(BaseTestPostgresql):
|
46
debian/patches/relax_requirements.patch
vendored
46
debian/patches/relax_requirements.patch
vendored
|
@ -1,46 +0,0 @@
|
|||
Description: <short summary of the patch>
|
||||
TODO: Put a short summary on the line above and replace this paragraph
|
||||
with a longer explanation of this change. Complete the meta-information
|
||||
with other relevant fields (see below for details). To make it easier, the
|
||||
information below has been extracted from the changelog. Adjust it or drop
|
||||
it.
|
||||
.
|
||||
patroni (1.4.1-1) UNRELEASED; urgency=medium
|
||||
.
|
||||
* New upstream release.
|
||||
.
|
||||
[ Christoph Berg ]
|
||||
* Move packaging repository to salsa.debian.org
|
||||
.
|
||||
[ Michael Banck ]
|
||||
* debian/patches/pgpass_in_testsuite.patch: Removed, no longer needed.
|
||||
* debian/patches/sphinx_no_mathjax.patch: Refreshed.
|
||||
* debian/patches/startup_scripts.patch: Updated.
|
||||
* debian/patches/coverage_binary.patch: Likewiese.
|
||||
* debian/pathes/relax_kazoo_requirement.patch: Removed, no longer needed.
|
||||
* debian/rules (override_dh_auto_install): Remove tr-hack, the example init
|
||||
file no longer has DOS line endings.
|
||||
* debian/control (Build-Depends): Added python3-kubernetes.
|
||||
Author: Christoph Berg <myon@debian.org>
|
||||
|
||||
---
|
||||
The information above should follow the Patch Tagging Guidelines, please
|
||||
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
|
||||
are templates for supplementary fields that you might want to add:
|
||||
|
||||
Origin: <vendor|upstream|other>, <url of original patch>
|
||||
Bug: <url in upstream bugtracker>
|
||||
Bug-Debian: https://bugs.debian.org/<bugnumber>
|
||||
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
|
||||
Forwarded: <no|not-needed|url proving that it has been forwarded>
|
||||
Reviewed-By: <name and email of someone who approved the patch>
|
||||
Last-Update: 2018-01-24
|
||||
|
||||
--- patroni-1.4.1.orig/requirements.txt
|
||||
+++ patroni-1.4.1/requirements.txt
|
||||
@@ -13,4 +13,4 @@ tzlocal
|
||||
python-dateutil
|
||||
psutil
|
||||
cdiff
|
||||
-kubernetes==3.0.0
|
||||
+kubernetes>=2.0.0
|
11
debian/patches/requirements_cdiff.patch
vendored
Normal file
11
debian/patches/requirements_cdiff.patch
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
Index: patroni/requirements.txt
|
||||
===================================================================
|
||||
--- patroni.orig/requirements.txt
|
||||
+++ patroni/requirements.txt
|
||||
@@ -12,5 +12,5 @@ python-dateutil
|
||||
pysyncobj>=0.3.8
|
||||
cryptography>=1.4
|
||||
psutil>=2.0.0
|
||||
-ydiff>=1.2.0
|
||||
+cdiff
|
||||
setuptools
|
9
debian/patches/requirements_setuptools.patch
vendored
Normal file
9
debian/patches/requirements_setuptools.patch
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
Index: patroni/requirements.txt
|
||||
===================================================================
|
||||
--- patroni.orig/requirements.txt
|
||||
+++ patroni/requirements.txt
|
||||
@@ -13,3 +13,4 @@ pysyncobj>=0.3.8
|
||||
cryptography>=1.4
|
||||
psutil>=2.0.0
|
||||
ydiff>=1.2.0
|
||||
+setuptools
|
11
debian/patches/series
vendored
11
debian/patches/series
vendored
|
@ -1,6 +1,7 @@
|
|||
sphinx_no_mathjax.patch
|
||||
startup_scripts.patch
|
||||
coverage_binary.patch
|
||||
relax_requirements.patch
|
||||
consul_import.patch
|
||||
patroni_service.patch
|
||||
acceptance_tests_system_patroni.patch
|
||||
requirements_setuptools.patch
|
||||
offline_intersphinx.patch
|
||||
requirements_cdiff.patch
|
||||
avoid_overwriting_configuration_during_boostrap.patch
|
||||
regression_tests_skip_citus_test.patch
|
||||
|
|
13
debian/patches/sphinx_no_mathjax.patch
vendored
13
debian/patches/sphinx_no_mathjax.patch
vendored
|
@ -1,13 +0,0 @@
|
|||
Index: patroni/docs/conf.py
|
||||
===================================================================
|
||||
--- patroni.orig/docs/conf.py
|
||||
+++ patroni/docs/conf.py
|
||||
@@ -35,7 +35,7 @@ from patroni.version import __version__
|
||||
# ones.
|
||||
extensions = ['sphinx.ext.intersphinx',
|
||||
'sphinx.ext.todo',
|
||||
- 'sphinx.ext.mathjax',
|
||||
+# 'sphinx.ext.mathjax',
|
||||
'sphinx.ext.ifconfig',
|
||||
'sphinx.ext.viewcode']
|
||||
|
11
debian/patches/sphinx_no_theme.patch
vendored
11
debian/patches/sphinx_no_theme.patch
vendored
|
@ -1,11 +0,0 @@
|
|||
--- ./docs/conf.py.orig 2017-09-14 13:02:16.190226130 +0200
|
||||
+++ ./docs/conf.py 2017-09-14 13:03:18.494248159 +0200
|
||||
@@ -81,6 +81,8 @@
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = True
|
||||
|
||||
+# mathjax path
|
||||
+mathjax_path = /usr/share/javascript/mathjax/
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
33
debian/patches/startup_scripts.patch
vendored
33
debian/patches/startup_scripts.patch
vendored
|
@ -1,7 +1,5 @@
|
|||
Index: patroni/extras/startup-scripts/patroni
|
||||
===================================================================
|
||||
--- patroni.orig/extras/startup-scripts/patroni
|
||||
+++ patroni/extras/startup-scripts/patroni
|
||||
--- a/extras/startup-scripts/patroni
|
||||
+++ b/extras/startup-scripts/patroni
|
||||
@@ -18,7 +18,7 @@ USER="postgres"
|
||||
GROUP="postgres"
|
||||
|
||||
|
@ -33,11 +31,9 @@ Index: patroni/extras/startup-scripts/patroni
|
|||
exit 1
|
||||
;;
|
||||
esac
|
||||
Index: patroni/extras/startup-scripts/patroni.service
|
||||
===================================================================
|
||||
--- patroni.orig/extras/startup-scripts/patroni.service
|
||||
+++ patroni/extras/startup-scripts/patroni.service
|
||||
@@ -1,9 +1,6 @@
|
||||
--- a/extras/startup-scripts/patroni.service
|
||||
+++ b/extras/startup-scripts/patroni.service
|
||||
@@ -1,9 +1,7 @@
|
||||
-# This is an example systemd config file for Patroni
|
||||
-# You can copy it to "/etc/systemd/system/patroni.service",
|
||||
-
|
||||
|
@ -45,19 +41,26 @@ Index: patroni/extras/startup-scripts/patroni.service
|
|||
Description=Runners to orchestrate a high-availability PostgreSQL
|
||||
-After=syslog.target network.target
|
||||
+After=network.target
|
||||
+ConditionPathExists=/etc/patroni/config.yml
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
@@ -11,11 +8,7 @@ Type=simple
|
||||
User=postgres
|
||||
Group=postgres
|
||||
@@ -17,17 +15,13 @@ EnvironmentFile=-/etc/patroni_env.conf
|
||||
# The default is the user's home directory, and if you want to change it, you must provide an absolute path.
|
||||
# WorkingDirectory=/home/sameuser
|
||||
|
||||
-# Where to send early-startup messages from the server
|
||||
-# This is normally controlled by the global default set by systemd
|
||||
-# StandardOutput=syslog
|
||||
-#StandardOutput=syslog
|
||||
-
|
||||
# Pre-commands to start watchdog device
|
||||
# Uncomment if watchdog is part of your patroni setup
|
||||
#ExecStartPre=-/usr/bin/sudo /sbin/modprobe softdog
|
||||
#ExecStartPre=-/usr/bin/sudo /bin/chown postgres /dev/watchdog
|
||||
|
||||
# Start the patroni process
|
||||
-ExecStart=/bin/patroni /etc/patroni.yml
|
||||
+ExecStart=/usr/bin/patroni /etc/patroni/config.yml
|
||||
|
||||
# only kill the patroni process, not it's children, so it will gracefully stop postgres
|
||||
KillMode=process
|
||||
# Send HUP to reload from patroni.yml
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
|
|
1
debian/patroni-doc.install
vendored
Normal file
1
debian/patroni-doc.install
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
docs/build/html usr/share/doc/patroni
|
1
debian/patroni.dirs
vendored
Normal file
1
debian/patroni.dirs
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/etc/patroni
|
1
debian/patroni.docs
vendored
1
debian/patroni.docs
vendored
|
@ -1,2 +1 @@
|
|||
docs/build/html
|
||||
docs/README.rst
|
||||
|
|
8
debian/patroni.install
vendored
8
debian/patroni.install
vendored
|
@ -1,2 +1,10 @@
|
|||
extras/startup-scripts/patroni etc/init.d
|
||||
extras/startup-scripts/patroni.service lib/systemd/system
|
||||
debian/pg_clonecluster_patroni usr/share/patroni
|
||||
debian/pg_createcluster_patroni usr/share/patroni
|
||||
debian/pg_createconfig_patroni usr/bin
|
||||
debian/dcs.yml etc/patroni
|
||||
debian/config.yml.in etc/patroni
|
||||
debian/patroni@.service lib/systemd/system
|
||||
debian/tmp/usr/lib
|
||||
debian/tmp/usr/bin
|
||||
|
|
43
debian/patroni@.service
vendored
Normal file
43
debian/patroni@.service
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
# systemd service template for patroni instances. The actual instances will
|
||||
# be called "patroni@version-cluster", e.g. "patroni@10-main". The
|
||||
# variable %i expands to "version-cluster", %I expands to "version/cluster".
|
||||
# (%I breaks for cluster names containing dashes.)
|
||||
[Unit]
|
||||
Description=Patroni instance %i
|
||||
After=network.target
|
||||
ConditionPathExists=/etc/patroni/%i.yml
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
User=postgres
|
||||
Group=postgres
|
||||
|
||||
# Read in configuration file if it exists, otherwise proceed
|
||||
EnvironmentFile=-/etc/patroni/env.conf
|
||||
|
||||
PermissionsStartOnly=True
|
||||
RuntimeDirectory=postgresql/%i.pg_stat_tmp
|
||||
RuntimeDirectoryMode=2775
|
||||
SyslogIdentifier=patroni@%i
|
||||
|
||||
ExecStart=/usr/bin/patroni /etc/patroni/%i.yml
|
||||
|
||||
# Send HUP to reload from patroni.yml
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
|
||||
# only kill the patroni process, not it's children, so it will gracefully stop postgres
|
||||
KillMode=process
|
||||
|
||||
# Give a reasonable amount of time for the server to start up/shut down
|
||||
TimeoutSec=30
|
||||
|
||||
# Do not restart the service if it crashes, we want to manually inspect database on failure
|
||||
Restart=no
|
||||
|
||||
# Uncomment in order to get debugging output
|
||||
#Environment=PATRONI_LOGLEVEL=DEBUG
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
45
debian/pg_clonecluster_patroni
vendored
Executable file
45
debian/pg_clonecluster_patroni
vendored
Executable file
|
@ -0,0 +1,45 @@
|
|||
#!/bin/sh
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
--scope=*)
|
||||
SCOPE="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--role=*)
|
||||
ROLE="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--datadir=*)
|
||||
DATADIR="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--connstring=*)
|
||||
CONNSTR="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# support both '-' and '/' as separator
|
||||
if [ $(echo $SCOPE | grep -- -) ]
|
||||
then
|
||||
VERSION=$(echo $SCOPE | sed -e 's/-.*//')
|
||||
CLUSTER=$(echo $SCOPE | sed -e 's/.*-//')
|
||||
else
|
||||
VERSION=$(echo $SCOPE | sed -e 's/\/.*//')
|
||||
CLUSTER=$(echo $SCOPE | sed -e 's/.*\///')
|
||||
fi
|
||||
|
||||
if [ -f /etc/postgresql/$VERSION/$CLUSTER/postgresql.conf ]
|
||||
then
|
||||
rm -f etc/postgresql/$VERSION/$CLUSTER/postgresql.base.conf
|
||||
pg_dropcluster $VERSION $CLUSTER
|
||||
fi
|
||||
|
||||
pg_createcluster --start-conf=manual --datadir=$DATADIR $VERSION $CLUSTER > /dev/null && rm -rf $DATADIR && /usr/lib/postgresql/$VERSION/bin/pg_basebackup --pgdata $DATADIR -X stream --dbname="$CONNSTR"
|
||||
exit $?
|
36
debian/pg_createcluster_patroni
vendored
Executable file
36
debian/pg_createcluster_patroni
vendored
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/bin/sh
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
--scope=*)
|
||||
SCOPE="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--datadir=*)
|
||||
DATADIR="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# support both '-' and '/' as separator
|
||||
if [ $(echo $SCOPE | grep -- -) ]
|
||||
then
|
||||
VERSION=$(echo $SCOPE | cut -d'-' -f1 )
|
||||
CLUSTER=$(echo $SCOPE | cut -d'-' -f2- )
|
||||
else
|
||||
VERSION=$(echo $SCOPE | cut -d'/' -f1 )
|
||||
CLUSTER=$(echo $SCOPE | cut -d'/' -f2- )
|
||||
fi
|
||||
|
||||
if [ -n "$DATADIR" ]
|
||||
then
|
||||
pg_createcluster --start-conf=manual --datadir=$DATADIR $VERSION $CLUSTER
|
||||
else
|
||||
pg_createcluster --start-conf=manual $VERSION $CLUSTER
|
||||
fi
|
||||
exit $?
|
237
debian/pg_createconfig_patroni
vendored
Executable file
237
debian/pg_createconfig_patroni
vendored
Executable file
|
@ -0,0 +1,237 @@
|
|||
#!/bin/sh
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
--hostip=*)
|
||||
HOSTIP="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--network=*)
|
||||
NETWORK="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--port=*)
|
||||
PORT="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--force)
|
||||
FORCE="y"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--vip=*)
|
||||
VIP_IP="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--endpoint=*)
|
||||
# one or more endpoints joined by commas are allowed
|
||||
DCS_ENDPOINT="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$2" ];
|
||||
then
|
||||
echo "Usage: pg_creatconfig_patroni [options] <version> <cluster name>"
|
||||
exit 1
|
||||
else
|
||||
VERSION=$1
|
||||
echo $VERSION | egrep -q '^[[:digit:]]+\.?[[:digit:]]+$'
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: invalid version ${VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f /usr/lib/postgresql/${VERSION}/bin/initdb ]; then
|
||||
echo "Error: no initdb program for version ${VERSION} found"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$2" ];
|
||||
then
|
||||
echo "Usage: pg_creatconfig_patroni [options] <version> <cluster name>"
|
||||
exit 1
|
||||
else
|
||||
CLUSTER=$2
|
||||
fi
|
||||
|
||||
# find port of the cluster if it is already running
|
||||
EXISTING_PORT=$(pg_lsclusters -h | grep -E "^$VERSION[[:space:]]+$CLUSTER[[:space:]]+" | awk '{print $3}')
|
||||
|
||||
if [ -z "$PORT" ]; then
|
||||
# no port was specified
|
||||
|
||||
if [ -n "$EXISTING_PORT" ]; then
|
||||
# if our cluster is already running yet, then reuse the same port
|
||||
PORT="$EXISTING_PORT"
|
||||
else
|
||||
# if our cluster isn't running yet, try to guess next free port
|
||||
PORT=$(($(pg_lsclusters -h | awk '{print $3}' | sort -n | tail -1) + 1))
|
||||
if [ "$PORT" -eq 1 ]; then
|
||||
# No cluster exists yet, use default port
|
||||
PORT=5432
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# validate specified port
|
||||
if [ "$PORT" = "$EXISTING_PORT" ]; then
|
||||
# reuse existing port
|
||||
true
|
||||
else
|
||||
# fail if port is already in use
|
||||
pg_lsclusters -h | awk '{print $3}' | grep -q $PORT && echo "Port $PORT already in use" && exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# determine API port (default is 8008) by incrementing for each additional
|
||||
# Postgres port. 2576 is 8008 - 5432.
|
||||
API_PORT=$((2576+$PORT))
|
||||
|
||||
# set base data directory
|
||||
if [ -f /etc/postgresql-common/createcluster.conf ]; then
|
||||
DATADIR_BASE=$(grep ^data_directory /etc/postgresql-common/createcluster.conf | sed -e 's/^[^\/]*\//\//g' -e 's/\%.*//' -e 's/\/$//')
|
||||
fi
|
||||
if [ -z "${DATADIR_BASE}" ]; then
|
||||
DATADIR_BASE=/var/lib/postgresql
|
||||
fi
|
||||
|
||||
# check DCS configuration
|
||||
if [ ! -f /etc/patroni/dcs.yml ]; then
|
||||
echo "DCS not configured yet, edit /etc/patroni/dcs.yml"
|
||||
exit 1
|
||||
fi
|
||||
grep -v "^#" /etc/patroni/dcs.yml | grep -v "^$" > /dev/null 2>&1
|
||||
if [ $? != 0 ]; then
|
||||
echo "DCS not configured yet, edit /etc/patroni/dcs.yml"
|
||||
exit 1
|
||||
fi
|
||||
DCS_CONFIG="$(egrep -v '^[[:space:]]*$|^ *#' /etc/patroni/dcs.yml | sed -e ':a;N;$!ba;s/\n/\\n/g' -e 's/\$/\\$/g')"
|
||||
|
||||
# check vip configuration
|
||||
if [ -n "$VIP_IP" ]; then
|
||||
VIP_FILE=/etc/patroni/${VERSION}-${CLUSTER}.vip
|
||||
if [ -f $VIP_FILE -a -z "$FORCE" ]; then
|
||||
echo "VIP configuration file already exists"
|
||||
exit 1
|
||||
else
|
||||
rm -f $VIP_FILE
|
||||
touch $VIP_FILE
|
||||
fi
|
||||
if [ ! -e /etc/patroni/vip.in ]; then
|
||||
echo "VIP template /etc/patroni/vip.in does not exist, cannot write VIP file"
|
||||
exit 1
|
||||
fi
|
||||
if [ $(grep -q LISTEN_VIP /etc/patroni/config.yml.in) ]; then
|
||||
echo "Patroni configuration template does not have @LISTEN_VIP@ tag"
|
||||
echo "Postgres will not be able to bind to the VIP $VIP_IP."
|
||||
exit 1
|
||||
fi
|
||||
VIP_IFACE="$(ip -4 route get 8.8.8.8 | grep ^8.8.8.8 | sed -e s/.*dev.// -e s/\ .*//)"
|
||||
if [ -z "$VIP_IFACE" ]; then
|
||||
echo "Network interface could not be determined, cannot write VIP file"
|
||||
exit 1
|
||||
fi
|
||||
VIP_MASK="$(ip -o -f inet addr show $VIP_IFACE | awk '{print $4}' | sed -e 's/.*\///' | uniq)"
|
||||
if [ -z "$VIP_MASK" ]; then
|
||||
echo "Netmask could not be determined, cannot write VIP file"
|
||||
exit 1
|
||||
fi
|
||||
VIP_KEY="/postgresql-common/${VERSION}-${CLUSTER}/leader"
|
||||
DCS_TYPE="$(egrep -v '^[[:space:]]*$|^ *#' /etc/patroni/dcs.yml | egrep '(etcd|consul|zookeeper)' | sed s/:.*//)"
|
||||
if [ -z "$DCS_TYPE" ]; then
|
||||
echo "DCS type could not be determined from /etc/patroni/dcs.yml, cannot write VIP file"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$DCS_ENDPOINT" ]; then
|
||||
DCS_ENDPOINT="$(egrep -v '^[[:space:]]*$|^ *#' /etc/patroni/dcs.yml | egrep '(host|-)' | egrep -v '^[[:space:]]*$' | egrep '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' | sed -r -e s/.*host:// -e s/-// -e 's/ //g' -e 's/^([0-9])/http:\/\/\1/')"
|
||||
if [ -z "$DCS_ENDPOINT" ]; then
|
||||
echo "DCS endpoint URL could not be determined from /etc/patroni/dcs.yml and --endpoint not provided, cannot write VIP file"
|
||||
exit 1
|
||||
fi
|
||||
if [ $(echo "$DCS_ENDPOINT" | wc -l) != 1 ]; then
|
||||
# join multiple lines with commas
|
||||
# sed -> remove trailing comma
|
||||
DCS_ENDPOINT=$( echo "$DCS_ENDPOINT" | tr '\n' ',' | sed 's/,$//' )
|
||||
fi
|
||||
fi
|
||||
if ! $(echo "$DCS_ENDPOINT" | egrep -q '^(http.*://[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+:[[:digit:]]+){1}(,http.*://[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+:[[:digit:]]+)*$'); then
|
||||
echo "DCS_ENDPOINT: $DCS_ENDPOINT"
|
||||
echo "DCS endpoint URL not in 'http://1.2.3.4:1234[,http://2.3.4.5:1234]*' format, cannot write VIP file"
|
||||
exit 1
|
||||
fi
|
||||
LISTEN_VIP=",$VIP_IP"
|
||||
else
|
||||
LISTEN_VIP=
|
||||
fi
|
||||
|
||||
CONFIG_FILE=/etc/patroni/${VERSION}-${CLUSTER}.yml
|
||||
|
||||
if [ -f $CONFIG_FILE -a -z "$FORCE" ]; then
|
||||
echo "Patroni configuration file already exists"
|
||||
exit 1
|
||||
else
|
||||
rm -f $CONFIG_FILE
|
||||
touch $CONFIG_FILE
|
||||
fi
|
||||
|
||||
HOSTNAME=$(hostname)
|
||||
|
||||
# set default ipv4 address in case it was not provided
|
||||
if [ -z "$HOSTIP" ]; then
|
||||
if [ -x /bin/ip ]; then
|
||||
HOSTIP=$(/bin/ip -4 route get 8.8.8.8 | grep ^8.8.8.8 | sed -e s/.*src.// -e s/\ .*//g)
|
||||
else
|
||||
echo "iproute2 package missing, cannot determine host ip addresss and --hostip is not set"
|
||||
rm -f $CONFIG_FILE
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$NETWORK" ]; then
|
||||
if [ -x /bin/ip ]; then
|
||||
ROUTE=$(/bin/ip -4 route get 8.8.8.8 | grep ^8.8.8.8)
|
||||
DEV=$(echo "$ROUTE" | grep -P -o "(?<=dev )[^ ]+")
|
||||
ADDRESS=$(echo "$ROUTE" | grep -P -o "(?<=src )[^ ]+")
|
||||
PREFIX=$(ip -4 address show $DEV | grep -P -o "(?<=inet $ADDRESS/)[0-9]+")
|
||||
NETWORK="$ADDRESS/$PREFIX"
|
||||
else
|
||||
echo "iproute2 package missing, cannot determine network and --network is not set"
|
||||
rm -f $CONFIG_FILE
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# add remaining patroni configuration from template
|
||||
cat /etc/patroni/config.yml.in | \
|
||||
sed -e "s/@VERSION@/${VERSION}/g" \
|
||||
-e "s/@CLUSTER@/${CLUSTER}/g" \
|
||||
-e "s/@HOSTNAME@/${HOSTNAME}/g" \
|
||||
-e "s/@HOSTIP@/${HOSTIP}/g" \
|
||||
-e "s/@LISTEN_VIP@/${LISTEN_VIP}/g" \
|
||||
-e "s#@DATADIR_BASE@#${DATADIR_BASE}#g" \
|
||||
-e "s#@NETWORK@#${NETWORK}#g" \
|
||||
-e "s/@API_PORT@/${API_PORT}/g" \
|
||||
-e "s/@PORT@/${PORT}/g" \
|
||||
-e "s/@DCS_CONFIG@/${DCS_CONFIG}/g" \
|
||||
>> $CONFIG_FILE
|
||||
|
||||
# write vip configuration, if requested
|
||||
if [ -n "$VIP_IP" ]; then
|
||||
cat /etc/patroni/vip.in | \
|
||||
sed -e "s/@VIP_IP@/${VIP_IP}/g" \
|
||||
-e "s/@VIP_MASK@/${VIP_MASK}/g" \
|
||||
-e "s/@VIP_IFACE@/${VIP_IFACE}/g" \
|
||||
-e "s#@VIP_KEY@#${VIP_KEY}#g" \
|
||||
-e "s/@VIP_HOST@/${HOSTNAME}/g" \
|
||||
-e "s/@VIP_TYPE@/${DCS_TYPE}/g" \
|
||||
-e "s#@VIP_ENDPOINT@#${DCS_ENDPOINT}#g" \
|
||||
>> $VIP_FILE
|
||||
fi
|
||||
|
||||
# Set permissions
|
||||
chown postgres:postgres $CONFIG_FILE
|
||||
chmod 660 $CONFIG_FILE
|
1
debian/py3dist-overrides
vendored
Normal file
1
debian/py3dist-overrides
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
ipaddress python3:any (>= 3.3)
|
2
debian/rules
vendored
2
debian/rules
vendored
|
@ -18,7 +18,7 @@ override_dh_auto_build:
|
|||
|
||||
override_dh_installinit:
|
||||
# init script installed via debian/patroni.install
|
||||
dh_installinit --only-scripts
|
||||
dh_installinit -ppatroni --only-scripts
|
||||
|
||||
override_dh_installdocs:
|
||||
dh_installdocs
|
||||
|
|
62
debian/tests/acceptance
vendored
62
debian/tests/acceptance
vendored
|
@ -1,11 +1,12 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -eu
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
export LANG=C.UTF-8
|
||||
export TZ=UTC # suppress UnknownTimeZoneError('Etc/UTC',)
|
||||
DCS=etcd
|
||||
DCS=$1
|
||||
shift
|
||||
|
||||
if [ $(id -u) -eq 0 ]
|
||||
then
|
||||
|
@ -15,18 +16,61 @@ then
|
|||
SU='su postgres -p -c'
|
||||
|
||||
# zookeeper must be started manually (as root)
|
||||
if ! [ -x /usr/bin/etcd ] && [ -x /etc/init.d/zookeeper ]; then
|
||||
/etc/init.d/zookeeper start
|
||||
DCS=zookeeper
|
||||
if [ "$DCS" = "zookeeper" ]; then
|
||||
JAVA_OPTS="-Djava.net.preferIPv4Stack=true" /usr/bin/java -cp /etc/zookeeper/conf:/usr/share/java/jline.jar:/usr/share/java/log4j-1.2.jar:/usr/share/java/xercesImpl.jar:/usr/share/java/xmlParserAPIs.jar:/usr/share/java/netty.jar:/usr/share/java/slf4j-api.jar:/usr/share/java/slf4j-log4j12.jar:/usr/share/java/zookeeper.jar -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=true -Dzookeeper.log.dir=/var/log/zookeeper -Dzookeeper.root.logger=INFO,ROLLINGFILE org.apache.zookeeper.server.quorum.QuorumPeerMain /etc/zookeeper/conf/zoo.cfg &
|
||||
# let Java have some more time to startup
|
||||
sleep 5
|
||||
fi
|
||||
else
|
||||
SU='bash -c'
|
||||
fi
|
||||
|
||||
# clean up afterwards
|
||||
trap 'rm -f /tmp/pgpass?; if [ $(id -u) -eq 0 ] && [ -x /etc/init.d/zookeeper ]; then /etc/init.d/zookeeper stop; fi' 0 2 3 15
|
||||
trap 'rm -f /tmp/pgpass?; if [ $(id -u) -eq 0 ] && [ -x /etc/init.d/zookeeper ]; then /etc/init.d/zookeeper stop; fi' EXIT
|
||||
|
||||
# set ETCD_ARCH for ETCD_UNSUPPORTED_ARCH
|
||||
# see https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/supported-platform.md#current-support
|
||||
ETCD_ARCH=
|
||||
DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
|
||||
case $DEB_HOST_ARCH in
|
||||
arm64)
|
||||
ETCD_ARCH=arm64
|
||||
;;
|
||||
armel|armhf)
|
||||
ETCD_ARCH=arm
|
||||
;;
|
||||
i386)
|
||||
ETCD_ARCH=386
|
||||
;;
|
||||
esac
|
||||
|
||||
# ensure no etcd server is running.
|
||||
if [ $(id -u) -eq 0 ]
|
||||
then
|
||||
if [ "$DCS" = "etcd" -o "$DCS" = "etcd3" ]
|
||||
then
|
||||
service etcd stop
|
||||
service etcd status || true
|
||||
fi
|
||||
fi
|
||||
|
||||
set -x
|
||||
for PG_VERSION in /usr/lib/postgresql/*; do
|
||||
$SU "DCS=$DCS PATH=/usr/lib/postgresql/$(basename ${PG_VERSION})/bin:$PATH behave"
|
||||
for PG_VERSION in $(ls -1r /usr/lib/postgresql/); do
|
||||
echo "### PostgreSQL $PG_VERSION acceptance-$DCS $@ ###"
|
||||
if [ "${PG_VERSION}" == "10" ]; then
|
||||
SKIP=--tags=-skip
|
||||
else
|
||||
SKIP=
|
||||
fi
|
||||
if ! $SU "set -o pipefail; ETCD_UNSUPPORTED_ARCH=$ETCD_ARCH DCS=$DCS \
|
||||
PATH=/usr/lib/postgresql/${PG_VERSION}/bin:$PATH \
|
||||
behave ${SKIP} $@ | ts"; then
|
||||
for file in features/output/*_failed/*; do
|
||||
case $file in *.journal*) continue ;; esac # skip RAFT journal files
|
||||
echo "$file:"
|
||||
cat $file
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
echo "### End $PG_VERSION acceptance-$DCS $@ ###"
|
||||
done
|
||||
|
|
83
debian/tests/control
vendored
83
debian/tests/control
vendored
|
@ -1,26 +1,91 @@
|
|||
# runs with etcd or zookeeper (zookeeper needs root, but we can't specify that here if we want to run etcd without root)
|
||||
# etc3
|
||||
Features: test-name=acceptance-etcd3
|
||||
Depends:
|
||||
etcd-server | zookeeperd,
|
||||
etcd-server,
|
||||
moreutils,
|
||||
postgresql,
|
||||
python3-behave,
|
||||
python3-coverage,
|
||||
python3-etcd,
|
||||
@,
|
||||
Test-Command: debian/tests/acceptance etcd3
|
||||
Restrictions: allow-stderr, flaky
|
||||
|
||||
# etcd
|
||||
Features: test-name=acceptance-etcd-basic
|
||||
Depends:
|
||||
etcd-server,
|
||||
moreutils,
|
||||
postgresql,
|
||||
python3-behave,
|
||||
python3-coverage,
|
||||
python3-etcd (>= 0.4.3),
|
||||
@,
|
||||
Test-Command: debian/tests/acceptance etcd features/basic_replication.feature
|
||||
Restrictions: needs-root, allow-stderr
|
||||
|
||||
Features: test-name=acceptance-etcd
|
||||
Depends:
|
||||
etcd-server,
|
||||
moreutils,
|
||||
postgresql,
|
||||
python3-behave,
|
||||
python3-coverage,
|
||||
python3-etcd (>= 0.4.3),
|
||||
@,
|
||||
Test-Command: debian/tests/acceptance etcd
|
||||
Restrictions: needs-root, allow-stderr, flaky
|
||||
|
||||
# consul
|
||||
Features: test-name=acceptance-consul
|
||||
Depends:
|
||||
consul,
|
||||
moreutils,
|
||||
postgresql,
|
||||
python3-behave,
|
||||
python3-consul (>= 0.7.0),
|
||||
python3-etcd (>= 0.4.3),
|
||||
python3-kazoo,
|
||||
python3-kubernetes,
|
||||
python3-coverage,
|
||||
@,
|
||||
Tests: acceptance
|
||||
Restrictions: allow-stderr
|
||||
Test-Command: debian/tests/acceptance consul
|
||||
Restrictions: allow-stderr, flaky, skip-not-installable
|
||||
|
||||
# zookeeper
|
||||
Features: test-name=acceptance-zookeeper
|
||||
Depends:
|
||||
python3-boto,
|
||||
zookeeperd,
|
||||
moreutils,
|
||||
postgresql,
|
||||
python3-behave,
|
||||
python3-coverage,
|
||||
python3-kazoo,
|
||||
procps,
|
||||
@,
|
||||
Test-Command: debian/tests/acceptance zookeeper "-e dcs_failsafe_mode"
|
||||
Restrictions: needs-root, allow-stderr, flaky, skip-not-installable
|
||||
|
||||
# raft
|
||||
Features: test-name=acceptance-raft
|
||||
Depends:
|
||||
moreutils,
|
||||
postgresql,
|
||||
python3-behave,
|
||||
python3-coverage,
|
||||
python3-pysyncobj,
|
||||
@,
|
||||
Test-Command: debian/tests/acceptance raft
|
||||
Restrictions: allow-stderr, flaky
|
||||
|
||||
# regression tests
|
||||
Depends:
|
||||
python3-boto3,
|
||||
python3-consul (>= 0.7.0),
|
||||
python3-etcd (>= 0.4.3),
|
||||
python3-flake8,
|
||||
python3-kazoo,
|
||||
python3-kubernetes,
|
||||
python3-mock,
|
||||
python3-pysyncobj,
|
||||
python3-pytest-cov,
|
||||
python3-setuptools,
|
||||
@,
|
||||
Tests: test
|
||||
Restrictions: allow-stderr
|
||||
|
|
Loading…
Reference in a new issue