From 1d7ec25a5508376cd4adb7595b2fc8164cb630a5 Mon Sep 17 00:00:00 2001 From: Santosh Pillai Date: Wed, 2 Apr 2025 11:27:44 +0530 Subject: [PATCH] osd: fix pdbs in case of node drain the maxunavailable count was getting reset back to 1 after 60 seconds. This PR prevents resetting of the maxUnavailable OSD count. Signed-off-by: Santosh Pillai (cherry picked from commit e83ca35531358c4730434c7074ea58da0444f1f1) --- pkg/operator/ceph/disruption/clusterdisruption/add.go | 2 +- pkg/operator/ceph/disruption/clusterdisruption/osd.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/operator/ceph/disruption/clusterdisruption/add.go b/pkg/operator/ceph/disruption/clusterdisruption/add.go index 08bed3174..0c2cb270f 100644 --- a/pkg/operator/ceph/disruption/clusterdisruption/add.go +++ b/pkg/operator/ceph/disruption/clusterdisruption/add.go @@ -69,7 +69,7 @@ func pdbPredicate[T *policyv1.PodDisruptionBudget]() predicate.TypedFuncs[T] { UpdateFunc: func(e event.TypedUpdateEvent[T]) bool { pdb := (*policyv1.PodDisruptionBudget)(e.ObjectNew) - // reconcile for the main PDB update event when first OSD goes down, that is, when `DisruptionsAllowed` gets updated to 0. + // reconcile for the main PDB update event when first OSD goes down, that is, when `DisruptionsAllowed` gets updated to 0. return pdb.Name == osdPDBAppName && pdb.Spec.MaxUnavailable.IntVal == 1 && pdb.Status.DisruptionsAllowed == 0 }, DeleteFunc: func(e event.TypedDeleteEvent[T]) bool { diff --git a/pkg/operator/ceph/disruption/clusterdisruption/osd.go b/pkg/operator/ceph/disruption/clusterdisruption/osd.go index bb3aa2d32..5a4979e47 100644 --- a/pkg/operator/ceph/disruption/clusterdisruption/osd.go +++ b/pkg/operator/ceph/disruption/clusterdisruption/osd.go @@ -268,7 +268,6 @@ func (r *ReconcileClusterDisruption) reconcilePDBsForOSDs( maxUnavailableOSDCount = 1 } else { maxUnavailableOSDCount = len(downOSDs) + 1 - resetPDBConfig(pdbStateMap) } } else { maxUnavailableOSDCount = len(downOSDs) + 1