Skip to content
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: adds support for librbd rbd_resize2 #934

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

khayyamsaleem
Copy link
Contributor

@khayyamsaleem khayyamsaleem commented Oct 18, 2023

librbd exposes rbd_resize2, which allows clients to pass in a boolean controlling
whether or not the allocation should be allowed to shrink, and a progress-tracking
callback. This contribution extends go-ceph to be able to call rbd_resize2.

Closes #933

Signed-off-by: Khayyam Saleem [email protected]

Checklist

  • Added tests for features and functional changes
  • Public functions and types are documented
  • Standard formatting is applied to Go code
  • Is this a new API? Added a new file that begins with //go:build ceph_preview
  • Ran make api-update to record new APIs

New or infrequent contributors may want to review the go-ceph Developer's Guide including the section on how we track API Status and the API Stability Plan.

The go-ceph project uses mergify. View the mergify command guide for information on how to interact with mergify. Add a comment with @Mergifyio rebase to rebase your PR when github indicates that the PR is out of date with the base branch.

@khayyamsaleem khayyamsaleem force-pushed the rbd/rbd-resize-2 branch 2 times, most recently from 9fe8c70 to 4e6b796 Compare October 18, 2023 02:24
@khayyamsaleem khayyamsaleem changed the title [rbd]: adds support for librbd rbd_resize2 rbd: adds support for librbd rbd_resize2 Oct 18, 2023
@phlogistonjohn phlogistonjohn added the API This PR includes a change to the public API of a go-ceph package label Oct 18, 2023
@phlogistonjohn
Copy link
Collaborator

I won't insist on it, but I'd like to suggest having the new function and test in new files. rbd.go is already fairly long. Having a dedicated file (and test!) focused on one or a few related things aids readability IMO.

@khayyamsaleem
Copy link
Contributor Author

Thanks for the recommendation @phlogistonjohn ! Implemented.

Copy link
Collaborator

@ansiwen ansiwen left a comment

Choose a reason for hiding this comment

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

@khayyamsaleem Thanks for the contribution. Please only add the new functions to a separate file. This is necessary, because the new API will be in preview mode first, which requires the build constraint //go:build ceph_preview at the top of the file (and also the according test file). Please see here for more information: https://github.com/ceph/go-ceph/blob/master/docs/development.md#documentation-conventions

docs/api-status.json Outdated Show resolved Hide resolved
@khayyamsaleem khayyamsaleem force-pushed the rbd/rbd-resize-2 branch 3 times, most recently from 5373d70 to 15357e3 Compare October 23, 2023 17:56
@khayyamsaleem
Copy link
Contributor Author

@phlogistonjohn @ansiwen should be ready for another round of review; thanks so much for your attention on this PR!

@khayyamsaleem khayyamsaleem requested a review from ansiwen October 23, 2023 17:57
@phlogistonjohn
Copy link
Collaborator

@phlogistonjohn @ansiwen should be ready for another round of review; thanks so much for your attention on this PR!

Looking better, I've restarted the CI. There are two lingering issues that I think we should deal with: first, there are still changes to rbd.go, related to the changing of the comment block, that are now unnecessary. This may have been done by an IDE or the like but I'd prefer they remain unchanged by your PR. It's just "noise" when looking through the history of the project.

Second, and hopefully less work, is that it would be nice to squash your two commits together. We try to keep a long term history free of intermediate changes.

Let us (me) know if there are any questions on how to go about doing either one, and I'll try to help.

… controlling

whether or not the allocation should be allowed to shrink, and a progress-tracking
callback. This contribution extends go-ceph to be able to call rbd_resize2.

Closes ceph#933

Signed-off-by: Khayyam Saleem <[email protected]>
@khayyamsaleem
Copy link
Contributor Author

Apologies for the slow turnaround here; this had fallen off my radar. Have rebased and squashed the commits and dropped the rbd.go changes. Thanks for your attention!

Copy link
Collaborator

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

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

LGTM now, thanks so much.

@khayyamsaleem
Copy link
Contributor Author

@ansiwen looks like we'll need your additional review to push this through. Thanks again for helping get this PR in order.

Copy link
Collaborator

@ansiwen ansiwen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mergify mergify bot merged commit 51b8287 into ceph:master Nov 8, 2023
15 checks passed
@khayyamsaleem khayyamsaleem deleted the rbd/rbd-resize-2 branch November 25, 2023 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API This PR includes a change to the public API of a go-ceph package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for rbd_resize2
3 participants