Skip to content

Commit

Permalink
librbd: track simple maintenance ops to coordinate replay
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dillaman <[email protected]>
  • Loading branch information
Jason Dillaman committed Jan 15, 2016
1 parent 0fff683 commit 254c8f4
Show file tree
Hide file tree
Showing 3 changed files with 204 additions and 57 deletions.
5 changes: 4 additions & 1 deletion src/librbd/Journal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -579,20 +579,23 @@ template <typename I>
void Journal<I>::handle_replay_complete(int r) {
CephContext *cct = m_image_ctx.cct;

Mutex::Locker locker(m_lock);
m_lock.Lock();
if (m_state != STATE_REPLAYING) {
m_lock.Unlock();
return;
}

ldout(cct, 20) << this << " " << __func__ << ": r=" << r << dendl;
m_journaler->stop_replay();
if (r < 0) {
transition_state(STATE_FLUSHING_RESTART, r);
m_lock.Unlock();

m_journal_replay->flush(create_context_callback<
Journal<I>, &Journal<I>::handle_flushing_restart>(this));
} else {
transition_state(STATE_FLUSHING_REPLAY, 0);
m_lock.Unlock();

m_journal_replay->flush(create_context_callback<
Journal<I>, &Journal<I>::handle_flushing_replay>(this));
Expand Down
Loading

0 comments on commit 254c8f4

Please sign in to comment.