]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agoReview:
Dan Mick [Fri, 17 Aug 2012 17:40:05 +0000 (10:40 -0700)]
Review:

standardize on "*_id" form of variable names
log errors in parameter decode in rbd_children methods
whitespace, assert -> comment

12 years agolibrbd: snap_protect: verify layering is supported
Dan Mick [Fri, 17 Aug 2012 23:01:15 +0000 (16:01 -0700)]
librbd: snap_protect: verify layering is supported

12 years agolibrbd: review: don't call to the OSD to get current protection status
Dan Mick [Fri, 17 Aug 2012 22:55:00 +0000 (15:55 -0700)]
librbd: review: don't call to the OSD to get current protection status

12 years agotest_rbd.py: actually make unprotect_with_children work, and clean up
Dan Mick [Fri, 17 Aug 2012 22:44:37 +0000 (15:44 -0700)]
test_rbd.py: actually make unprotect_with_children work, and clean up

12 years agolibrbd: change EINVAL to EBUSY on "can't unprotect because children exist"
Dan Mick [Fri, 17 Aug 2012 20:03:21 +0000 (13:03 -0700)]
librbd: change EINVAL to EBUSY on "can't unprotect because children exist"
Add pool, number of children in this pool that caused failure to log

12 years agoreview: librbd, test_librbd: make "protect protected snap" fail
Dan Mick [Fri, 17 Aug 2012 20:00:48 +0000 (13:00 -0700)]
review: librbd, test_librbd: make "protect protected snap" fail

12 years agoUpdate protection methods to use parent_spec, parent_types.h, etc.
Dan Mick [Sat, 18 Aug 2012 00:58:31 +0000 (17:58 -0700)]
Update protection methods to use parent_spec, parent_types.h, etc.

12 years agotest_rbd: add test for denying removal of protected parent
Dan Mick [Tue, 14 Aug 2012 22:32:30 +0000 (15:32 -0700)]
test_rbd: add test for denying removal of protected parent

12 years agoget_features requires md_lock and snap_lock to be held
Dan Mick [Tue, 14 Aug 2012 22:30:48 +0000 (15:30 -0700)]
get_features requires md_lock and snap_lock to be held

12 years agolibrbd: clone return codes: ENOSYS for no layering, EINVAL for no prot
Dan Mick [Tue, 14 Aug 2012 18:42:54 +0000 (11:42 -0700)]
librbd: clone return codes: ENOSYS for no layering, EINVAL for no prot

12 years agolibrbd, test_librbd: snap_unprotect: refuse if children still exist
Dan Mick [Tue, 14 Aug 2012 18:51:55 +0000 (11:51 -0700)]
librbd, test_librbd: snap_unprotect: refuse if children still exist

12 years agoMerge branch 'wip-rbd-protect' into more-rebasing
Dan Mick [Sat, 18 Aug 2012 01:42:04 +0000 (18:42 -0700)]
Merge branch 'wip-rbd-protect' into more-rebasing

Conflicts:
src/librbd/ImageCtx.cc
src/librbd/SnapInfo.h
src/librbd/internal.cc
src/test/rbd/test_cls_rbd.cc

12 years agotest_cls_rbd: get_parent with no parent: should fail and return null-pspec
Dan Mick [Fri, 17 Aug 2012 20:07:04 +0000 (13:07 -0700)]
test_cls_rbd: get_parent with no parent: should fail and return null-pspec

12 years agolibrbd: cause add_child/remove_child to treat duplicate ops as errors
Dan Mick [Fri, 17 Aug 2012 19:50:00 +0000 (12:50 -0700)]
librbd: cause add_child/remove_child to treat duplicate ops as errors

12 years agolibrbd: review: add helper for 'scanning snapshots for this parent'
Dan Mick [Fri, 17 Aug 2012 22:44:10 +0000 (15:44 -0700)]
librbd: review: add helper for 'scanning snapshots for this parent'

