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

Initial blueprint changes for preserving VRG as Secondary always #1652

Merged
merged 3 commits into from
Nov 16, 2024

Conversation

ShyamsundarR
Copy link
Member

  • Start by not needing to delete VRG as secondary from DRPC reconciler
  • For VR based VRG reconciliation ensure PVC is released when requested state is Secondary
  • Some trivial rename of functions to handle as secondary than as secondary for volsync
  • Adjust test cases to expect a secondary manifest work to be always present

There is more work to do in terms of cleanup and refactoring, but the bulk of changes to address the need should be present with this commit.

NOTE: Posted for reviews, refactor of the commit into more logical units is possible as work progresses

- Start by not needing to delete VRG as secondary from DRPC reconciler
- For VR based VRG reconciliation ensure PVC is released when requested state
is Secondary
- Some trivial rename of functions to handle as secondary than as secondary for
volsync
- Adjust test cases to expect a secondary manifest work to be always present

There is more work to do in terms of cleanup and refactoring, but the bulk of
changes to address the need should be present with this commit.

NOTE: Posted for reviews, refactor of the commit into more logical units is
possible as work progresses

Signed-off-by: Shyamsundar Ranganathan <[email protected]>
Copy link
Member

@BenamarMk BenamarMk left a comment

Choose a reason for hiding this comment

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

Looks good to me. In regards to progression changes. We talked about it, but I want to capture it here. Instead of EnsuringVolSyncSetup, it might be clearer to use EnsuringSecondarySetup. Similarly, CleaningUp could be more descriptive, something like; MovingOldPrimaryToSecondary. Alternatively, you could consider combining both progressions into a single one. Something like; PreparingSecondary.

@ShyamsundarR
Copy link
Member Author

Addressed the function split. Also add one more commit to remove PVCs form protectedPVCs once processing as secondary is complete.

Additionally addressed some of the Unused messages, to be a little more ambiguous at present.

Running mixed mode workload tests and will report on it here.

Copy link
Member

@BenamarMk BenamarMk left a comment

Choose a reason for hiding this comment

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

I added two additional comments regarding potential issues with deleting the ProtectedPVCs. However, any leftover ProtectedPVC will only result in a display issue and won’t cause any harm, even if the secondary becomes the primary again. I think this is fine.

if !containsString(pvc.Finalizers, PvcVRFinalizerProtected) {
log.Info("pvc does not contain VR protection finalizer. Skipping it")

v.pvcStatusDeleteIfPresent(pvc.Namespace, pvc.Name, log)
Copy link
Member

@BenamarMk BenamarMk Nov 15, 2024

Choose a reason for hiding this comment

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

Isn't this call too late for the protectedPVC to be deleted? You have it on line 177, which should cover it; unless we successfully remove the finalizer from the PVC but fail to update the VRG. In that scenario, the PVC will be gone, and we would never reach this point because volRepPVCs most likely wouldn’t have it.

Copy link
Member Author

Choose a reason for hiding this comment

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

True on both comments, I added it in 2 places to be sure, but the PVC disappears quite fast, and also VRG updates are not a gurantee. Saw this with env tests as well in one case.

Overall we need a better place the garbage collect the protected PVC. Currently as it exists it is not added(appended) again etc. but in cases where a PVC is deleted (which is not yet supported) we would need to remove it from the ProtectedPVCs as well.

IOW, this status delete may work at times, but does not impact the functionality at present. Planning to deal with this subsequently.

continue
}

v.pvcStatusDeleteIfPresent(pvc.Namespace, pvc.Name, log)
Copy link
Member

Choose a reason for hiding this comment

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

This is a good place to delete the ProtectedPVC for this PVC. However, reaching this point indicates that line 171 was successful and the PV/PVC were updated, but there is still a possibility that the VRG update might fail. See the comment above for more context.

@ShyamsundarR
Copy link
Member Author

Running mixed mode workload tests and will report on it here.

Done with the tests, ran a sequence of deploy->enableDR->failover->relocate->failover->failover->relocate->relocate->disable->(re)enableDR->relocate->disable->undeploy for a mixed mode app and tests passed.

We can merge this in.

@BenamarMk BenamarMk merged commit e4180c5 into RamenDR:main Nov 16, 2024
20 checks passed
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.

2 participants