Preserve sync quorum in primary PDB without master selector (#3119)

* Use minAvalable=SynchronousNodeCount + 1 in primary PDB when master selector is disabled

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
Co-authored-by: Ida Novindasari <idanovinda@gmail.com>
This commit is contained in:
annielzy
2026-07-17 11:56:48 +02:00
committed by GitHub
co-authored by Felix Kunde Ida Novindasari
parent 7578f9d2c0
commit 5c6dcc65e2
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -2278,6 +2278,12 @@ func (c *Cluster) generatePrimaryPodDisruptionBudget() *policyv1.PodDisruptionBu
labels[c.OpConfig.PodRoleLabel] = string(Master)
}
// When master selector is disabled and synchronous_mode_strict is on, require
// master + synchronous_node_count (default 1) healthy pods for write quorum.
if pdbMasterLabelSelector != nil && !*pdbMasterLabelSelector && minAvailable.IntVal > 0 && c.Spec.SynchronousModeStrict {
minAvailable = intstr.FromInt32(int32(c.Spec.SynchronousNodeCount + 1))
}
return &policyv1.PodDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{
Name: c.PrimaryPodDisruptionBudgetName(),