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

jewel: rbd: [rbd-mirror] sporadic image replayer shut down failure #13155

Merged
merged 1 commit into from Jan 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/tools/rbd_mirror/ImageReplayer.cc
Expand Up @@ -607,6 +607,7 @@ void ImageReplayer<I>::on_start_fail(int r, const std::string &desc)
Context *ctx = new FunctionContext([this, r, desc](int _r) {
{
Mutex::Locker locker(m_lock);
assert(m_state == STATE_STARTING);
m_state = STATE_STOPPING;
if (r < 0 && r != -ECANCELED) {
derr << "start failed: " << cpp_strerror(r) << dendl;
Expand Down Expand Up @@ -1061,6 +1062,12 @@ void ImageReplayer<I>::process_entry() {
dout(20) << "processing entry tid=" << m_replay_entry.get_commit_tid()
<< dendl;

// stop replaying events if stop has been requested
if (on_replay_interrupted()) {
m_event_replay_tracker.finish_op();
return;
}

Context *on_ready = create_context_callback<
ImageReplayer, &ImageReplayer<I>::handle_process_entry_ready>(this);
Context *on_commit = new C_ReplayCommitted(this, std::move(m_replay_entry));
Expand Down