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: add mirroring support for nautilus #714

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

Sanford137
Copy link
Contributor

@Sanford137 Sanford137 commented Jun 24, 2022

I've implemented mirroring support that is compatible with Nautilus clusters. It's a fairly different API from the one exposed for Octopus, since the underlying librbd interface changed so much between them.

It needs to be clear in the documentation that these methods are only available when using the nautilus build tag. One way to do that is just mention it in the documentation comments for all of them (not very DRY, but simple), another is to add a new section to the API docs, similar to the existing "preview" section, which would box off those methods into their own category. What approach would you like to take?

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

@phlogistonjohn
Copy link
Collaborator

I've implemented mirroring support that is compatible with Nautilus clusters. It's a fairly different API from the one exposed for Octopus, since the underlying librbd interface changed so much between them.

It needs to be clear in the documentation that these methods are only available when using the nautilus build tag. One way to do that is just mention it in the documentation comments for all of them (not very DRY, but simple), another is to add a new section to the API docs, similar to the existing "preview" section, which would box off those methods into their own category. What approach would you like to take?

Because this is a "backwards" looking feature I think the doc comment approach is best. I'd rather not make changes to the tooling to support a ceph release that's already deprecated.

I appreciate that you use nautilus and want to use go-ceph, and that makes me quite pleased, but looking at the changes... Gee that's a lot of net new stuff for a release I had planned on dropping support for.
Looking at https://docs.ceph.com/en/latest/releases/#ceph-releases-index I see that Nautilus has been EOL at ceph for nearly a year already and that octopus is near or at EOL too. Now, that this isn't an outright rejection of your patches, I just want to communicate some of my concerns about taking large additions that only work for nautilus. I'm going to certainly think about it and discuss it with others on the maintenance team - I hope you understand.

In the meantime there's some CI errors related to your patches that need looking into (make check).

@Sanford137 Sanford137 force-pushed the rbd-mirror-nautilus-support branch from 4760455 to 5f6a6ea Compare June 24, 2022 14:45
@Sanford137
Copy link
Contributor Author

CI should be fixed now - the one remaining failing test is a flaky test in cephfs/admin, I think.

I get your concerns about adding a big chunk of Nautilus-specific code, and that you want to discuss it with the other maintainers. If you need some time to decide, no rush!

I will say that although Nautilus is EOL, it is only 3 years old, and it remains in decently widespread use - and some organizations are still on even earlier versions! As an example, just a few days ago someone submitted a large patch to to the Mimic branch of the ceph_exporter tool.

My company (DigitalOcean) is moving towards Octopus and eventually Pacific, but it will be at least a year before all of our clusters are fully switched over; upgrading is slow when you are running many clusters, and large ones, as we are (a problem that I suspect other organizations that are heavy users of Ceph are also running into).

In the meantime, me and my team are happy to be responsible for maintaining any Nautilus-specific code (and happy to work out any logistics with you on how best to get Nautilus-related bugs and requests routed to us).

@ansiwen
Copy link
Collaborator

ansiwen commented Jun 29, 2022

The documentation would not show up anyway AFAIK, because the doc generator doesn't set any tags. So I would also prefer that this doesn't go in the preview section but is completely "hidden" and disappears automatically whenever we have to delete the nautilus files, because something breaks. I don't mind adding "hidden" support for features of old versions, but I think it should not show up in docs or the api status. It must be "zero-cost" for the management of the current, supported versions. So as long as all the code stays in "nautilus-guarded" files, I'm ok. And of cause, no guarantees, it comes "as-is".

rbd/mirror_nautilus_test.go Outdated Show resolved Hide resolved
entrypoint.sh Outdated Show resolved Hide resolved
@ansiwen ansiwen mentioned this pull request Jun 29, 2022
@phlogistonjohn
Copy link
Collaborator

Great, so it sounds like we'll take this (modulo review feedback, updates, etc) given that the majority of the maintenance costs will fall on @Sanford137 et al. At some point in the future we'll remove nautilus support but not until after the digital ocean team confirms it's no longer a must have. It would be nice to have an approximate date, emphasis on approximate, so that we can update issue #648
Anything else on the "management" front for this or is the rest just working thru the details of this PR?

@mergify
Copy link

mergify bot commented Jun 30, 2022

This pull request now has conflicts with the target branch. Could you please resolve conflicts and force push the corrected changes? 🙏

@Sanford137 Sanford137 force-pushed the rbd-mirror-nautilus-support branch 2 times, most recently from 6cf32e3 to 6dc159b Compare July 1, 2022 01:13
@Sanford137
Copy link
Contributor Author

I'm happy to hear you've decided to go ahead with the patch! I think I've addressed all of your feedback, let me know if there is anything else that needs fixing up.

@Sanford137 Sanford137 force-pushed the rbd-mirror-nautilus-support branch from 6dc159b to a0311d1 Compare July 5, 2022 13:40
entrypoint.sh Outdated Show resolved Hide resolved
@phlogistonjohn phlogistonjohn added the API This PR includes a change to the public API of a go-ceph package label Jul 5, 2022
@Sanford137 Sanford137 force-pushed the rbd-mirror-nautilus-support branch 2 times, most recently from cd18fb5 to c515cf3 Compare July 5, 2022 18:07
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.

