Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor VolSync Replication Code for Consistent Final Sync Preparation #1395

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

Conversation

BenamarMk
Copy link
Member

@BenamarMk BenamarMk commented May 14, 2024

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:

    1. Detaches the application PVC from the PV.
    2. Updates the PV claimRef to a temporary PVC name
    3. Creates the temporary PVC.
    4. Removes the finalizer from the application PVC. At this point, the application PVC can be deleted
    5. 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:

  • Cleanup any prepare/finalsync cli output residue.
  • Complete e2e testing with VolSync and VolRep
  • Add more unit tests
  • Ensure disabling DR still works

Addresses this comment: #558 (comment)

BenamarMk pushed a commit to BenamarMk/ramen that referenced this pull request May 14, 2024
Refactor final sync preparation and execution for PVCs targeted for VolSync
replication, aligning code and behavior with VolRep.

PR link: RamenDR#1395

Signed-off-by: Benamar Mekhissi <bmekhiss@ibm.com>
@@ -474,7 +483,7 @@ func (v *VSHandler) createOrUpdateRS(rsSpec ramendrv1alpha1.VolSyncReplicationSo
ReplicationSourceVolumeOptions: volsyncv1alpha1.ReplicationSourceVolumeOptions{
// Always using CopyMethod of snapshot for now - could use 'Clone' CopyMethod for specific
Copy link
Member

@ELENAGER ELENAGER May 17, 2024

Choose a reason for hiding this comment

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

Comment is outdated - now it is not always snapshot - for final sync it is direct.

BenamarMk pushed a commit to BenamarMk/ramen that referenced this pull request May 20, 2024
Refactor final sync preparation and execution for PVCs targeted for VolSync
replication, aligning code and behavior with VolRep.

PR link: RamenDR#1395

Signed-off-by: Benamar Mekhissi <bmekhiss@ibm.com>
BenamarMk pushed a commit to BenamarMk/ramen that referenced this pull request May 20, 2024
Refactor final sync preparation and execution for PVCs targeted for VolSync
replication, aligning code and behavior with VolRep.

PR link: RamenDR#1395

Signed-off-by: Benamar Mekhissi <bmekhiss@ibm.com>
Refactor final sync preparation and execution for PVCs targeted for VolSync
replication, aligning code and behavior with VolRep.

PR link: RamenDR#1395

Signed-off-by: Benamar Mekhissi <bmekhiss@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants