diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index df911e54..aafe6b56 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -174,7 +174,7 @@ jobs: - uses: jakebailey/pyright-action@v1 with: - version: 1.1.336 + version: 1.1.338 docs: runs-on: ubuntu-latest diff --git a/docs/releases.rst b/docs/releases.rst index cd2714b6..c68977cd 100644 --- a/docs/releases.rst +++ b/docs/releases.rst @@ -3,6 +3,44 @@ Release notes ============= +Version 3.2.1 +------------- + +**Bugfixes** + +- Limit accepted values for ``--format`` argument in ``patronictl`` (Alexander Kukushkin) + + It used to accept any arbitrary string and produce no output if the value wasn't recognized. + +- Verify that replica nodes received checkpoint LSN on shutdown before releasing the leader key (Alexander Kukushkin) + + Previously in some cases, we were using LSN of the SWITCH record that is followed by CHECKPOINT (if archiving mode is enabled). As a result the former primary sometimes had to do ``pg_rewind``, but there would be no data loss involved. + +- Do a real HTTP request when performing node name uniqueness check (Alexander Kukushkin) + + When running Patroni in containers it is possible that the traffic is routed using ``docker-proxy``, which listens on the port and accepts incoming connections. It was causing false positives. + +- Fixed Citus support with Etcd v2 (Alexander Kukushkin) + + Patroni was failing to deploy a new Citus cluster with Etcd v2. + +- Fixed ``pg_rewind`` behavior with Postgres v16+ (Alexander Kukushkin) + + The error message format of ``pg_waldump`` changed in v16 which caused ``pg_rewind`` to be called by Patroni even when it was not necessary. + +- Fixed bug with custom bootstrap (Alexander Kukushkin) + + Patroni was falsely applying ``--command`` argument, which is a bootstrap command itself. + +- Fixed the issue with REST API health check endpoints (Sophia Ruan) + + There were chances that after Postgres restart it could return ``unknown`` state for Postgres because connections were not properly closed. + +- Cache ``postgres --describe-config`` output results (Waynerv) + + They are used to figure out which GUCs are available to validate PostgreSQL configuration and we don't expect this list to change while Patroni is running. + + Version 3.2.0 ------------- diff --git a/patroni/api.py b/patroni/api.py index 2adc5f98..5761d359 100644 --- a/patroni/api.py +++ b/patroni/api.py @@ -37,7 +37,7 @@ from .utils import deep_compare, enable_keepalive, parse_bool, patch_config, Ret logger = logging.getLogger(__name__) -def check_access(func: Callable[['RestApiHandler'], None]) -> Callable[..., None]: +def check_access(func: Callable[..., None]) -> Callable[..., None]: """Check the source ip, authorization header, or client certificates. .. note:: diff --git a/patroni/ctl.py b/patroni/ctl.py index 9345d18e..3e981b45 100644 --- a/patroni/ctl.py +++ b/patroni/ctl.py @@ -819,7 +819,7 @@ def query( raise PatroniCtlException('You need to specify either --command or --file') sql = command - connect_parameters = {} + connect_parameters: Dict[str, str] = {} if username: connect_parameters['username'] = username if password: @@ -1093,7 +1093,7 @@ def restart(cluster_name: str, group: Optional[int], member_names: List[str], version = click.prompt('Restart if the PostgreSQL version is less than provided (e.g. 9.5.2) ', type=str, default='') - content = {} + content: Dict[str, Any] = {} if pending: content['restart_pending'] = True diff --git a/patroni/dcs/consul.py b/patroni/dcs/consul.py index 1324e606..27cab778 100644 --- a/patroni/dcs/consul.py +++ b/patroni/dcs/consul.py @@ -423,7 +423,7 @@ class Consul(AbstractDCS): _, results = self.retry(self._client.kv.get, path, recurse=True, consistency=self._consistency) if results is None: return Cluster.empty() - nodes = {} + nodes: Dict[str, Dict[str, Any]] = {} for node in results: node['Value'] = (node['Value'] or b'').decode('utf-8') nodes[node['Key'][len(path):]] = node diff --git a/patroni/postgresql/citus.py b/patroni/postgresql/citus.py index 26923f37..b50dc1d0 100644 --- a/patroni/postgresql/citus.py +++ b/patroni/postgresql/citus.py @@ -100,7 +100,8 @@ class CitusHandler(Thread): def on_demote(self) -> None: with self._condition: self._pg_dist_node.clear() - self._tasks[:] = [] + empty_tasks: List[PgDistNode] = [] + self._tasks[:] = empty_tasks self._in_flight = None def query(self, sql: str, *params: Any) -> List[Tuple[Any, ...]]: diff --git a/patroni/version.py b/patroni/version.py index e5bcac2d..96592c7d 100644 --- a/patroni/version.py +++ b/patroni/version.py @@ -2,4 +2,4 @@ :var __version__: the current Patroni version. """ -__version__ = '3.2.0' +__version__ = '3.2.1'