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

librbd: blacklist clients before breaking locks #3704

Merged
merged 4 commits into from Feb 12, 2015
Merged

librbd: blacklist clients before breaking locks #3704

merged 4 commits into from Feb 12, 2015

Conversation

dillaman
Copy link

No description provided.

Jason Dillaman added 4 commits February 6, 2015 06:42
Convenience method to invoke the mon "osd blacklist add"
command and validating the result.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Prior to breaking a client's lock, blacklist the clients from the
OSDs to prevent possible race conditions with data updates. Added
a new RBD configuration option to control the behavior.

Fixes: #10761
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The break lock unit test was updated to use a different
librados client to prevent blacklisting itself when breaking
the lock of a "dead" client.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The new librados API method is used by RBD so it needs to be
added to the test stub.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
@loic-bot
Copy link

FAIL: the output of run-make-check.sh on centos-centos7 for 8735057 is http://paste2.org/_6pW3MFGX

:octocat: Sent from GH.

@loic-bot
Copy link

SUCCESS: the output of run-make-check.sh on centos-centos7 for b370584 is http://paste2.org/_7eBNFJEN

:octocat: Sent from GH.

self.require_state("connected")
ret = run_in_thread(self.librados.rados_blacklist_add,
(self.cluster, c_char_p(client_address),
expire_seconds))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c_uint32(expire_seconds)

ldout(m_image_ctx.cct, 1) << "blacklisting client: " << locker << "@"
<< locker_address << dendl;
librados::Rados rados(m_image_ctx.md_ctx);
r = rados.blacklist_add(locker_address, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably make the expiration configurable too, since the default on the monitor isn't, and if it was the global default might not make sense for rbd

@loic-bot
Copy link

FAIL: the output of run-make-check.sh on centos-centos7 for 5cb544f is http://paste2.org/_6hpCA0Ox

:octocat: Sent from GH.

@loic-bot
Copy link

SUCCESS: the output of run-make-check.sh on centos-centos7 for 6e81c51 is http://paste2.org/_YMEMEJmA

:octocat: Sent from GH.

jdurgin added a commit that referenced this pull request Feb 12, 2015
librbd: blacklist clients before breaking locks

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
@jdurgin jdurgin merged commit c5717e2 into hammer Feb 12, 2015
@jdurgin jdurgin deleted the wip-10761 branch February 12, 2015 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants