-
Notifications
You must be signed in to change notification settings - Fork 560
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
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.
79a1734
to
a69748b
Compare
a69748b
to
e458ef3
Compare
@Mergifyio rebase |
✅ Branch has been successfully rebased |
e458ef3
to
a3d20a0
Compare
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.
/lgtm
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.
small nit
internal/rbd/group/util.go
Outdated
if !util.ShouldRetryVolumeGeneration(err) { | ||
return err | ||
} |
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.
if !util.ShouldRetryVolumeGeneration(err) { | |
return err | |
} | |
if !util.ShouldRetryVolumeGeneration(err) && err !=nil { | |
return err | |
} |
otherwise, we will miss out the debug log on line 180 below
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.
Good catch, thanks! 😄
@Mergifyio rebase |
✅ Branch has been successfully rebased |
a3d20a0
to
733cae1
Compare
733cae1
to
d01d4fe
Compare
Pull request has been modified.
d01d4fe
to
865e967
Compare
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.
Thanks
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
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]>
865e967
to
8a1a340
Compare
/test ci/centos/upgrade-tests-cephfs |
/test ci/centos/upgrade-tests-rbd |
/test ci/centos/k8s-e2e-external-storage/1.32 |
/test ci/centos/mini-e2e-helm/k8s-1.32 |
/test ci/centos/k8s-e2e-external-storage/1.30 |
/test ci/centos/mini-e2e/k8s-1.32 |
/test ci/centos/mini-e2e-helm/k8s-1.30 |
/test ci/centos/k8s-e2e-external-storage/1.31 |
/test ci/centos/mini-e2e/k8s-1.30 |
/test ci/centos/mini-e2e-helm/k8s-1.31 |
/test ci/centos/mini-e2e/k8s-1.31 |
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
/retest ci/centos/mini-e2e-helm/k8s-1.31 |
|
@Mergifyio requeue |
✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically |
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!)