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

luminous: rbd: librbd: blacklisted client might not notice it lost the lock #24405

Merged
merged 10 commits into from Oct 5, 2018

Conversation

Projects
None yet
5 participants
@dillaman
Contributor

dillaman commented Oct 3, 2018

trociny and others added some commits Feb 13, 2018

librbd: potential race in RewatchRequest when resetting watch_handle
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit f5c02ad)
librbd: fix rbd close race with rewatch
  fix rbd close race with rewatch

Signed-off-by: Song Shun <song.shun3@zte.com.cn>
(cherry picked from commit 8b833a2)

Conflicts:
	src/librbd/Watcher.cc: trivial resolution
librbd: ensure managed lock can shut down if stuck waiting for register
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit cb6712b)
(cherry picked from commit f1c0bda)
rbd-mirror: attempt to re-acquire leader lock if watcher recovered
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 69645f5)
(cherry picked from commit a44e583)
librbd: assume lock is unlocked if blacklisted or object deleted
This will ensure that it's possible to potentially re-acquire the
lock should the blacklist expire before the image is closed.

Fixes: http://tracker.ceph.com/issues/34534
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 60064f6)
librbd: attempt to recover lost image watcher upon all failures
For example, if an image is blacklisted and the blacklist eventually
expires, the image should recover its watch.

Fixes: http://tracker.ceph.com/issues/34534
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 23b7447)

Conflicts:
	src/librbd/watcher/RewatchRequest.cc: trivial resolution
	src/test/librbd/CMakeLists.txt: trivial resolution
	src/test/librbd/test_mock_Watcher.cc: trivial resolution
librbd: watcher should internally track blacklisted state
Since it will periodically attempt to re-acquire the watch,
it will know when the RADOS client has been blacklisted and
when the blacklist has been removed.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 9ea94f2)

Conflicts:
	src/librbd/Watcher.cc: trivial resolution
	src/test/librbd/mock/MockImageWatcher.h: trivial resolution
librbd: reacquire lock should properly handle failed watcher
If the watch has been lost, assume the lock has been lost but attempt
to reacquire it if and when the watch is re-established.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 2057d99)

Conflicts:
	src/librbd/ManagedLock.cc: trivial resolution
librbd: helper to retrieve the correct error code for read-only op
When the exclusive lock is unlocked, the error code should be
-EBLACKLISTED when the client is blacklisted, otherwise -EROFS.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit a84fbb2)
librbd: use the correct error code when the exclusive lock isn't locked
If the client is currently blacklisted, use -EBLACKLISTED, otherwise
use -EROFS.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit e8eee15)

Conflicts:
	src/librbd/ExclusiveLock.cc: trivial resolution
	src/librbd/image/RemoveRequest.cc: trivial resolution
	src/test/rbd_mirror/image_deleter/test_mock_SnapshotPurgeRequest.cc: DNE
	src/tools/rbd_mirror/image_deleter/SnapshotPurgeRequest.cc: DNE
	src/tools/rbd_mirror/image_deleter/SnapshotPurgeRequest.h: DNE
	src/librbd/DeepCopyRequest.cc: (see below)
	src/librbd/deep_copy/ObjectCopyRequest.cc: (see below)
	src/librbd/deep_copy/ObjectCopyRequest.h: (see below)
	src/librbd/deep_copy/SetHeadRequest.cc: (see below)
	src/librbd/deep_copy/SetHeadRequest.h: (see below)
	src/librbd/deep_copy/SnapshotCopyRequest.cc: (see below)
	src/librbd/deep_copy/SnapshotCopyRequest.h: (see below)
	src/librbd/deep_copy/SnapshotCreateRequest.cc: (see below)
	src/librbd/deep_copy/SnapshotCreateRequest.h: (see below)
	src/test/librbd/deep_copy/test_mock_ObjectCopyRequest.cc: (see below)
	src/test/librbd/deep_copy/test_mock_SetHeadRequest.cc: (see below)
	src/test/librbd/deep_copy/test_mock_SnapshotCopyRequest.cc: (see below)
	src/test/librbd/deep_copy/test_mock_SnapshotCreateRequest.cc: (see below)
	src/test/librbd/test_mock_DeepCopyRequest.cc
- deep-copy related files were originally derived from rbd-mirror
  equivalents. Similar modifications where made to the associated
  rbd-mirror files.
@trociny

trociny approved these changes Oct 4, 2018

LGTM

@yuriw

This comment has been minimized.

Contributor

yuriw commented Oct 4, 2018

@yuriw yuriw merged commit 4fd9ff8 into ceph:luminous Oct 5, 2018

4 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details

@dillaman dillaman deleted the dillaman:wip-36143-luminous branch Oct 5, 2018

@smithfarm smithfarm changed the title from luminous: librbd: blacklisted client might not notice it lost the lock to luminous: rbd: librbd: blacklisted client might not notice it lost the lock Oct 26, 2018

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