12 years agolibrbd: review: change get_snapinfo to get_parent_spec
Dan Mick [Fri, 17 Aug 2012 19:59:26 +0000 (12:59 -0700)]
librbd: review: change get_snapinfo to get_parent_spec

12 years agolibrbd, cls_rbd: move parent_info and parent_spec to parent_types.h
Dan Mick [Sat, 18 Aug 2012 00:54:27 +0000 (17:54 -0700)]
librbd, cls_rbd: move parent_info and parent_spec to parent_types.h

parent_type.h is a new librbd-scope header containing info
related to parents and children (clones)

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agolibrbd: memcpy object_prefix must copy terminating NUL
Dan Mick [Wed, 15 Aug 2012 18:10:16 +0000 (11:10 -0700)]
librbd: memcpy object_prefix must copy terminating NUL

12 years agolibrbd: remove: keep ictx open until snapshots are scanned
Dan Mick [Tue, 14 Aug 2012 18:44:03 +0000 (11:44 -0700)]
librbd: remove: keep ictx open until snapshots are scanned

12 years agoReview: change to look for parent across base and all snapshots,
Dan Mick [Sat, 11 Aug 2012 04:46:45 +0000 (21:46 -0700)]
Review: change to look for parent across base and all snapshots,
and remove only if not present in any of them.

12 years agoEnhance add/remove child tests
Dan Mick [Sat, 11 Aug 2012 03:15:19 +0000 (20:15 -0700)]
Enhance add/remove child tests

12 years agoget_parent on non-layered image no longer fails; remove test case
Dan Mick [Sat, 11 Aug 2012 02:32:11 +0000 (19:32 -0700)]
get_parent on non-layered image no longer fails; remove test case

12 years agoAdd struct parent_spec
Dan Mick [Sat, 11 Aug 2012 02:31:38 +0000 (19:31 -0700)]
Add struct parent_spec
Holds poolid,imageid,snapid triple identifying parent
Allows for equality comparison of parents

12 years agopoolid should be signed
Dan Mick [Thu, 9 Aug 2012 22:43:33 +0000 (15:43 -0700)]
poolid should be signed

12 years agorun-rbd-tests: prefer local binaries over $PATH
Dan Mick [Thu, 9 Aug 2012 04:55:36 +0000 (21:55 -0700)]
run-rbd-tests: prefer local binaries over $PATH

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agolibrbd: snap_set and open_image need to refresh parent info
Dan Mick [Thu, 9 Aug 2012 02:31:37 +0000 (19:31 -0700)]
librbd: snap_set and open_image need to refresh parent info

12 years agolibrbd: Manipulate rbd_children in flatten, clone, remove, snap remove
Dan Mick [Tue, 7 Aug 2012 03:32:13 +0000 (20:32 -0700)]
librbd: Manipulate rbd_children in flatten, clone, remove, snap remove

12 years agolibrbd: make get_parent_info look at snapshot-specific info when needed
Dan Mick [Mon, 13 Aug 2012 22:03:07 +0000 (15:03 -0700)]
librbd: make get_parent_info look at snapshot-specific info when needed

12 years agoFix some trailing spaces on lines
Dan Mick [Tue, 7 Aug 2012 00:56:24 +0000 (17:56 -0700)]
Fix some trailing spaces on lines

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agorados: allow listomapvals to dump keys with nonprintable characters
Dan Mick [Mon, 6 Aug 2012 17:50:40 +0000 (10:50 -0700)]
rados: allow listomapvals to dump keys with nonprintable characters

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agocls_rbd, cls_rbd_client: add/remove/get children
Dan Mick [Fri, 3 Aug 2012 00:50:06 +0000 (17:50 -0700)]
cls_rbd, cls_rbd_client: add/remove/get children

