8000 Ensure PVC is deselected only when not in both VR and VS lists by ShyamsundarR · Pull Request #2121 · RamenDR/ramen · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ensure PVC is deselected only when not in both VR and VS lists #2121

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

Merged
merged 1 commit into from
Jun 25, 2025

Conversation

ShyamsundarR
Copy link
Member

Current deselection code checks if a PVC is part of VR PVC lists and if not invokes deselection. This was "assumed" safe as there was a finalizer check for the PVC to ensure it is protected by VR before progressing. This check was deep in the code, and was not applicable to PVCs that were marked for CG based protection. It was also not safe as it removed the PVC from the protectedPVC status unconditionally.

Further, if the PVC was part of VolSync protection, the above was unconditionally executed, and caused PVC protection issues for VolSync PVCs.

The fix provided, ensures that a PVC is NOT protected by either VolSync or VR based protection, before deselecting the same. Further it uses the VR finalizer on the PVC to determine of it was protected by VR or by VolSync to invoke the right deselection function.

Additional changes:
The envtests for deselect/delete of PVCs did not account for an eventual clause to wait for VRG to report that the PVC is no loner protected, before checking S3 for related contents to be absent. This is also fixed as part of this commit.

Current deselection code checks if a PVC is part of VR PVC lists and if
not invokes deselection. This was "assumed" safe as there was a finalizer
check for the PVC to ensure it is protected by VR before progressing. This
check was deep in the code, and was not applicable to PVCs that were marked
for CG based protection. It was also not safe as it removed the PVC from the
protectedPVC status unconditionally.

Further, if
8000
 the PVC was part of VolSync protection, the above was
unconditionally executed, and caused PVC protection issues for VolSync PVCs.

The fix provided, ensures that a PVC is NOT protected by either VolSync or VR
based protection, before deselecting the same. Further it uses the VR finalizer
on the PVC to determine of it was protected by VR or by VolSync to invoke the
right deselection function.

Additional changes:
The envtests for deselect/delete of PVCs did not account for an eventual clause
to wait for VRG to report that the PVC is no loner protected, before checking S3
for related contents to be absent. This is also fixed as part of this commit.

Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
@BenamarMk
Copy link
Member

@ShyamsundarR I'll build a patch and run it on the QE system where we are seeing this issue.

_, pvcUnderVRProtection := pvcsVr[pvcNamespacedName]
_, pvcUnderVSProtection := pvcsVs[pvcNamespacedName]

if pvcUnderVRProtection || pvcUnderVSProtection {
Copy link
Member

Choose a reason for hiding this comment

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

If the PVC is deleted, but the label is still there, it will still be in both lists (pvcsOwned and either pvcsVr or pvcsVr). That means we will not unprotect the deleted PVC as the condition will evaluate to true.

Copy link
Member Author

Choose a reason for hiding this comment

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

Deleted PVCs go through the un-protection flow from reconcileVolRepsAsPrimary and pvcUnprotectVolSyncIfDeleted, so you are correct that in this code path they will be in one of the lists and get processed later for deletion. This (pvcsDeselectedUnprotect) function is only for deselected PVCs.

@BenamarMk
Copy link
Member
BenamarMk commented Jun 25, 2025

I'll build a patch and run it on the QE system where we are seeing this issue.

@ShyamsundarR The patch worked. It looks good to me, other than the one comment.

@BenamarMk BenamarMk merged commit 456b351 into RamenDR:main Jun 25, 2025
30 of 31 checks passed
@ShyamsundarR ShyamsundarR deleted the DFBUGS-2862-upstream branch June 25, 2025 23:47
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
0