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-mirror: permit release of local image exclusive lock after force promotion #15140

Merged
merged 8 commits into from Jun 6, 2017

Conversation

Projects
None yet
2 participants
@dillaman
Contributor

dillaman commented May 17, 2017

Fixes: http://tracker.ceph.com/issues/18963
Signed-off-by: Jason Dillaman dillaman@redhat.com

@dillaman

This comment has been minimized.

Contributor

dillaman commented May 17, 2017

The current code should address the common case when an image is being replayed and then it's force-promoted. I still need to handle the case where the image is bootstrapping up the replayer.

@dillaman dillaman changed the title from [DNM] rbd-mirror: close local image before stopping remote journaler to rbd-mirror: permit release of local image exclusive lock after force promotion May 31, 2017

@trociny trociny self-assigned this May 31, 2017

@@ -40,9 +40,12 @@ bool ExclusiveLock<I>::accept_requests(int *ret_val) const {
Mutex::Locker locker(ML<I>::m_lock);
bool accept_requests = (!ML<I>::is_state_shutdown() &&
!ML<I>::is_state_pre_releasing() &&
ML<I>::is_state_locked() &&

This comment has been minimized.

@trociny

trociny May 31, 2017

Contributor

@dillaman I can't understand this. is_state_locked() ensures the only allowed state is SATE_LOCKED, so additionally testing that it is not STATE_PRE_RELEASING does not make any difference?

This comment has been minimized.

@dillaman

dillaman May 31, 2017

Contributor

is_state_locked covers several states where the actual lock is held on the object -- the STATE_PRE_RELEASING being one of those states. However, if we are in the process of releasing the lock, we shouldn't be accepting new requests nor accepting new IO.

This comment has been minimized.

@dillaman

dillaman May 31, 2017

Contributor

Wait -- you are correct. I was confusing that w/ is_lock_owner which covers several states.

bool ExclusiveLock<I>::accept_ops() const {
Mutex::Locker locker(ML<I>::m_lock);
bool accept_ops = (!ML<I>::is_state_shutdown() &&
!ML<I>::is_state_pre_releasing() &&

This comment has been minimized.

@trociny

trociny May 31, 2017

Contributor

Then this also look unnecessary.

@@ -4,7 +4,7 @@
#ifndef CEPH_LIBRBD_IO_COPYUP_REQUEST_H
#define CEPH_LIBRBD_IO_COPYUP_REQUEST_H
#include "librbd/AsyncOperation.h"
#include "librbd/io/AsyncOperation.h"

This comment has been minimized.

@trociny

trociny Jun 1, 2017

Contributor

maybe move below?

dillaman added some commits May 15, 2017

rbd-mirror: permit release of exclusive lock if promoted
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librbd: accept_requests helper should accept optional return code
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librbd: new exclusive lock accept_replay helper method
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librbd: guard journal replay from losing exclusive lock
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librbd: moved IO operation tracker to io namespace
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librbd: track async exclusive-lock dependent operations
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
rbd-mirror: ensure exclusive lock cannot be released with in-flight IO
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
@dillaman

This comment has been minimized.

Contributor

dillaman commented Jun 1, 2017

@trociny update pushed

@trociny

trociny approved these changes Jun 2, 2017

LGTM

trociny pushed a commit to trociny/ceph that referenced this pull request Jun 3, 2017

Mykola Golub
rbd-mirror: permit release of local image exclusive lock after force …
…promotion by dillaman · Pull Request ceph#15140 · ceph/ceph · GitHub

* wip-18963:
  rbd-mirror: ensure exclusive lock cannot be released with in-flight IO
  librbd: track async exclusive-lock dependent operations
  librbd: moved IO operation tracker to io namespace
  librbd: guard journal replay from losing exclusive lock
  librbd: new exclusive lock accept_replay helper method
  librbd: accept_requests helper should accept optional return code
  rbd-mirror: permit release of exclusive lock if promoted
  rbd-mirror: close local image before stopping remote journaler

@trociny trociny merged commit 9c0dbfa into ceph:master Jun 6, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@dillaman dillaman deleted the dillaman:wip-18963 branch Jun 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment