Refresh patches for next release

This commit is contained in:
Christoph Berg 2022-11-18 11:19:10 +01:00
parent 9761d8f991
commit 64a5a762c5
5 changed files with 22 additions and 124 deletions

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
patroni (2.1.5-1) UNRELEASED; urgency=medium
*
-- Christoph Berg <myon@debian.org> Fri, 18 Nov 2022 11:18:48 +0100
patroni (2.1.4-3) unstable; urgency=medium
* Enable RAFT support and add python3-pysyncobj to dep alternatives.

View file

@ -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

View file

@ -1,14 +1,11 @@
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],
stdout=self._log, stderr=subprocess.STDOUT, cwd=self._work_directory)
def stop(self, kill=False, timeout=15, postgres=False):
--- a/features/environment.py
+++ b/features/environment.py
@@ -146,7 +146,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

View file

@ -4,4 +4,3 @@ requirements_setuptools.patch
offline_intersphinx.patch
requirements_cdiff.patch
avoid_overwriting_configuration_during_boostrap.patch
acceptance_tests_speedup.patch

View file

@ -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