Manipulate the new rbd_children object, which holds mappings between
parent snapshots and their children clone images

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agorbd: show snap protection status
Josh Durgin [Sun, 12 Aug 2012 23:42:42 +0000 (16:42 -0700)]
rbd: show snap protection status

If you do rbd info image@snap, include whether that snapshot is protected.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: fix test compilation on 32-bit
Josh Durgin [Thu, 9 Aug 2012 22:13:46 +0000 (15:13 -0700)]
rbd: fix test compilation on 32-bit

32-bit can't implicitly convert size_t or unsigned to uint64_t

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agotest_librbd_fsx: fix warning
Josh Durgin [Thu, 9 Aug 2012 22:12:55 +0000 (15:12 -0700)]
test_librbd_fsx: fix warning

fstat was included implicitly before.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: fix cli tests
Josh Durgin [Thu, 9 Aug 2012 21:53:24 +0000 (14:53 -0700)]
rbd: fix cli tests

add flatten, snap protect, and snap unprotect

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrados: add method to get the fsid of a cluster
Josh Durgin [Thu, 9 Aug 2012 02:13:45 +0000 (19:13 -0700)]
librados: add method to get the fsid of a cluster

This will be used by OpenStack to check whether two components
have access to the same backend cluster.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: fix memory leak on error in clone
Josh Durgin [Sat, 4 Aug 2012 00:30:04 +0000 (17:30 -0700)]
librbd: fix memory leak on error in clone

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: add snap [un]protect commands
Josh Durgin [Fri, 3 Aug 2012 23:31:12 +0000 (16:31 -0700)]
rbd: add snap [un]protect commands

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: add methods for protecting/unprotecting snapshots
Josh Durgin [Fri, 3 Aug 2012 23:30:42 +0000 (16:30 -0700)]
librbd: add methods for protecting/unprotecting snapshots

Unprotect will be more useful once integrated with the rbd_children object.
Right now we just check that a snapshot is protected before cloning it,
and that it's unprotected before removing it.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agocls_rbd: add methods for getting/setting protection status
Josh Durgin [Fri, 3 Aug 2012 00:22:34 +0000 (17:22 -0700)]
cls_rbd: add methods for getting/setting protection status

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: fix bounds of memcpy in info()
Josh Durgin [Wed, 1 Aug 2012 22:42:15 +0000 (15:42 -0700)]
librbd: fix bounds of memcpy in info()

Caught by valgrind.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agotest_librbd_fsx: add cloning
Josh Durgin [Sat, 4 Aug 2012 01:49:44 +0000 (18:49 -0700)]
test_librbd_fsx: add cloning

5% of the time a clone op is chosen, create a snapshot, save the
current contents to a file, and continue operating on a clone.

At the end of the test, verify that all parents match their saved
data.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: expose feature bits through librbd.h
Josh Durgin [Mon, 30 Jul 2012 17:18:19 +0000 (10:18 -0700)]
librbd: expose feature bits through librbd.h

Move them to a separate header so we don't expose
rbd_types.h to the librbd user.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: close parent after shutting down cache
Josh Durgin [Mon, 30 Jul 2012 18:00:43 +0000 (11:00 -0700)]
librbd: close parent after shutting down cache

Requests that haven't been flushed yet might need the parent still.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: move flush on new snap outside of snap_lock
Josh Durgin [Mon, 30 Jul 2012 17:59:29 +0000 (10:59 -0700)]
librbd: move flush on new snap outside of snap_lock

snap_lock needs to be taken during writeback.
This is still protected by md_lock. The altered snapc doesn't
affect in-flight ops, so it's safe to update it before flushing.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: check new snapc for validity, not the old one
Josh Durgin [Mon, 30 Jul 2012 17:52:39 +0000 (10:52 -0700)]
librbd: check new snapc for validity, not the old one

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agotest_librbd: add a simple io to clone test
Josh Durgin [Mon, 30 Jul 2012 17:41:41 +0000 (10:41 -0700)]
test_librbd: add a simple io to clone test

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agotest_rbd.py: refactor cloning tests
Josh Durgin [Wed, 25 Jul 2012 21:32:56 +0000 (14:32 -0700)]
test_rbd.py: refactor cloning tests

