Compare commits
38 commits
debian/2.1
...
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 |
70
debian/changelog
vendored
70
debian/changelog
vendored
|
@ -1,3 +1,73 @@
|
|||
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.
|
||||
|
|
6
debian/control
vendored
6
debian/control
vendored
|
@ -2,7 +2,7 @@ Source: patroni
|
|||
Section: database
|
||||
Priority: optional
|
||||
Maintainer: Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org>
|
||||
Uploaders: Michael Banck <michael.banck@credativ.de>,
|
||||
Uploaders: Michael Banck <mbanck@debian.org>,
|
||||
Adrian Vondendriesch <adrian.vondendriesch@credativ.de>,
|
||||
Build-Depends:
|
||||
debhelper (>= 10),
|
||||
|
@ -46,9 +46,9 @@ Homepage: https://github.com/zalando/patroni
|
|||
|
||||
Package: patroni
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}, ${python3:Depends}, lsb-base (>= 3.0-6), python3-psycopg2,
|
||||
Depends: ${misc:Depends}, ${python3:Depends}, python3-psycopg2,
|
||||
python3-etcd (>= 0.4.3) | python3-consul (>= 0.7.0) | python3-kazoo |
|
||||
python3-kubernetes, python3-cdiff
|
||||
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
|
||||
|
|
100
debian/patches/acceptance_tests_speedup.patch
vendored
100
debian/patches/acceptance_tests_speedup.patch
vendored
|
@ -1,100 +0,0 @@
|
|||
commit ead798d9ac0d9dbf4b0de7f14fdfe38397790f49
|
||||
Author: Alexander Kukushkin <alexander.kukushkin@zalando.de>
|
||||
Date: Mon Jul 18 15:23:55 2022 +0200
|
||||
|
||||
Speed up behave tests by always using loop_wait=2 (#2361)
|
||||
|
||||
run time is reduced from ~5m30s to ~5m
|
||||
|
||||
diff --git a/features/basic_replication.feature b/features/basic_replication.feature
|
||||
index 3aaeada..2c01a92 100644
|
||||
--- a/features/basic_replication.feature
|
||||
+++ b/features/basic_replication.feature
|
||||
@@ -5,7 +5,7 @@ Feature: basic replication
|
||||
Given I start postgres0
|
||||
Then postgres0 is a leader after 10 seconds
|
||||
And there is a non empty initialize key in DCS after 15 seconds
|
||||
- When I issue a PATCH request to http://127.0.0.1:8008/config with {"ttl": 20, "loop_wait": 2, "synchronous_mode": true}
|
||||
+ When I issue a PATCH request to http://127.0.0.1:8008/config with {"ttl": 20, "synchronous_mode": true}
|
||||
Then I receive a response code 200
|
||||
When I start postgres1
|
||||
And I configure and start postgres2 with a tag replicatefrom postgres0
|
||||
diff --git a/features/environment.py b/features/environment.py
|
||||
index 3cb1c53..eb30745 100644
|
||||
--- a/features/environment.py
|
||||
+++ b/features/environment.py
|
||||
@@ -181,7 +181,7 @@ class PatroniController(AbstractController):
|
||||
config['postgresql']['data_dir'] = self._data_dir
|
||||
config['postgresql']['basebackup'] = [{'checkpoint': 'fast'}]
|
||||
config['postgresql']['use_unix_socket'] = os.name != 'nt' # windows doesn't yet support unix-domain sockets
|
||||
- config['postgresql']['use_unix_socket_repl'] = os.name != 'nt' # windows doesn't yet support unix-domain sockets
|
||||
+ config['postgresql']['use_unix_socket_repl'] = os.name != 'nt'
|
||||
config['postgresql']['pgpass'] = os.path.join(tempfile.gettempdir(), 'pgpass_' + name)
|
||||
config['postgresql']['parameters'].update({
|
||||
'logging_collector': 'on', 'log_destination': 'csvlog', 'log_directory': self._output_dir,
|
||||
@@ -197,7 +197,7 @@ class PatroniController(AbstractController):
|
||||
self.recursive_update(config, custom_config)
|
||||
|
||||
self.recursive_update(config, {
|
||||
- 'bootstrap': {'dcs': {'postgresql': {'parameters': {'wal_keep_segments': 100}}}}})
|
||||
+ 'bootstrap': {'dcs': {'loop_wait': 2, 'postgresql': {'parameters': {'wal_keep_segments': 100}}}}})
|
||||
if config['postgresql'].get('callbacks', {}).get('on_role_change'):
|
||||
config['postgresql']['callbacks']['on_role_change'] += ' ' + str(self.__PORT)
|
||||
|
||||
@@ -626,7 +626,8 @@ class RaftController(AbstractDcsController):
|
||||
self.start()
|
||||
|
||||
ready_event = threading.Event()
|
||||
- self._raft = KVStoreTTL(ready_event.set, None, None, partner_addrs=[self.CONTROLLER_ADDR], password=self.PASSWORD)
|
||||
+ self._raft = KVStoreTTL(ready_event.set, None, None,
|
||||
+ partner_addrs=[self.CONTROLLER_ADDR], password=self.PASSWORD)
|
||||
self._raft.startAutoTick()
|
||||
ready_event.wait()
|
||||
|
||||
diff --git a/features/ignored_slots.feature b/features/ignored_slots.feature
|
||||
index cb6dbf7..abaaef7 100644
|
||||
--- a/features/ignored_slots.feature
|
||||
+++ b/features/ignored_slots.feature
|
||||
@@ -3,7 +3,7 @@ Feature: ignored slots
|
||||
Given I start postgres1
|
||||
Then postgres1 is a leader after 10 seconds
|
||||
And there is a non empty initialize key in DCS after 15 seconds
|
||||
- When I issue a PATCH request to http://127.0.0.1:8009/config with {"loop_wait": 2, "ignore_slots": [{"name": "unmanaged_slot_0", "database": "postgres", "plugin": "test_decoding", "type": "logical"}, {"name": "unmanaged_slot_1", "database": "postgres", "plugin": "test_decoding"}, {"name": "unmanaged_slot_2", "database": "postgres"}, {"name": "unmanaged_slot_3"}], "postgresql": {"parameters": {"wal_level": "logical"}}}
|
||||
+ When I issue a PATCH request to http://127.0.0.1:8009/config with {"ignore_slots": [{"name": "unmanaged_slot_0", "database": "postgres", "plugin": "test_decoding", "type": "logical"}, {"name": "unmanaged_slot_1", "database": "postgres", "plugin": "test_decoding"}, {"name": "unmanaged_slot_2", "database": "postgres"}, {"name": "unmanaged_slot_3"}], "postgresql": {"parameters": {"wal_level": "logical"}}}
|
||||
Then I receive a response code 200
|
||||
And Response on GET http://127.0.0.1:8009/config contains ignore_slots after 10 seconds
|
||||
# Make sure the wal_level has been changed.
|
||||
diff --git a/features/patroni_api.feature b/features/patroni_api.feature
|
||||
index 5078ea1..ade9220 100644
|
||||
--- a/features/patroni_api.feature
|
||||
+++ b/features/patroni_api.feature
|
||||
@@ -35,13 +35,13 @@ Scenario: check local configuration reload
|
||||
Then I receive a response code 202
|
||||
|
||||
Scenario: check dynamic configuration change via DCS
|
||||
- Given I run patronictl.py edit-config -s 'ttl=10' -s 'loop_wait=2' -p 'max_connections=101' --force batman
|
||||
+ Given I run patronictl.py edit-config -s 'ttl=10' -p 'max_connections=101' --force batman
|
||||
Then I receive a response returncode 0
|
||||
- And I receive a response output "+loop_wait: 2"
|
||||
+ And I receive a response output "+ttl: 10"
|
||||
And Response on GET http://127.0.0.1:8008/patroni contains pending_restart after 11 seconds
|
||||
When I issue a GET request to http://127.0.0.1:8008/config
|
||||
Then I receive a response code 200
|
||||
- And I receive a response loop_wait 2
|
||||
+ And I receive a response ttl 10
|
||||
When I issue a GET request to http://127.0.0.1:8008/patroni
|
||||
Then I receive a response code 200
|
||||
And I receive a response tags {'new_tag': 'new_value'}
|
||||
diff --git a/features/standby_cluster.feature b/features/standby_cluster.feature
|
||||
index 82a800b..5333b5d 100644
|
||||
--- a/features/standby_cluster.feature
|
||||
+++ b/features/standby_cluster.feature
|
||||
@@ -3,7 +3,7 @@ Feature: standby cluster
|
||||
Given I start postgres1
|
||||
Then postgres1 is a leader after 10 seconds
|
||||
And there is a non empty initialize key in DCS after 15 seconds
|
||||
- When I issue a PATCH request to http://127.0.0.1:8009/config with {"loop_wait": 2, "slots": {"pm_1": {"type": "physical"}}, "postgresql": {"parameters": {"wal_level": "logical"}}}
|
||||
+ When I issue a PATCH request to http://127.0.0.1:8009/config with {"slots": {"pm_1": {"type": "physical"}}, "postgresql": {"parameters": {"wal_level": "logical"}}}
|
||||
Then I receive a response code 200
|
||||
And Response on GET http://127.0.0.1:8009/config contains slots after 10 seconds
|
||||
And I sleep for 3 seconds
|
|
@ -2,13 +2,12 @@ Index: patroni/features/environment.py
|
|||
===================================================================
|
||||
--- patroni.orig/features/environment.py
|
||||
+++ patroni/features/environment.py
|
||||
@@ -141,8 +141,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([sys.executable, '-m', 'coverage', 'run',
|
||||
- '--source=patroni', '-p', 'patroni.py', self._config],
|
||||
+ return subprocess.Popen([sys.executable, '-m', 'coverage', 'run', '-p', '/usr/bin/patroni', self._config],
|
||||
@@ -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)
|
||||
|
||||
def stop(self, kill=False, timeout=15, postgres=False):
|
||||
if os.name == 'nt':
|
||||
patroni.terminate = self.terminate
|
||||
|
|
|
@ -17,11 +17,11 @@ Date: Fri Jul 29 14:55:15 2022 +0200
|
|||
|
||||
Close #2370
|
||||
|
||||
diff --git a/patroni/postgresql/config.py b/patroni/postgresql/config.py
|
||||
index 9314315..976cf48 100644
|
||||
--- a/patroni/postgresql/config.py
|
||||
+++ b/patroni/postgresql/config.py
|
||||
@@ -362,7 +362,7 @@ class ConfigHandler(object):
|
||||
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)
|
||||
|
@ -30,7 +30,7 @@ index 9314315..976cf48 100644
|
|||
if os.path.isfile(config_file):
|
||||
shutil.copy(config_file, backup_file)
|
||||
except IOError:
|
||||
@@ -374,7 +374,7 @@ class ConfigHandler(object):
|
||||
@@ -367,7 +367,7 @@ class ConfigHandler(object):
|
||||
try:
|
||||
for f in self._configuration_to_save:
|
||||
config_file = os.path.join(self._config_dir, f)
|
||||
|
|
|
@ -1,102 +0,0 @@
|
|||
Index: patroni/patroni/validator.py
|
||||
===================================================================
|
||||
--- patroni.orig/patroni/validator.py
|
||||
+++ patroni/patroni/validator.py
|
||||
@@ -341,13 +341,6 @@ schema = Schema({
|
||||
"port": lambda i: assert_(int(i) <= 65535),
|
||||
Optional("pool_interval"): int
|
||||
},
|
||||
- "raft": {
|
||||
- "self_addr": validate_connect_address,
|
||||
- Optional("bind_addr"): validate_host_port_listen,
|
||||
- "partner_addrs": validate_host_port_list,
|
||||
- Optional("data_dir"): str,
|
||||
- Optional("password"): str
|
||||
- },
|
||||
"zookeeper": {
|
||||
"hosts": Or(comma_separated_host_port, [validate_host_port]),
|
||||
},
|
||||
Index: patroni/tests/test_validator.py
|
||||
===================================================================
|
||||
--- patroni.orig/tests/test_validator.py
|
||||
+++ patroni/tests/test_validator.py
|
||||
@@ -41,13 +41,6 @@ config = {
|
||||
"port": 4000,
|
||||
"pool_interval": 1000
|
||||
},
|
||||
- "raft": {
|
||||
- "self_addr": "127.0.0.1:2222",
|
||||
- "bind_addr": "0.0.0.0:2222",
|
||||
- "partner_addrs": ["127.0.0.1:2223", "127.0.0.1:2224"],
|
||||
- "data_dir": "/",
|
||||
- "password": "12345"
|
||||
- },
|
||||
"zookeeper": {
|
||||
"hosts": "127.0.0.1:3379,127.0.0.1:3380"
|
||||
},
|
||||
@@ -149,7 +142,7 @@ class TestValidator(unittest.TestCase):
|
||||
def test_complete_config(self, mock_out, mock_err):
|
||||
schema(config)
|
||||
output = mock_out.getvalue()
|
||||
- self.assertEqual(['postgresql.bin_dir', 'raft.bind_addr', 'raft.self_addr'], parse_output(output))
|
||||
+ self.assertEqual(['postgresql.bin_dir'], parse_output(output))
|
||||
|
||||
def test_bin_dir_is_file(self, mock_out, mock_err):
|
||||
files.append(config["postgresql"]["data_dir"])
|
||||
@@ -161,8 +154,7 @@ class TestValidator(unittest.TestCase):
|
||||
schema(c)
|
||||
output = mock_out.getvalue()
|
||||
self.assertEqual(['etcd.hosts.1', 'etcd.hosts.2', 'kubernetes.pod_ip', 'postgresql.bin_dir',
|
||||
- 'postgresql.data_dir', 'raft.bind_addr', 'raft.self_addr',
|
||||
- 'restapi.connect_address'], parse_output(output))
|
||||
+ 'postgresql.data_dir', 'restapi.connect_address'], parse_output(output))
|
||||
|
||||
@patch('socket.inet_pton', Mock(), create=True)
|
||||
def test_bin_dir_is_empty(self, mock_out, mock_err):
|
||||
@@ -178,8 +170,8 @@ class TestValidator(unittest.TestCase):
|
||||
with patch('patroni.validator.open', mock_open(read_data='9')):
|
||||
schema(c)
|
||||
output = mock_out.getvalue()
|
||||
- self.assertEqual(['consul.host', 'etcd.host', 'postgresql.bin_dir', 'postgresql.data_dir', 'postgresql.listen',
|
||||
- 'raft.bind_addr', 'raft.self_addr', 'restapi.connect_address'], parse_output(output))
|
||||
+ self.assertEqual(['consul.host', 'etcd.host', 'postgresql.bin_dir', 'postgresql.data_dir',
|
||||
+ 'postgresql.listen', 'restapi.connect_address'], parse_output(output))
|
||||
|
||||
@patch('subprocess.check_output', Mock(return_value=b"postgres (PostgreSQL) 12.1"))
|
||||
def test_data_dir_contains_pg_version(self, mock_out, mock_err):
|
||||
@@ -197,7 +189,7 @@ class TestValidator(unittest.TestCase):
|
||||
with patch('patroni.validator.open', mock_open(read_data='12')):
|
||||
schema(config)
|
||||
output = mock_out.getvalue()
|
||||
- self.assertEqual(['raft.bind_addr', 'raft.self_addr'], parse_output(output))
|
||||
+ self.assertEqual([], parse_output(output))
|
||||
|
||||
@patch('subprocess.check_output', Mock(return_value=b"postgres (PostgreSQL) 12.1"))
|
||||
def test_pg_version_missmatch(self, mock_out, mock_err):
|
||||
@@ -212,8 +204,7 @@ class TestValidator(unittest.TestCase):
|
||||
with patch('patroni.validator.open', mock_open(read_data='11')):
|
||||
schema(c)
|
||||
output = mock_out.getvalue()
|
||||
- self.assertEqual(['etcd.hosts', 'postgresql.data_dir',
|
||||
- 'raft.bind_addr', 'raft.self_addr'], parse_output(output))
|
||||
+ self.assertEqual(['etcd.hosts', 'postgresql.data_dir'], parse_output(output))
|
||||
|
||||
@patch('subprocess.check_output', Mock(return_value=b"postgres (PostgreSQL) 12.1"))
|
||||
def test_pg_wal_doesnt_exist(self, mock_out, mock_err):
|
||||
@@ -226,7 +217,7 @@ class TestValidator(unittest.TestCase):
|
||||
with patch('patroni.validator.open', mock_open(read_data='11')):
|
||||
schema(c)
|
||||
output = mock_out.getvalue()
|
||||
- self.assertEqual(['postgresql.data_dir', 'raft.bind_addr', 'raft.self_addr'], parse_output(output))
|
||||
+ self.assertEqual(['postgresql.data_dir'], parse_output(output))
|
||||
|
||||
def test_data_dir_is_empty_string(self, mock_out, mock_err):
|
||||
directories.append(config["postgresql"]["data_dir"])
|
||||
@@ -238,5 +229,5 @@ class TestValidator(unittest.TestCase):
|
||||
c["postgresql"]["bin_dir"] = ""
|
||||
schema(c)
|
||||
output = mock_out.getvalue()
|
||||
- self.assertEqual(['kubernetes', 'postgresql.bin_dir', 'postgresql.data_dir',
|
||||
- 'postgresql.pg_hba', 'raft.bind_addr', 'raft.self_addr'], parse_output(output))
|
||||
+ self.assertEqual(['kubernetes', 'postgresql.bin_dir',
|
||||
+ 'postgresql.data_dir', 'postgresql.pg_hba'], parse_output(output))
|
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):
|
3
debian/patches/series
vendored
3
debian/patches/series
vendored
|
@ -3,6 +3,5 @@ acceptance_tests_system_patroni.patch
|
|||
requirements_setuptools.patch
|
||||
offline_intersphinx.patch
|
||||
requirements_cdiff.patch
|
||||
regression_tests_disable_raft_tests.py
|
||||
avoid_overwriting_configuration_during_boostrap.patch
|
||||
acceptance_tests_speedup.patch
|
||||
regression_tests_skip_citus_test.patch
|
||||
|
|
14
debian/patches/startup_scripts.patch
vendored
14
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,10 +31,8 @@ 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
|
||||
--- 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",
|
||||
|
@ -50,7 +46,7 @@ Index: patroni/extras/startup-scripts/patroni.service
|
|||
[Service]
|
||||
Type=simple
|
||||
@@ -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.
|
||||
# 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
|
||||
|
|
24
debian/tests/acceptance
vendored
24
debian/tests/acceptance
vendored
|
@ -44,6 +44,16 @@ case $DEB_HOST_ARCH in
|
|||
;;
|
||||
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 $(ls -1r /usr/lib/postgresql/); do
|
||||
echo "### PostgreSQL $PG_VERSION acceptance-$DCS $@ ###"
|
||||
|
@ -52,9 +62,15 @@ for PG_VERSION in $(ls -1r /usr/lib/postgresql/); do
|
|||
else
|
||||
SKIP=
|
||||
fi
|
||||
$SU "set -o pipefail; ETCD_UNSUPPORTED_ARCH=$ETCD_ARCH DCS=$DCS \
|
||||
if ! $SU "set -o pipefail; ETCD_UNSUPPORTED_ARCH=$ETCD_ARCH DCS=$DCS \
|
||||
PATH=/usr/lib/postgresql/${PG_VERSION}/bin:$PATH \
|
||||
behave ${SKIP} $@ | ts" || \
|
||||
(for file in $(ls features/output/*_failed/*); do echo "$file:"; cat $file; done && exit 1)
|
||||
echo "### End $PG_VERSION acceptance-$DCS ###"
|
||||
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
|
||||
|
|
35
debian/tests/control
vendored
35
debian/tests/control
vendored
|
@ -1,3 +1,16 @@
|
|||
# etc3
|
||||
Features: test-name=acceptance-etcd3
|
||||
Depends:
|
||||
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:
|
||||
|
@ -9,7 +22,7 @@ Depends:
|
|||
python3-etcd (>= 0.4.3),
|
||||
@,
|
||||
Test-Command: debian/tests/acceptance etcd features/basic_replication.feature
|
||||
Restrictions: allow-stderr
|
||||
Restrictions: needs-root, allow-stderr
|
||||
|
||||
Features: test-name=acceptance-etcd
|
||||
Depends:
|
||||
|
@ -21,7 +34,7 @@ Depends:
|
|||
python3-etcd (>= 0.4.3),
|
||||
@,
|
||||
Test-Command: debian/tests/acceptance etcd
|
||||
Restrictions: allow-stderr, flaky
|
||||
Restrictions: needs-root, allow-stderr, flaky
|
||||
|
||||
# consul
|
||||
Features: test-name=acceptance-consul
|
||||
|
@ -34,7 +47,7 @@ Depends:
|
|||
python3-coverage,
|
||||
@,
|
||||
Test-Command: debian/tests/acceptance consul
|
||||
Restrictions: allow-stderr, flaky
|
||||
Restrictions: allow-stderr, flaky, skip-not-installable
|
||||
|
||||
# zookeeper
|
||||
Features: test-name=acceptance-zookeeper
|
||||
|
@ -45,10 +58,23 @@ Depends:
|
|||
python3-behave,
|
||||
python3-coverage,
|
||||
python3-kazoo,
|
||||
procps,
|
||||
@,
|
||||
Test-Command: debian/tests/acceptance zookeeper
|
||||
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,
|
||||
|
@ -58,6 +84,7 @@ Depends:
|
|||
python3-kazoo,
|
||||
python3-kubernetes,
|
||||
python3-mock,
|
||||
python3-pysyncobj,
|
||||
python3-pytest-cov,
|
||||
@,
|
||||
Tests: test
|
||||
|
|
4
debian/tests/test
vendored
4
debian/tests/test
vendored
|
@ -9,8 +9,4 @@ export TZ=UTC # suppress UnknownTimeZoneError('Etc/UTC',)
|
|||
# clean up afterwards
|
||||
trap 'rm -f /tmp/pgpass?' 0 2 3 15
|
||||
|
||||
# remove raft tests for now
|
||||
rm -f tests/test_raft*py
|
||||
rm -f patroni/dcs/raft.py patroni/raft_controller.py
|
||||
|
||||
python3 setup.py test
|
||||
|
|
Loading…
Reference in a new issue