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

mimic: librbd: blacklisted client might not notice it lost the lock #24401

Merged
merged 6 commits into from Oct 17, 2018

Conversation

Projects
None yet
4 participants
@dillaman
Copy link
Contributor

dillaman commented Oct 3, 2018

@dillaman dillaman added this to the mimic milestone Oct 3, 2018

dillaman added some commits Aug 30, 2018

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/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
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/Operations.cc: trivial resolution
	src/librbd/deep_copy/ObjectCopyRequest.cc: trivial resolution
	src/librbd/deep_copy/SetHeadRequest.cc: trivial resolution
	src/librbd/deep_copy/SnapshotCopyRequest.cc: trivial resolution
	src/librbd/deep_copy/SnapshotCreateRequest.cc: trivial resolution

@dillaman dillaman force-pushed the dillaman:wip-36144-mimic branch from 584e7c3 to e4e7b99 Oct 4, 2018

@trociny

trociny approved these changes Oct 4, 2018

Copy link
Contributor

trociny left a comment

LGTM

@yuriw

This comment has been minimized.

Copy link
Contributor

yuriw commented Oct 15, 2018

@yuriw yuriw merged commit 8fe6428 into ceph:mimic Oct 17, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment