RamenDR / ramen

Apache License 2.0
72 stars 52 forks source link

Check if failover target is ready for failover #1358

Closed ShyamsundarR closed 3 months ago

ShyamsundarR commented 3 months ago

Check if a VRG either exists as Primary on the failoverCluster or if Secondary protectes PVCs via VolSync, in all other cases Secondary cluster is not ready for a failover.

e.g a hub loss and a managed cluster loss when the surviving cluster was the Secondary may not be a peer ready cluster to failover to.

Additionally: Check if VRG has reached Primary state before cleanup

In cases where switchToCluster loops out due to errors or due to waiting for VRG to manifest on the failoverCluster, the core failover loop does not additionally check is VRG has reached the Primary state.

This commit addresses this gap.

NOTE: In such cases placement decision is also potentially not updated but that is ensured before entering cleanup phase in ensureActionCompleted

ShyamsundarR commented 3 months ago

TODO:

ShyamsundarR commented 3 months ago

@BenamarMk and @raghavendra-talur code is complete for review, will be doing e2e tests tomorrow.

ShyamsundarR commented 3 months ago

@BenamarMk e2e against Volsync and volrep completed (series of deploy->failover->relocate->failover like scenarios), no issues found with the changes.