Move into a separate class that requires layering to be enabled,
so the common step of creating and deleting a clone doesn't
need to be repeated in each test.

Move flatten tests into a subclass so they can be run separately
more easily.

Move the checks for the layering feature into a generic decorator
that skips tests if the specified feature is not being used.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: don't open parent again during get_parent_info
Josh Durgin [Fri, 20 Jul 2012 17:31:56 +0000 (10:31 -0700)]
librbd: don't open parent again during get_parent_info

The parent was already opened when the original ImageCtx
was initialized. We just need to lookup the pool and image
name for it.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: implement read/write from parent images
Josh Durgin [Tue, 24 Jul 2012 17:13:39 +0000 (10:13 -0700)]
librbd: implement read/write from parent images

Put the completion handling logic into new subclases of
librbd::AioRequest, so the caching/non-caching paths can share
logic. These AioRequests replace AioBlockCompletion as representing
the I/O to a single object in an RBD image.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: refactor synchronous I/O
Josh Durgin [Tue, 24 Jul 2012 00:28:49 +0000 (17:28 -0700)]
librbd: refactor synchronous I/O

Write in terms of the asynchronous functions, so all the logic
is not duplicated. Now there's only a single point where each
operation needs to change for layering.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agorbd: fix copy-pasted snap remove error message
Josh Durgin [Tue, 17 Jul 2012 23:19:17 +0000 (16:19 -0700)]
rbd: fix copy-pasted snap remove error message

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: check for new snapshots in snap_set
Josh Durgin [Fri, 20 Jul 2012 23:55:01 +0000 (16:55 -0700)]
librbd: check for new snapshots in snap_set

This allows callers to create a snapshot and then read from
it immediately. No one uses this other than the tests,
fortunately.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: add method to get the size of an image
Josh Durgin [Fri, 20 Jul 2012 23:42:41 +0000 (16:42 -0700)]
librbd: add method to get the size of an image

To go with the other individual properties instead of stat,
add a method that only gets the size.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: make ImageCtx methods take snap_id parameters
Josh Durgin [Fri, 20 Jul 2012 20:55:07 +0000 (13:55 -0700)]
librbd: make ImageCtx methods take snap_id parameters

This makes it easier to use without racing with snap_set.
Requests in the cache, for example, store their snap_id
and may not be sent for a long time after being created.

Also rename the parameters for these methods so they
don't alias member variables.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agocls_rbd: don't duplicate encoding
Josh Durgin [Sun, 15 Jul 2012 00:39:39 +0000 (17:39 -0700)]
cls_rbd: don't duplicate encoding

Just skip the parts before encoding instead of returning early.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agoqa: add script to run rbd/librbd tests
Josh Durgin [Sat, 14 Jul 2012 19:38:51 +0000 (12:38 -0700)]
qa: add script to run rbd/librbd tests

Run on old and new style images, with different features. This is
intended to ease development, as opposed to being part of the qa
suite. It should be run from the src directory.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agoqa: remove rbd image when done
Josh Durgin [Sat, 14 Jul 2012 19:37:38 +0000 (12:37 -0700)]
qa: remove rbd image when done

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: split into multiple files
Josh Durgin [Fri, 13 Jul 2012 01:15:40 +0000 (18:15 -0700)]
librbd: split into multiple files

This was long overdue. There's still a bunch of stuff in internal.cc
that should be moved elsewhere, but this is a good start.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agorbd: flatten command (copyup an entire image)
Dan Mick [Fri, 20 Jul 2012 03:24:07 +0000 (20:24 -0700)]
rbd: flatten command (copyup an entire image)

