Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Fix bug 2207632: infinite loop due to adding VR finalizer during PVC deletion #137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BenamarMk
Copy link

Resolve issue with VR falling into an infinite loop when attempting to add the finalizer "replication.storage.openshift.io/pvc-protection" during PVC deletion.

Fixing bug 2207632

Relevant gchat conversion is found here:

…deletion

Fixing bug 2207632: Resolve issue with VR falling into an infinite loop when
attempting to add the finalizer replication.storage.openshift.io/pvc-protection
during PVC deletion.

Signed-off-by: Benamar Mekhissi <[email protected]>
Copy link
Member

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BenamarMk we have deprecated the volume replication operator and migrated to kubernetes-csi addons, feel free to post the same change at https://github.com/csi-addons/kubernetes-csi-addons/blob/main/controllers/replication.storage/volumereplication_controller.go

@@ -188,10 +188,12 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re

return reconcile.Result{}, err
}
if err = r.addFinalizerToPVC(logger, pvc); err != nil {
logger.Error(err, "Failed to add PersistentVolumeClaim finalizer")
if pvc.GetDeletionTimestamp().IsZero() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the PVC is getting deleted should we just return error at https://github.com/csi-addons/kubernetes-csi-addons/blob/main/controllers/replication.storage/volumereplication_controller.go#L200 and let the next reconcile fail?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants