From ba54b00c7e5b0bbf76006a614b3dc22657eceb4f Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Wed, 21 Aug 2024 01:53:00 -0400 Subject: [PATCH 1/2] drpc: set ProgressionWaitOnUserToCleanUp for both volsync and volrep Signed-off-by: Raghavendra Talur --- internal/controller/drplacementcontrol.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/controller/drplacementcontrol.go b/internal/controller/drplacementcontrol.go index cc3ac787c..a73bc7379 100644 --- a/internal/controller/drplacementcontrol.go +++ b/internal/controller/drplacementcontrol.go @@ -1851,10 +1851,6 @@ func (d *DRPCInstance) ensureVRGManifestWorkOnClusterDeleted(clusterName string) d.log.Info("Request not complete yet", "cluster", clusterName) - if d.instance.Spec.ProtectedNamespaces != nil && len(*d.instance.Spec.ProtectedNamespaces) > 0 { - d.setProgression(rmn.ProgressionWaitOnUserToCleanUp) - } - // IF we get here, either the VRG has not transitioned to secondary (yet) or delete didn't succeed. In either cases, // we need to make sure that the VRG object is deleted. IOW, we still have to wait return !done, nil @@ -1916,6 +1912,12 @@ func (d *DRPCInstance) ensureVRGIsSecondaryOnCluster(clusterName string) bool { return false } + // If the VRG is secondary everywhere, then we need to wait for the cleanup + // to be done by the user in case of discovered apps + if d.instance.Spec.ProtectedNamespaces != nil && len(*d.instance.Spec.ProtectedNamespaces) > 0 { + d.setProgression(rmn.ProgressionWaitOnUserToCleanUp) + } + return true } From 68b54be99fb6da35743725d27ef1adeae451a219 Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Tue, 10 Sep 2024 07:49:18 -0400 Subject: [PATCH 2/2] cleanup even for volsync Signed-off-by: Raghavendra Talur --- internal/controller/drplacementcontrol.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/controller/drplacementcontrol.go b/internal/controller/drplacementcontrol.go index a73bc7379..08dc8fca9 100644 --- a/internal/controller/drplacementcontrol.go +++ b/internal/controller/drplacementcontrol.go @@ -1732,16 +1732,16 @@ func (d *DRPCInstance) EnsureCleanup(clusterToSkip string) error { d.log.Info(fmt.Sprintf("PeerReady Condition is %s, msg: %s", condition.Status, condition.Message)) // IFF we have VolSync PVCs, then no need to clean up - homeCluster := clusterToSkip + // homeCluster := clusterToSkip - repReq, err := d.IsVolSyncReplicationRequired(homeCluster) - if err != nil { - return fmt.Errorf("failed to check if VolSync replication is required (%w)", err) - } + //repReq, err := d.IsVolSyncReplicationRequired(homeCluster) + //if err != nil { + // return fmt.Errorf("failed to check if VolSync replication is required (%w)", err) + //} - if repReq { - return d.cleanupForVolSync(clusterToSkip) - } + //if repReq { + // return d.cleanupForVolSync(clusterToSkip) + //} clean, err := d.cleanupSecondaries(clusterToSkip) if err != nil {