Fixes: #2561
Signed-off-by: Dan Mick <dan.mick@inktank.com>
13 years agolibrbd: round #blocks in image_info() for edge cases
Dan Mick [Fri, 20 Jul 2012 03:18:18 +0000 (20:18 -0700)]
librbd: round #blocks in image_info() for edge cases

Signed-off-by: Dan Mick <dan.mick@inktank.com>
13 years agolibrbd, rbd.py, test_rbd.py: flatten methods
Dan Mick [Fri, 20 Jul 2012 03:23:06 +0000 (20:23 -0700)]
librbd, rbd.py, test_rbd.py: flatten methods

librbd:
- copyup_block for individual blocks (for read/write path)
- flatten for iterating across whole image (for rbd cli)

rbd.py:
Image.flatten (whole image)

Fixes: #2606
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agocls_rbd, cls_rbd_client, test_cls_rbd: copyup method
Dan Mick [Fri, 20 Jul 2012 03:14:29 +0000 (20:14 -0700)]
cls_rbd, cls_rbd_client, test_cls_rbd: copyup method

Fixes: #2559
Signed-off-by: Dan Mick <dan.mick@inktank.com>
13 years agolibrbd: drop unnecessary std:: and struct prefixes
Josh Durgin [Wed, 11 Jul 2012 00:12:22 +0000 (17:12 -0700)]
librbd: drop unnecessary std:: and struct prefixes

Most of this file do not use them.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: open parent image when opening a child
Josh Durgin [Wed, 11 Jul 2012 00:11:56 +0000 (17:11 -0700)]
librbd: open parent image when opening a child

Extract a helper out of get_parent_info. The parent may become unset
while the child is open, so detect changes in it during ictx_refresh().
Don't watch the parent image, since we only care about the read-only
snapshot the child references, which cannot change.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: move all side-effects to snap_{un}set()
Josh Durgin [Wed, 11 Jul 2012 00:06:05 +0000 (17:06 -0700)]
librbd: move all side-effects to snap_{un}set()

All callers need to do this anyway.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: allow opening an image by id
Josh Durgin [Tue, 10 Jul 2012 23:55:47 +0000 (16:55 -0700)]
librbd: allow opening an image by id

If we have an ImageCtx with an id set, don't bother setting the name.
Just go directly to the header object in ImageCtx::init().

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: store parent info in snapshot metadata
Josh Durgin [Tue, 10 Jul 2012 22:16:33 +0000 (15:16 -0700)]
librbd: store parent info in snapshot metadata

If an image is open to a snapshot, return the features or overlap from
that snapshot.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: allow an image to be opened without watching
Josh Durgin [Tue, 10 Jul 2012 21:20:55 +0000 (14:20 -0700)]
librbd: allow an image to be opened without watching

Watching the header of a parent image could produce unreasonable
delays. If hundreds of child images watch the same parent, taking a
snapshot or resizing the parent would wait until all the children are
notified. Since the children are based on snapshots, they don't care
about any changes to the current version of the parent image, and
don't need to re-read the header on each change. Nothing children need
to access their parent snapshot will change.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: move watch/unwatch to ImageCtx methods
Josh Durgin [Tue, 10 Jul 2012 21:08:06 +0000 (14:08 -0700)]
librbd: move watch/unwatch to ImageCtx methods

This fixes close_image() on a partially initialized ImageCtx, and
paves the way for opening parent images without watching their
headers.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: rename variables for more consistency
Josh Durgin [Tue, 10 Jul 2012 20:47:07 +0000 (13:47 -0700)]
librbd: rename variables for more consistency

Rename: poolname -> pool_name
        snapname -> snap_name
        snapid   -> snap_id

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agocls_rbd: make get_parent return valid data when layering is disabled
Josh Durgin [Mon, 9 Jul 2012 20:59:52 +0000 (13:59 -0700)]
cls_rbd: make get_parent return valid data when layering is disabled

This means clients can treat an error in their multi-object
transaction as a failure for all of them. This makes the client side
much simpler since it can call get_parent on images that don't support
layering, or do support it but don't have parents, and not need to
check the return value of every operation in the transaction.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agocls_rbd: return negative pool id if parent does not exist
Josh Durgin [Mon, 9 Jul 2012 09:15:28 +0000 (02:15 -0700)]
cls_rbd: return negative pool id if parent does not exist

This lets us use get_parent in a multi-op transaction without getting
-ENOENT for the entire transaction.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agocls_rbd_client: fix locking function indentation
Josh Durgin [Mon, 9 Jul 2012 21:22:36 +0000 (14:22 -0700)]
cls_rbd_client: fix locking function indentation

Greg's editor was set to spaces only.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agoosd: add osd_debug_drop_pg_create_{probability,duration} options
Sage Weil [Wed, 18 Jul 2012 19:20:24 +0000 (12:20 -0700)]
osd: add osd_debug_drop_pg_create_{probability,duration} options

This will let us exercise more of the pg creation code.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoOSD: write_if_dirty during get_or_create_pg after handle_create
Samuel Just [Wed, 18 Jul 2012 19:48:09 +0000 (12:48 -0700)]
OSD: write_if_dirty during get_or_create_pg after handle_create

In the case that the pg is newly created, we will activate during
that call, so the info and log will be dirty.

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agoOSD: actually send queries during handle_pg_create
Samuel Just [Wed, 18 Jul 2012 18:31:09 +0000 (11:31 -0700)]
OSD: actually send queries during handle_pg_create

During the osd threading refactor, we lost the do_queries
call in favor of dispatch_context.  However, this did not
include the queries triggered prior to pg instantiation.
Instead, use the rctx to send the queries.

Part of #2771.  Without the queries being sent,
can_create_pg will never become true.

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agoMerge branch 'next'
Josh Durgin [Wed, 18 Jul 2012 19:58:47 +0000 (12:58 -0700)]
Merge branch 'next'

13 years agoobjecter: always resend linger registrations
Sage Weil [Wed, 18 Jul 2012 19:55:35 +0000 (12:55 -0700)]
objecter: always resend linger registrations

If a linger op (watch) is sent to the OSD and updates the object, and then
the client loses the reply, it will resend the request.  The OSD will see
that it is a dup, however, and not set up the in-memory session state for
the watch.  This in turn will break the watch (i.e., notifies won't
get delivered).

Instead, always resend linger registration ops, so that we always have a
unique reqid and do the correct session registeration for each session.

 * track the tid of the registation op for each LingerOp
 * mark registrations ops as should_resend=false; cancel as needed
 * when we send a new registration op, cancel the old one to ensure we
   ignore the reply.  This is needed becuase we resend linger ops on any
   pg change, not just a primary change.
 * drop the first_send arg to send_linger(), as we can now infer that
   from register_tid == 0.

The bug was easily reproduced with ms inject socket failures = 500 and the
test_stress_watch utility.

Fixes: #2796
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
13 years agoOSD: publish_map in init to initialize OSDService map
Samuel Just [Wed, 18 Jul 2012 16:26:11 +0000 (09:26 -0700)]
OSD: publish_map in init to initialize OSDService map

Other areas rely on OSDService::get_map() to function, possibly before
activate_map is first called.  In particular, with handle_osd_ping,
not initializing the map member results in:

ceph version 0.48argonaut-413-g90ddc5a (commit:90ddc5ae51627e7656459085d7e15105c8b8316d)
 1: /tmp/cephtest/binary/usr/local/bin/ceph-osd() [0x71ba9a]
 2: (()+0xfcb0) [0x7fcd8243dcb0]
 3: (OSD::handle_osd_ping(MOSDPing*)+0x74d) [0x5dbdfd]
 4: (OSD::heartbeat_dispatch(Message*)+0x22b) [0x5dc70b]
 5: (SimpleMessenger::DispatchQueue::entry()+0x92b) [0x7b5b3b]
 6: (SimpleMessenger::dispatch_entry()+0x24) [0x7b6914]
 7: (SimpleMessenger::DispatchThread::entry()+0xd) [0x7762fd]
 8: (()+0x7e9a) [0x7fcd82435e9a]
 9: (clone()+0x6d) [0x7fcd809ea4bd]
 NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agoqa/workunits/suites/pjd.sh: bash -x
