Description:
We are testing synchronous replication behavior in a Kubernetes deployment managed by Patroni (deployed via Percona PostgreSQL Operator).
Our cluster consists of:
-
1 Primary
-
1 Replica
Configuration:
synchronous_mode: "on"
synchronous_mode_strict: true
synchronous_node_count: 1
We performed tests with both:
synchronous_mode_strict: true
and
synchronous_mode_strict: false
and observed identical behavior in both cases.
This raises two questions:
-
When the only synchronous standby is gracefully terminated, we would expect commits on the primary to stall because no synchronous standby is available. However, if Patroni intentionally recognizes a graceful, administratively initiated shutdown and proactively reconfigures synchronous replication to avoid blocking commits, then this behavior may be expected. We would like confirmation of whether this is indeed the intended behavior.
-
More importantly, the observed behavior is identical regardless of whether
synchronous_mode_strictis set totrueorfalse. Based on our understanding, this parameter should influence commit behavior when synchronous standbys become unavailable. The fact that we observe no difference makes it appear thatsynchronous_mode_strictis not having any practical effect in this scenario.
Steps to Reproduce:
-
Deploy a Patroni-managed PostgreSQL cluster with:
-
1 Primary
-
1 Replica
-
-
Configure:
synchronous_mode: "on" synchronous_mode_strict: true synchronous_node_count: 1 -
Generate write transactions against the primary.
-
Gracefully delete the replica pod:
kubectl delete pod <replica-pod> -
Observe commit behavior on the primary.
-
Recreate the replica and verify replication is healthy.
-
Force delete the replica pod:
kubectl delete pod <replica-pod> --force --grace-period=0 -
Observe commit behavior on the primary.
-
Repeat the above tests with:
synchronous_mode_strict: false
Version:
- Patroni Version: 4.1.0
- PostgreSQL Version: 16
- Percona PostgreSQL Operator Version: 2.8.2
- Kubernetes Version: OCP 4.18
Logs:
Logs from Primary:
2026-05-26 14:31:09,979 INFO: Lock owner: pg-cluster-ha-pg-db-pgsa-jmhg-0; I am pg-cluster-ha-pg-db-pgsa-jmhg-0
2026-05-26 14:31:09,993 INFO: Updating synchronous privilege temporarily from [‘pg-cluster-ha-pg-db-pgsa-kq2l-0’] to []
2026-05-26 14:31:10,004 WARNING: No standbys available!
2026-05-26 14:31:10,005 INFO: Assigning synchronous standby status to [‘*’]
server signaled
2026-05-26 14:31:10,050 INFO: no action. I am (pg-cluster-ha-pg-db-pgsa-jmhg-0), the leader with the lock
2026-05-26 14:31:19,980 INFO: Lock owner: pg-cluster-ha-pg-db-pgsa-jmhg-0; I am pg-cluster-ha-pg-db-pgsa-jmhg-0
2026-05-26 14:31:19,994 WARNING: No standbys available!
2026-05-26 14:31:19,994 INFO: Assigning synchronous standby status to [‘*’]
2026-05-26 14:31:20,033 INFO: no action. I am (pg-cluster-ha-pg-db-pgsa-jmhg-0), the leader with the lock
2026-05-26 14:31:29,980 INFO: Lock owner: pg-cluster-ha-pg-db-pgsa-jmhg-0; I am pg-cluster-ha-pg-db-pgsa-jmhg-0
2026-05-26 14:31:29,992 INFO: Assigning synchronous standby status to [‘pg-cluster-ha-pg-db-pgsa-kq2l-0’]
server signaled
2026-05-26 14:31:32,117 INFO: Synchronous standby status assigned to [‘pg-cluster-ha-pg-db-pgsa-kq2l-0’]
Expected Result:
For graceful deletion:
-
If Patroni intentionally treats a graceful replica shutdown as an administrative action and dynamically adjusts synchronous replication configuration, then commits continuing on the primary would be understandable.
-
We would like confirmation whether this is the intended design.
For force deletion:
- The primary should block commits when no synchronous standby is available and
synchronous_mode_strict=true.
For synchronous_mode_strict:
- We expect observable behavioral differences between
synchronous_mode_strict=trueandsynchronous_mode_strict=falsewhen the only synchronous standby becomes unavailable.
Actual Result:
With synchronous_mode_strict=true:
Graceful replica deletion:
-
Replica shuts down.
-
Primary continues accepting writes and commits (logs indicate synchronous_standby_names status being set to [*])
Force replica deletion:
- Primary stalls and commits are blocked.
With synchronous_mode_strict=false:
Graceful replica deletion:
-
Replica shuts down.
-
Primary continues accepting writes and commits.
Force replica deletion:
- Primary stalls and commits are blocked.
The observed behavior is therefore identical regardless of the value of synchronous_mode_strict.
Additional Information:
The primary questions are:
-
Is Patroni intentionally reconfiguring synchronous replication during graceful standby shutdown, thereby allowing commits to continue even when the only synchronous standby is being removed?
-
If so, why does the observed behavior remain unchanged when switching
synchronous_mode_strictbetweentrueandfalse? -
Under what failure or operational scenarios is
synchronous_mode_strictexpected to produce behavior different fromsynchronous_mode_strict=false?