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
librbd: permit removal of image being bootstrapped by rbd-mirror #12549
Conversation
@@ -163,6 +163,46 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force, | |||
return 0; | |||
} | |||
|
|||
void filter_out_mirror_watchers(ImageCtx *ictx, | |||
std::list<obj_watch_t> &watchers) { |
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.
Nit: use a pointer instead of a reference for an in-out parameter.
m_ictx->md_ctx.notify_ack(RBD_MIRRORING, notify_id, cookie, bl); | ||
}); | ||
m_closed = true; | ||
m_ictx->state->close(ctx); |
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.
Probably overkill since rbd-mirror will never be able to close the image before acking the notification.
Fixes: http://tracker.ceph.com/issues/16555 Signed-off-by: Mykola Golub <mgolub@mirantis.com>
@dillaman Updated. |
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
@trociny I see some random error messages popping up in the rbd-mirror daemon logs, which could be awkward if running "systemctl status rbd-mirror@XYZ" and you see lots of false errors listed. I think if this PR is combined w/ my PR for listening to the add/remove mirroring events, it might vastly reduce the chance for such false errors since the bootstrap will be canceled nearly immediately when the "DISABLING" event is received. Perhaps remove should wait for all rbd-mirror watchers to disappear before proceeding (and time-out after X seconds if they don't)? Maybe I am thinking too much into it and we can deal with that later. |
@dillaman So, do you propose before checking for watchers (or if the check returned positive) and the mirroring is enabled to send DISABLING event and (re) check the watchers (expecting that if it was due to bootstrap then it would be cancelled)? I can do this way, rebasing it on your PR #12364 (and adding necessary bootsrap cancel bits if needed). On the other hand, we already send DISABLING event when disabling mirror before actually removing the image. So after the rbd-mirror is updated to cancel the bootstrap when receiving DISABLING event, I suppose the errors should gone with my current version too? I don't have a strong opinion what is better though. |
@trociny I think the chance of the race condition will be reduced (where bootstrap can complain about the image disappearing) ... and that it probably enough for the time being. |
retest this please |
Fixes: http://tracker.ceph.com/issues/16555
Signed-off-by: Mykola Golub mgolub@mirantis.com