This pull request focuses on refactoring the preparation and execution of final sync for PVCs targeted for VolSync replication. The main goal is to align the VolSync-related code and behavior with that of VolRep, ensuring logical consistency across the two processes.
In this PR, the following changes were made:
Eliminated the intermediate step of preparing for and executing final sync routines.
Redesigned the ownership handling of application PVCs during VRG transitions from primary to secondary (for relocation only).
Previously, application PVCs were owned by the VRG when in the primary state. This PR adjusts the ownership mechanism when switching from Primary to Secondary as follows:
Detaches the application PVC from the PV.
Updates the PV claimRef to a temporary PVC name
Creates the temporary PVC.
Removes the finalizer from the application PVC. At this point, the application PVC can be deleted
Executes the final sync process.
After final sync is complete, Ramen cleans up the temporary PVC, leaving the PV in the Released status.
During the setup of the ReplicationDestination (when becoming Secondary), Ramen creates the application PVC, and the VRG assumes ownership. This ownership adjustment ensures that if the VRG is deleted, the application PVC is properly garbage collected.
TODO:
[x] Cleanup any prepare/finalsync cli output residue.
This pull request focuses on refactoring the preparation and execution of final sync for PVCs targeted for VolSync replication. The main goal is to align the VolSync-related code and behavior with that of VolRep, ensuring logical consistency across the two processes.
In this PR, the following changes were made:
Eliminated the intermediate step of preparing for and executing final sync routines.
Redesigned the ownership handling of application PVCs during VRG transitions from primary to secondary (for relocation only).
Previously, application PVCs were owned by the VRG when in the primary state. This PR adjusts the ownership mechanism when switching from Primary to Secondary as follows:
After final sync is complete, Ramen cleans up the temporary PVC, leaving the PV in the Released status.
During the setup of the ReplicationDestination (when becoming Secondary), Ramen creates the application PVC, and the VRG assumes ownership. This ownership adjustment ensures that if the VRG is deleted, the application PVC is properly garbage collected.
TODO:
Addresses this comment: https://github.com/RamenDR/ramen/issues/558#issuecomment-1459057890