-
Notifications
You must be signed in to change notification settings - Fork 557
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
rbd: get volumegroup in secondary cluster #5118
base: devel
Are you sure you want to change the base?
rbd: get volumegroup in secondary cluster #5118
Conversation
a045d55
to
13817b7
Compare
Tried relocation of VolumeGroupReplication resources -
|
internal/rbd/group/util.go
Outdated
} | ||
|
||
vg, err := generateVolumeGroup(id, csiDriver, creds, csiID) | ||
if err != nil && !errors.Is(err, util.ErrPoolNotFound) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to make use of the following function instead of singular pool not found check ?
ceph-csi/internal/rbd/rbd_util.go
Line 1308 in c45bc7d
func shouldRetryVolumeGeneration(err error) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, we could use this function. But this would result in import cycle issue.
I have tried to refactor and move this helper function to internal/util.
b5125d5
to
79a1734
Compare
Signed-off-by: Praveen M <[email protected]>
…al/util Signed-off-by: Praveen M <[email protected]>
Currently, `GetVolumeGroup()` fetches the RBD group from the pool using the clusterID & poolID encoded in the VolumeGroupHandle. However, this approach may fail in a secondary mirrored cluster, where the clusterID & poolID could differ. This commit ensures that `GetVolumeGroup` leverages the clusterIDMapping and RBDPoolIDMapping to locate the RBD group in the appropriate pool if it is not found in the pool corresponding to the poolID encoded in the VolumeGroupHandle. Signed-off-by: Praveen M <[email protected]>
79a1734
to
a69748b
Compare
} | ||
} | ||
|
||
cvg.csiDriver = vg.csiDriver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really ugly and rather inefficient. It is also very easy to forget copying an attribute of the struct that was set in an other function.
Can't generateVolumeGroup()
and generateVolumeGroupFromMapping()
not be a function of the commonVolumeGroup
type so that they update their own instance?
Describe what this PR does
Currently,
GetVolumeGroup()
fetches the RBD group from the pool using the clusterID & poolID encoded in the VolumeGroupHandle. However, this approach may fail in a secondary mirrored cluster, where the clusterID & poolID could differ.This commit ensures that
GetVolumeGroup
leverages the clusterIDMapping and RBDPoolIDMapping to locate the RBD group in the appropriate pool if it is not found in the pool corresponding to the poolID encoded in the VolumeGroupHandle.Future concerns
List items that are not part of the PR and do not impact it's
functionality, but are work items that can be taken up subsequently.
Checklist:
Show available bot commands
These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:
/retest ci/centos/<job-name>
: retest the<job-name>
after unrelatedfailure (please report the failure too!)