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

wip-rbd-rm-watchers #1159

Merged
merged 4 commits into from Jan 30, 2014
Merged

wip-rbd-rm-watchers #1159

merged 4 commits into from Jan 30, 2014

Conversation

idryomov
Copy link
Contributor

A fix for ticket 7076 + a related error path fix.

@jdurgin
Copy link
Member

jdurgin commented Jan 29, 2014

This looks good! Could you also make https://github.com/ceph/ceph/blob/master/src/test/pybind/test_rbd.py#L365 test that the image still has data?

Commit b28b64a ("pybind: use find_library for libcephfs and
librbd") switched us to find_library(), but this function doesn't seem
to respect LD_LIBRARY_PATH.  There are numerous python tickets, dating
back several years, but alas.  Work around it by using the soname as
a fallback.  (rados.py has been fixed by commit e46d2ca ("fix the
bug  ctypes.util.find_library to search for librados failed on
Centos6.4.")

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Check for watchers before trimming image data to try to avoid getting
into the following situation:

  - user does 'rbd rm' on a mapped image with an fs mounted from it
  - 'rbd rm' trims (removes) all image data, only header is left
  - 'rbd rm' tries to remove a header and fails because krbd has a
    watcher registered on the header
  - at this point image cannot be unmapped because of the mounted fs
  - fs cannot be unmounted because all its data and metadata is gone

Unfortunately, this fix doesn't make it impossible to happen (the
required atomicity isn't there), but it's a big improvement over the
status quo.

Fixes: http://tracker.ceph.com/issues/7076

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
close_image() among other things unregisters a watcher that's been
registered by open_image().  Even though it'll timeout in 30 or so
seconds, it's not nice now that we check for watchers before starting
the removal process.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Bug #2533 has been fixed for a while now, start running
remove_with_watcher test.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
jdurgin added a commit that referenced this pull request Jan 30, 2014
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
@jdurgin jdurgin merged commit 7b17911 into master Jan 30, 2014
@jdurgin jdurgin deleted the wip-rbd-rm-watchers branch January 30, 2014 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants