Fix CG PVC Selection Issue Due to storageId
Mismatch & Improve Grouping Algorithm
#1809
+128
−76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently, we started using
storageId
as part of the label to determine whether a PVC belongs to a consistency group. While the initial deployment and synchronization from the primary to the secondary cluster work correctly, failover or relocation results in a differentstorageId
on the new primary.This mismatch caused issues when setting up the source and destination again, leading to leaving
ReplicationDestination
behind causing the sync to occur locally.Additionally, I refactored the algorithm responsible for building the groups while addressing this issue. The previous implementation was too complex and inefficient. The new approach simplifies the grouping logic while improving performance and making it easier to maintain.
Moreover, the
ReplicationGroupDestination
andReplicationGroupSource
resource names were too long and tedious to type. To improve usability, I introduced shorter aliases when usingoc get
. Now, you can simply run:oc get rgd
instead ofoc get replicationgroupdestination
oc get rgs
instead ofoc get replicationgroupsource
Fixes: DFBUGS-1520
Note: For 4.19, we’ll be switching to
ReplicationID
instead ofstorageId
. This change won’t affect the refactoring done in this PR.