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
Conversation
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>
FAIL: the output of run-make-check.sh on centos-centos7 for 8735057 is http://paste2.org/_6pW3MFGX |
SUCCESS: the output of run-make-check.sh on centos-centos7 for b370584 is http://paste2.org/_7eBNFJEN |
self.require_state("connected") | ||
ret = run_in_thread(self.librados.rados_blacklist_add, | ||
(self.cluster, c_char_p(client_address), | ||
expire_seconds)) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
FAIL: the output of run-make-check.sh on centos-centos7 for 5cb544f is http://paste2.org/_6hpCA0Ox |
SUCCESS: the output of run-make-check.sh on centos-centos7 for 6e81c51 is http://paste2.org/_YMEMEJmA |
librbd: blacklist clients before breaking locks Reviewed-by: Josh Durgin <jdurgin@redhat.com>
No description provided.