You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: failoverQuorum requires more than 2 instances #8679
The Cluster "pg-eu" is invalid: spec.instances: Invalid value: 2: failoverQuorum requires more than 2 instances.
just now got this error, while trying to test if quorum failover prevents data loss with preferred dataDurability and 2 instances. we probably don't want that check. if we have ANY 1 then we need both replicas available to safely failover (N=2 means three instances). if we have ANY 2 (or first 2) then we can failover with a single replica.
this design should work great even with two instances. if the second instance isn't yet added back in then we want to block failover. once the second instance is in synchronous_standby_names then we can failover
The validation requiring more than 2 instances for failoverQuorum in CloudNativePG is intentional and not a bug. This restriction is a safeguard to prevent unsafe failover scenarios and potential data loss in small clusters, especially when using dataDurability: preferred with only 2 nodes. The underlying logic is based on distributed systems theory: with just 2 instances, it's not possible to guarantee safe automatic promotion without risking split-brain or data loss if one node is unavailable. The quorum check (R + W > N) is designed to ensure that failover only happens when it's provably safe, which is generally only possible with 3 or more nodes in the cluster [docs].
CloudNativePG maintainers and documentation recommend deploying clusters with at least 3 nodes for synchronous replication and failover quorum. Two-node clusters are inherently risky for automatic failover and are not fully supported for this feature [discussion][discussion]. There are no official workarounds for enabling failoverQuorum with only 2 instances, and the restriction is enforced in the operator's validation logic [PR #8589].
If you need high availability with strong data durability guarantees, the best practice is to use at least 3 instances. For more details and design rationale, see the failover quorum documentation and related design discussions.
Activity
dosubot commentedon Sep 29, 2025
The validation requiring more than 2 instances for
failoverQuorumin CloudNativePG is intentional and not a bug. This restriction is a safeguard to prevent unsafe failover scenarios and potential data loss in small clusters, especially when usingdataDurability: preferredwith only 2 nodes. The underlying logic is based on distributed systems theory: with just 2 instances, it's not possible to guarantee safe automatic promotion without risking split-brain or data loss if one node is unavailable. The quorum check (R + W > N) is designed to ensure that failover only happens when it's provably safe, which is generally only possible with 3 or more nodes in the cluster [docs].CloudNativePG maintainers and documentation recommend deploying clusters with at least 3 nodes for synchronous replication and failover quorum. Two-node clusters are inherently risky for automatic failover and are not fully supported for this feature [discussion][discussion]. There are no official workarounds for enabling failoverQuorum with only 2 instances, and the restriction is enforced in the operator's validation logic [PR #8589].
If you need high availability with strong data durability guarantees, the best practice is to use at least 3 instances. For more details and design rationale, see the failover quorum documentation and related design discussions.
To reply, just mention @dosu.
Docs are dead. Just use Dosu.
fix: allow quorum-based failover with two instances
fix: allow quorum-based failover with two instances (cloudnative-pg#8680
fix: allow quorum-based failover with two instances (#8680)