-
Notifications
You must be signed in to change notification settings - Fork 586
rbd: add support for changed block tracking RPCs #5347
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
Conversation
b60a6f5 to
3892027
Compare
internal/rbd/controllerserver.go
Outdated
|
|
||
| baseRBDSnap, err := genSnapFromSnapID(ctx, baseSnapshotID, cr, req.GetSecrets()) | ||
| if err != nil { | ||
| return status.Error(codes.Internal, err.Error()) |
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.
Need to handle NotFound?
85a53a1 to
288a354
Compare
56db368 to
6a3d211
Compare
|
Thanks for the quick detailed review The new main modifications are:
failing golang lintci is being handled in #5351 Please take a look again |
|
This pull request now has conflicts with the target branch. Could you please resolve conflicts and force push the corrected changes? 🙏 |
nixpanic
left a comment
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.
1st pass going through this. Needs cleanup and clear splitting of internal RBD things and ControllerServer Snapshot usage. Extend the types.Snapshot interface with required functions, so that ControllerServer does not need to use rbdSnap types directly.
internal/rbd/snap_diff.go
Outdated
|
|
||
| // streamDoneErrCode is a custom error code used to indicate that the | ||
| // stream was closed by the client. | ||
| streamDoneErrCode = -1 |
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.
Is there a reason to not use google.golang.org/grpc/codes constants? Or, maybe base it on return values of read(), like EOF and so on?
72390e5 to
4ff0a22
Compare
internal/rbd/errors/errors.go
Outdated
| ) | ||
|
|
||
| type ErrorCode interface { | ||
| // Code returns the error code. |
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.
Comment Code -> ErrorCode.
Can you also add a comment for the interface itself, with a small explanation how (which kind of errors) it can be used?
internal/rbd/snap_diff.go
Outdated
| // StreamMetadata streams the block metadata for a snapshot. | ||
| // If baseRBDSnap is provided, it calculates the delta between the | ||
| // current snapshot and the base snapshot. | ||
| func (rbdSnap *rbdSnapshot) StreamMetadata( |
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.
I have the feeling this function does too much. The rbdSnapshot struct should probably not send anything, but instead return []*csi.BlockMetadata to the caller which can then send it out? Would that not make it a cleaner implementation?
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.
I have the feeling this function does too much.
Broke down this function to include multiple helpers
The
rbdSnapshotstruct should probably not send anything, but instead return[]*csi.BlockMetadatato the caller which can then send it out? Would that not make it a cleaner implementation?
It's a streaming API, so we would be sending more than once.
Used this as inspiration to instead send down a func that only takes []*csi.BlockMetadata as input and send stream response internally.
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.
Looks easier to understand already, thanks.
I understand that passing sendResponse makes things easier. It ties CSI+rbd functionality very closely together, which isn't very nice. But librbd.DiffIterateByIDConfig{} needs the callback, so I'm also not sure how to split the CSI/rbd things more. This is fine for now, maybe we can come up with an alternative approach later.
9c9afb4 to
755348e
Compare
|
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
|
This pull request has been removed from the queue for the following reason: The pull request can't be updated. You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. |
|
@Mergifyio rebase |
Signed-off-by: Rakshith R <rar@redhat.com>
Signed-off-by: Rakshith R <rar@redhat.com>
This commit adds support for GetMetadataAllocated and GetMetadataDelta RPCs. Signed-off-by: Rakshith R <rar@redhat.com>
✅ Branch has been successfully rebased |
9982594 to
9d66e6c
Compare
|
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
|
/test ci/centos/upgrade-tests-cephfs |
|
/test ci/centos/k8s-e2e-external-storage/1.31 |
|
/test ci/centos/upgrade-tests-rbd |
|
/test ci/centos/mini-e2e-helm/k8s-1.31 |
|
/test ci/centos/mini-e2e/k8s-1.31 |
|
/test ci/centos/k8s-e2e-external-storage/1.32 |
|
/test ci/centos/mini-e2e-helm/k8s-1.32 |
|
/test ci/centos/mini-e2e/k8s-1.32 |
|
/test ci/centos/k8s-e2e-external-storage/1.33 |
|
/test ci/centos/mini-e2e-helm/k8s-1.33 |
|
/test ci/centos/mini-e2e/k8s-1.33 |
|
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You may have to fix your CI before adding the pull request to the queue again. |
|
@Mergifyio requeue |
✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically |
Describe what this PR does
rbd: add support for changed block tracking RPCs
This commit adds support for GetMetadataAllocated
and GetMetadataDelta RPCs.
CSI Snapshot Metadata Service RPCs
Updates: #5346
Checklist:
guidelines in the developer
guide.
Request
notes
updated with breaking and/or notable changes for the next major release.
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!)