partial review

rbd/mirror_nautilus.go Outdated Show resolved Hide resolved
rbd/mirror_nautilus.go Outdated Show resolved Hide resolved
@Sanford137 Sanford137 force-pushed the rbd-mirror-nautilus-support branch from c515cf3 to e54102f Compare July 7, 2022 13:48
@Sanford137
Copy link
Contributor Author

Is there a way for me to re-run a test failure that I think is a flake?

Also, would you like me to close conversations once I've addressed the comment? This page is getting a bit unwieldy, but I don't want to accidentally close anything that you still want to talk about.

@phlogistonjohn
Copy link
Collaborator

phlogistonjohn commented Jul 7, 2022

Is there a way for me to re-run a test failure that I think is a flake?

I don't know if you can see the re-run jobs button on the page https://github.com/ceph/go-ceph/actions/runs/2629992092 (and the like). As an admin I'm not sure what standard contributors see.
Either way, just asking will (eventually) usually get the job done. :-D

Also, would you like me to close conversations once I've addressed the comment? This page is getting a bit unwieldy, but I don't want to accidentally close anything that you still want to talk about.

I've done it now. Usually I was something like 1 day for the original author of the sub-thread to close it and if it goes past that time I usually feel free to close them. It's not hard to reopen ("unresolve") one so I personally don't think its much of an issue.

@Sanford137
Copy link
Contributor Author

I cannot see the re-run button - will just ask for now!

@Sanford137 Sanford137 force-pushed the rbd-mirror-nautilus-support branch 5 times, most recently from 7913da9 to 4e3ff39 Compare July 11, 2022 13:32
@Sanford137
Copy link
Contributor Author

Does this need any other changes before it's ready to merge?

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.

I have one small but necessary change to make. The Go code looks good to me at this point.

Makefile Outdated Show resolved Hide resolved
@Sanford137 Sanford137 force-pushed the rbd-mirror-nautilus-support branch from 4e3ff39 to f528855 Compare July 11, 2022 14:32
phlogistonjohn
phlogistonjohn previously approved these changes Jul 11, 2022
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, thanks!

@phlogistonjohn
Copy link
Collaborator

@ansiwen PTAL when you have a moment. Thanks!

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.

Finished review. Just some small things, then it's good to go!

rbd/mirror_nautilus.go Show resolved Hide resolved
rbd/mirror_nautilus.go Show resolved Hide resolved
rbd/mirror_nautilus.go Outdated Show resolved Hide resolved
// Implements:
// int rbd_mirror_image_disable(rbd_image_t image, bool force)
func (image *Image) MirrorDisable(force bool) error {
ret := C.rbd_mirror_image_disable(C.rbd_image_t(image.image), C.bool(force))
Copy link
Collaborator

Choose a reason for hiding this comment

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

dito

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

// Implements:
// int rbd_mirror_image_promote(rbd_image_t image, bool force)
func (image *Image) MirrorPromote(force bool) error {
ret := C.rbd_mirror_image_promote(C.rbd_image_t(image.image), C.bool(force))
Copy link
Collaborator

Choose a reason for hiding this comment

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

dito

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

// Implements:
// int rbd_mirror_image_demote(rbd_image_t image)
func (image *Image) MirrorDemote() error {
ret := C.rbd_mirror_image_demote(C.rbd_image_t(image.image))
Copy link
Collaborator

Choose a reason for hiding this comment

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

dito

Copy link
Contributor Author

@Sanford137 Sanford137 Jul 12, 2022

Choose a reason for hiding this comment

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

Done!

// Implements:
// int rbd_mirror_image_resync(rbd_image_t image)
func (image *Image) MirrorResync() error {
ret := C.rbd_mirror_image_resync(C.rbd_image_t(image.image))
Copy link
Collaborator

Choose a reason for hiding this comment

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

dito

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@Sanford137 Sanford137 force-pushed the rbd-mirror-nautilus-support branch from f528855 to ded821f Compare July 12, 2022 14:45
@mergify mergify bot dismissed phlogistonjohn’s stale review July 12, 2022 14:46

Pull request has been modified.

The librbd API for mirroring-related operations changed substantially between
Nautilus and Octopus. Due to this, go-ceph had previously only implemented
mirroring functionality if built against Octopus client libraries. This patch
implements equivalent functionality for use with Nautilus clients.

Signed-off-by: Sanford Miller <[email protected]>
@Sanford137 Sanford137 force-pushed the rbd-mirror-nautilus-support branch from ded821f to 416b46d Compare July 12, 2022 14:48
@Sanford137
Copy link
Contributor Author

Ready for another look!

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!

@ansiwen ansiwen requested a review from phlogistonjohn July 13, 2022 05:03
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, thanks!

@mergify mergify bot merged commit 15d71fe into ceph:master Jul 13, 2022
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.

3 participants