Sage Weil [Wed, 18 Jul 2012 17:52:33 +0000 (10:52 -0700)]
qa/workunits/suites/pjd.sh: bash -x

This will let us see what test is failing, exactly, and what its inputs
were.  Hoping to help find #2187.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoObjectCacher: fix cache_bytes_hit accounting
Josh Durgin [Wed, 18 Jul 2012 17:24:58 +0000 (10:24 -0700)]
ObjectCacher: fix cache_bytes_hit accounting

Misses are not hits!

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agodoc: Fixed heading text.
John Wilkins [Wed, 18 Jul 2012 14:35:35 +0000 (07:35 -0700)]
doc: Fixed heading text.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
13 years agodoc: favicon.ico should be new Ceph icon.
John Wilkins [Wed, 18 Jul 2012 14:35:00 +0000 (07:35 -0700)]
doc: favicon.ico should be new Ceph icon.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
13 years agodoc: Overhauled Swift API documentation.
John Wilkins [Wed, 18 Jul 2012 04:28:59 +0000 (21:28 -0700)]
doc: Overhauled Swift API documentation.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
13 years agoMerge branch 'next'
Sage Weil [Wed, 18 Jul 2012 02:20:06 +0000 (19:20 -0700)]
Merge branch 'next'

13 years agoclient: fix readdir locking
Sage Weil [Wed, 18 Jul 2012 02:19:39 +0000 (19:19 -0700)]
client: fix readdir locking

Several of the readdir-related methods were not taking client_lock.

Fixes: #1737
Backport: argonaut
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoclient: fix leak of client_lock when not initialized
Sage Weil [Tue, 17 Jul 2012 19:38:50 +0000 (12:38 -0700)]
client: fix leak of client_lock when not initialized

Backport: argonaut
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoOSD: use service.get_osdmap() in heartbeat(), don't grab map_lock
Samuel Just [Tue, 17 Jul 2012 23:35:43 +0000 (16:35 -0700)]
OSD: use service.get_osdmap() in heartbeat(), don't grab map_lock

service.get_osdmap() gives us sufficiently consist
access to the map state.

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agoOSD: handle_osd_ping: use service->get_osdmap()
Samuel Just [Tue, 17 Jul 2012 23:20:38 +0000 (16:20 -0700)]
OSD: handle_osd_ping: use service->get_osdmap()

This way, we avoid grabbing the map_lock.  Furthermore,
get curmap at the beginning of the method to ensure that
we send the message using the same map used to check
is_up.

This should also fix #2798, which was caused by
an osd being marked up between service.get_osdmap()
and OSD::osdmap.

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agodoc/dev/osd_internals: add newlines before numbered lists
Samuel Just [Tue, 17 Jul 2012 23:09:10 +0000 (16:09 -0700)]
doc/dev/osd_internals: add newlines before numbered lists

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agolibrados: simplify locking slightly
Sage Weil [Tue, 17 Jul 2012 23:01:11 +0000 (16:01 -0700)]
librados: simplify locking slightly

No reason to hold mylock_all here.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoosd: default 'osd_preserve_trimmed_log = false'
Sage Weil [Tue, 17 Jul 2012 19:38:40 +0000 (12:38 -0700)]
osd: default 'osd_preserve_trimmed_log = false'

This option makes the osd skip zeroing old trimmed regions of the log.  The
data is never read, since the xattrs indicate which part of the log is
valid.  We've never actually used this to debug a problem, and it consumes
space, so let's disable it.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agodoc/dev: add osd_internals to toc
Samuel Just [Tue, 17 Jul 2012 16:42:43 +0000 (09:42 -0700)]
doc/dev: add osd_internals to toc

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agodoc/internals/osd_internals: fix indentation errors
Samuel Just [Tue, 17 Jul 2012 16:31:22 +0000 (09:31 -0700)]
doc/internals/osd_internals: fix indentation errors

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agodoc: discuss choice of pg_num
Sage Weil [Mon, 16 Jul 2012 23:44:05 +0000 (16:44 -0700)]
doc: discuss choice of pg_num

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agolog: simplify log logic a bit
Sage Weil [Mon, 16 Jul 2012 23:18:51 +0000 (16:18 -0700)]
log: simplify log logic a bit

Whether an entry is eligible to log/dump is independent of the channel it
is sent to.  Some channels impose additional restrictions.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoMerge branch 'next'
Josh Durgin [Tue, 17 Jul 2012 00:36:06 +0000 (17:36 -0700)]
Merge branch 'next'

13 years agoRobustify ceph-rbdnamer and adapt udev rules
Pascal de Bruijn | Unilogic Networks B.V [Wed, 11 Jul 2012 13:23:16 +0000 (15:23 +0200)]
Robustify ceph-rbdnamer and adapt udev rules

Below is a patch which makes the ceph-rbdnamer script more robust and
fixes a problem with the rbd udev rules.

On our setup we encountered a symlink which was linked to the wrong rbd:

  /dev/rbd/mypool/myrbd -> /dev/rbd1

While that link should have gone to /dev/rbd3 (on which a
partition /dev/rbd3p1 was present).

Now the old udev rule passes %n to the ceph-rbdnamer script, the problem
with %n is that %n results in a value of 3 (for rbd3), but in a value of
1 (for rbd3p1), so it seems it can't be depended upon for rbdnaming.

In the patch below the ceph-rbdnamer script is made more robust and it
now it can be called in various ways:

  /usr/bin/ceph-rbdnamer /dev/rbd3
  /usr/bin/ceph-rbdnamer /dev/rbd3p1
  /usr/bin/ceph-rbdnamer rbd3
  /usr/bin/ceph-rbdnamer rbd3p1
  /usr/bin/ceph-rbdnamer 3

Even with all these different styles of calling the modified script, it
should now return the same rbdname. This change "has" to be combined
with calling it from udev with %k though.

With that fixed, we hit the second problem. We ended up with:

  /dev/rbd/mypool/myrbd -> /dev/rbd3p1

So the rbdname was symlinked to the partition on the rbd instead of the
rbd itself. So what probably went wrong is udev discovering the disk and
running ceph-rbdnamer which resolved it to myrbd so the following
symlink was created:

  /dev/rbd/mypool/myrbd -> /dev/rbd3

However partitions would be discovered next and ceph-rbdnamer would be
run with rbd3p1 (%k) as parameter, resulting in the name myrbd too, with
the previous correct symlink being overwritten with a faulty one:

  /dev/rbd/mypool/myrbd -> /dev/rbd3p1

The solution to the problem is in differentiating between disks and
partitions in udev and handling them slightly differently. So with the
patch below partitions now get their own symlinks in the following style
(which is fairly consistent with other udev rules):

  /dev/rbd/mypool/myrbd-part1 -> /dev/rbd3p1

Please let me know any feedback you have on this patch or the approach
used.

Regards,
Pascal de Bruijn
Unilogic B.V.

Signed-off-by: Pascal de Bruijn <pascal@unilogicnetworks.net>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agodoc/radosgw/config.rst: mended small typo
caleb miles [Mon, 16 Jul 2012 23:30:36 +0000 (16:30 -0700)]
doc/radosgw/config.rst: mended small typo

Signed-off-by: caleb miles <caleb.miles@inktank.com>