]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agoclient: Fix coverity 716909 [FORWARD_NULL]
Sam Lang [Wed, 26 Sep 2012 02:11:45 +0000 (19:11 -0700)]
client: Fix coverity 716909 [FORWARD_NULL]

If we fill the request path from the dentry instead of the inode, we
need to use the dentry inode.  This fixes a segfault that would occur
in the case where request->inode is in fact null.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Add asserts for coverity bugs
Sam Lang [Wed, 26 Sep 2012 02:03:49 +0000 (19:03 -0700)]
client: Add asserts for coverity bugs

Coverity 716907-716909 [FORWARD_NULL} doesn't like using a pointer
that might be null.  Assertions check that pointers are valid
before dereferencing.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Fixes coverity defect 716891
Sam Lang [Tue, 25 Sep 2012 16:13:26 +0000 (09:13 -0700)]
client:  Fixes coverity defect 716891

Fix for coverity defect 716891 [DEADCODE] in
Client::encode_dentry_release where the released var is initialized
to 0, but never set, so the pre-emptive release of the dentry
capability (if requested by the drop flag) never happens.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Fixes coverity defect 716890 [DEADCODE]
Sam Lang [Tue, 25 Sep 2012 16:07:00 +0000 (09:07 -0700)]
client:  Fixes coverity defect 716890 [DEADCODE]

In choose_target_mds, the mds number is initialized to 0 and
then a separate target mds number is chosen based on the inode
set in the request.  If the inode isn't set, we drop to choosing
a random mds, but only if the mds number is < 0, which doesn't
happen with the initialize to 0.  This fix initializes the mds
number to -1, ensuring a random mds is chosen.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Coverity fixes for 716841-716844
Sam Lang [Tue, 25 Sep 2012 16:04:02 +0000 (09:04 -0700)]
client: Coverity fixes for 716841-716844

Fixes coverity errors (CHECKED_RETURN) for all calls to
Client::path_walk() where return value wasn't getting checked
in case of error.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agocephfs: Fixes for coverity bugs 716840 and 716970
Sam Lang [Tue, 25 Sep 2012 14:03:57 +0000 (07:03 -0700)]
cephfs:  Fixes for coverity bugs 716840 and 716970

Fixes for two coverity bugs in cephfs.cc.

716840 (CHECKED_RETURN) reported that the return value from
fstat wasn't getting checked.  It now is checked, reports an
error and returns to the caller.

716970 (NEGATIVE_RETURNS) reported that the file descriptor passed
to fstat (*fd) might be negative, which isn't allowed.  The check at
the top that open failed wasn't aborting the function (when *fd < 0),
now it does.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoMerge branch 'next'
Sage Weil [Mon, 24 Sep 2012 20:16:23 +0000 (13:16 -0700)]
Merge branch 'next'

12 years agodoc: Added messaging section to ref. Placeholders. Definitions needed.
John Wilkins [Mon, 24 Sep 2012 04:55:53 +0000 (21:55 -0700)]
doc: Added messaging section to ref. Placeholders. Definitions needed.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Added space for Emacs users.
John Wilkins [Mon, 24 Sep 2012 04:54:44 +0000 (21:54 -0700)]
doc: Added space for Emacs users.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Added journal section placeholders. Definitions needed.
John Wilkins [Mon, 24 Sep 2012 04:54:20 +0000 (21:54 -0700)]
doc: Added journal section placeholders. Definitions needed.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Fixed hyperlink.
John Wilkins [Mon, 24 Sep 2012 04:53:36 +0000 (21:53 -0700)]
doc: Fixed hyperlink.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Clean up and added placeholders for new definitions.
John Wilkins [Mon, 24 Sep 2012 04:52:43 +0000 (21:52 -0700)]
doc: Clean up and added placeholders for new definitions.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Fixed hyperlink.
John Wilkins [Mon, 24 Sep 2012 04:51:43 +0000 (21:51 -0700)]
doc: Fixed hyperlink.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Fixed hyperlink.
John Wilkins [Mon, 24 Sep 2012 04:51:26 +0000 (21:51 -0700)]
doc: Fixed hyperlink.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Restored "Differences from Posix" to /doc/dev
John Wilkins [Mon, 24 Sep 2012 04:50:53 +0000 (21:50 -0700)]
doc: Restored "Differences from Posix" to /doc/dev

Fixes: #3185
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Adds package deps to list in README
Sam Lang [Sun, 23 Sep 2012 23:58:46 +0000 (16:58 -0700)]
doc: Adds package deps to list in README

The README provides a list of packages needed to successfully
configure ceph.  uuid-dev and libatomic-ops-dev are missing from
the list.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agomon: tolerate no session on no_reply()
Sage Weil [Sat, 22 Sep 2012 04:05:27 +0000 (21:05 -0700)]
mon: tolerate no session on no_reply()

We remove the Session* in ms_handle_reset().

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomsg/Accepter: assert that listen_sd always >= 0
Sage Weil [Thu, 20 Sep 2012 17:15:23 +0000 (10:15 -0700)]
msg/Accepter: assert that listen_sd always >= 0

The listen_sd is set by bind(); we should never call stop() when it is
is still negative.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomsg/Accepter: fix race in accepter shutdown
Sage Weil [Thu, 20 Sep 2012 17:14:24 +0000 (10:14 -0700)]
msg/Accepter: fix race in accepter shutdown

We want to avoid a race like:

- entry() starts, populates pfd with listen_sd, gets past !done check
- stop() does shutdown + close on listen_sd
- someone else opens a new fd
- entry() thread calls poll(2) on wrong sd
- stop() calls join, waits forever for entry thread

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorgw: prepare_update_index should not error on system bucket
Yehuda Sadeh [Fri, 21 Sep 2012 16:53:49 +0000 (09:53 -0700)]
rgw: prepare_update_index should not error on system bucket

Should just return true. This way we don't need higher level
functions to be aware of system buckets. Also, don't use
marker.empty() to test for system bucket, use bucket_is_system().

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoceph-object-corpus: update with v0.52 objects
Sage Weil [Thu, 20 Sep 2012 23:49:32 +0000 (16:49 -0700)]
ceph-object-corpus: update with v0.52 objects

These were generated a few days prior to v0.52 release, but well after
freeze.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'upstream/wip-osd-qlock'
Samuel Just [Thu, 20 Sep 2012 23:11:05 +0000 (16:11 -0700)]
Merge remote-tracking branch 'upstream/wip-osd-qlock'

12 years agouuid: include unistd to make encode testing work
Sage Weil [Thu, 20 Sep 2012 22:40:13 +0000 (15:40 -0700)]
uuid: include unistd to make encode testing work

The expanded encode/decode macros need getpid(2) and close(2).

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoqa: move all rados class unit tests into qa/workunits/cls
Sage Weil [Thu, 20 Sep 2012 22:12:39 +0000 (15:12 -0700)]
qa: move all rados class unit tests into qa/workunits/cls

This includes the existing rbd one; teh suite is getting fixed to match.

See #3097.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMakefile: rename test_rados_api_cls_lock -> test_cls_lock
Sage Weil [Thu, 20 Sep 2012 21:43:26 +0000 (14:43 -0700)]
Makefile: rename test_rados_api_cls_lock -> test_cls_lock

Keep this consistent with the other rados classes

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'wip-vstartfixes'
Sam Lang [Thu, 20 Sep 2012 21:24:26 +0000 (14:24 -0700)]
Merge branch 'wip-vstartfixes'

Reviewed-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage.weil@inktank.com>
12 years agovstart.sh: Alternative fix for vstart.sh -n
Sam Lang [Thu, 20 Sep 2012 15:54:45 +0000 (08:54 -0700)]
vstart.sh: Alternative fix for vstart.sh -n

The previous fix (0f7c516f3e) breaks osd startup with -k.  This one
from dmick just tells the ceph-mon which keyring to use through the
command line rather than moving the keyring path to the [global]
section of the config file.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoMakefile.am: librdb_fsx test needs math library on some platforms
Gary Lowell [Thu, 20 Sep 2012 20:47:09 +0000 (13:47 -0700)]
Makefile.am: librdb_fsx test needs math library on some platforms

12 years agoMerge remote-tracking branch 'gh/wip-1957'
Sage Weil [Thu, 20 Sep 2012 18:54:17 +0000 (11:54 -0700)]
Merge remote-tracking branch 'gh/wip-1957'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agodoc: link to full 0.48.2 changelog
Sage Weil [Thu, 20 Sep 2012 18:51:49 +0000 (11:51 -0700)]
doc: link to full 0.48.2 changelog

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: Clean up finished two phase commits
Yan, Zheng [Wed, 19 Sep 2012 07:52:36 +0000 (15:52 +0800)]
mds: Clean up finished two phase commits

When handling master request with slaves, the mds could crash
after receiving all slaves' commit acknowledgement, but before
journalling the ECommitted. Current MDS recovery code does not
handle this case correctly, the request will be left in
LogSegment's uncommitted_masters after recovery is finished.
It prevents LogSegment from being trimmed. The fix is find and
clean up request of this kind when recovery enters rejoin stage.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocfuse: Define CEPH_INO_DOTDOT (3) for top-level parentdir
Sam Lang [Thu, 20 Sep 2012 17:24:35 +0000 (10:24 -0700)]
cfuse: Define CEPH_INO_DOTDOT (3) for top-level parentdir

Defines the macro CEPH_INO_DOTDOT (to 3) and uses it as the top-level
parent directory (..) inode number.  The value of 2 is already taken
by the .ceph hidden directory.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoceph_common.sh: 'hostname -s' (instead of cut ...)
Sage Weil [Tue, 18 Sep 2012 20:31:06 +0000 (13:31 -0700)]
ceph_common.sh: 'hostname -s' (instead of cut ...)

This will also match up with the instructions in the docs.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: v0.48.2argonaut release notes
Sage Weil [Thu, 20 Sep 2012 16:42:58 +0000 (09:42 -0700)]
doc: v0.48.2argonaut release notes

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocfuse: Add the parent entry (..) for a top-level readdir
Sam Lang [Thu, 20 Sep 2012 00:47:21 +0000 (17:47 -0700)]
cfuse: Add the parent entry (..) for a top-level readdir

In the lowlevel fuse api, the current (.) and parent (..) entries
must be added manually in a readdir call.  For the root directory
the parent is not a ceph inode, so we give it a fake inode value
(2) and intercept that inode on a getattr.

Fixes: #1957
Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoMerge branch 'wip-mon'
Sage Weil [Thu, 20 Sep 2012 00:05:45 +0000 (17:05 -0700)]
Merge branch 'wip-mon'

Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agodoc: Removed legacy doc. Not needed.
John Wilkins [Wed, 19 Sep 2012 23:28:40 +0000 (16:28 -0700)]
doc: Removed legacy doc. Not needed.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Removed legacy doc. Not needed.
John Wilkins [Wed, 19 Sep 2012 23:28:01 +0000 (16:28 -0700)]
doc: Removed legacy doc. Not needed.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Removed legacy doc. Not needed.
John Wilkins [Wed, 19 Sep 2012 23:27:16 +0000 (16:27 -0700)]
doc: Removed legacy doc. Not needed.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Added enabling Swift access to rgw config.
John Wilkins [Wed, 19 Sep 2012 23:26:40 +0000 (16:26 -0700)]
doc: Added enabling Swift access to rgw config.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc; Added troubleshooting to index.
John Wilkins [Wed, 19 Sep 2012 23:25:49 +0000 (16:25 -0700)]
doc; Added troubleshooting to index.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Copied contents of rgw troubleshooting over to the new ops section.
John Wilkins [Wed, 19 Sep 2012 23:25:11 +0000 (16:25 -0700)]
doc: Copied contents of rgw troubleshooting over to the new ops section.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Reverted so that we don't force yes or non-interactive.
John Wilkins [Wed, 19 Sep 2012 23:24:12 +0000 (16:24 -0700)]
doc: Reverted so that we don't force yes or non-interactive.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Removed legacy usage.
John Wilkins [Wed, 19 Sep 2012 23:23:26 +0000 (16:23 -0700)]
doc: Removed legacy usage.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Cleanup, spell check, grammar check mostly.
John Wilkins [Wed, 19 Sep 2012 23:22:38 +0000 (16:22 -0700)]
doc: Cleanup, spell check, grammar check mostly.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Updating the index to remove legacy and uneeded entries.
John Wilkins [Wed, 19 Sep 2012 23:21:08 +0000 (16:21 -0700)]
doc: Updating the index to remove legacy and uneeded entries.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoFix description for --nodaemon
Sam Lang [Wed, 19 Sep 2012 22:34:24 +0000 (15:34 -0700)]
Fix description for --nodaemon

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoAbort on failure
Sam Lang [Wed, 19 Sep 2012 21:34:04 +0000 (14:34 -0700)]
Abort on failure

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoFixup usage to reflect options available
Sam Lang [Wed, 19 Sep 2012 21:33:16 +0000 (14:33 -0700)]
Fixup usage to reflect options available

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoSwap current dir (.) with CEPH_BIN for OOT builds
Sam Lang [Wed, 19 Sep 2012 20:57:53 +0000 (13:57 -0700)]
Swap current dir (.) with CEPH_BIN for OOT builds

With out-of-tree builds, vstart.sh needs CEPH_BIN to be set, and
needs to look for init-ceph in CEPH_BIN rather than just ./init-ceph.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoMove keyring option to global section
Sam Lang [Wed, 19 Sep 2012 20:22:59 +0000 (13:22 -0700)]
Move keyring option to global section

Using vstart.sh -n uses ceph-authtool to generate the keyring file
in ./keyring.  The vstart.sh script then writes out the ceph.conf
with a keyring option in the [client] section, so when the monitors
start, they can't find a keyring file.  This commit puts the keyring in
the [global] section.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agomon: make MRoute encoding backwards-compatible
Sage Weil [Tue, 18 Sep 2012 21:48:14 +0000 (14:48 -0700)]
mon: make MRoute encoding backwards-compatible

If the target as the NULLROUTE feature, use a new encoding that explicitly
indicates whether a message follows.  If the feature is absent, use the
old encoding.  The mon is responsible for not trying to send a null reply
if the target does not have the feature.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd/copy.sh: fix typo
Alex Elder [Wed, 19 Sep 2012 03:51:10 +0000 (22:51 -0500)]
rbd/copy.sh: fix typo

Or maybe it was a spello, or a thinko, or something.  In any case
I'm pretty sure Josh intended to call the function he added in
commit 78d6a60ca, and not the non-existent "test_import_args".

Signed-off-by: Alex Elder <elder@inktank.com>
(cherry picked from commit ed43d4de12a7aaa2fd46c1a80d9f338c4524fe47)

12 years agorbd/copy.sh: fix typo
Alex Elder [Wed, 19 Sep 2012 03:51:10 +0000 (22:51 -0500)]
rbd/copy.sh: fix typo

Or maybe it was a spello, or a thinko, or something.  In any case
I'm pretty sure Josh intended to call the function he added in
commit 78d6a60ca, and not the non-existent "test_import_args".

Signed-off-by: Alex Elder <elder@inktank.com>
12 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Tue, 18 Sep 2012 23:49:58 +0000 (16:49 -0700)]
Merge remote-tracking branch 'gh/next'

12 years agoMerge remote branch 'origin/wip-librbd-locking'
Josh Durgin [Tue, 18 Sep 2012 23:06:25 +0000 (16:06 -0700)]
Merge remote branch 'origin/wip-librbd-locking'

Conflicts:
qa/workunits/rbd/copy.sh

Reviewed-by: Sage Weil <sage.weil@inktank.com>
12 years agolibrbd: bump version
Josh Durgin [Mon, 10 Sep 2012 17:50:44 +0000 (10:50 -0700)]
librbd: bump version

This marks the availability of the cloning and locking functions.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agocls_rbd: remove locking methods
Josh Durgin [Sat, 8 Sep 2012 01:45:22 +0000 (18:45 -0700)]
cls_rbd: remove locking methods

These are unnecessary now that librbd is using the generic cls_lock.

Fixes: #2951
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: add locking commands
Josh Durgin [Sat, 8 Sep 2012 01:16:25 +0000 (17:16 -0800)]
rbd: add locking commands

The locker (entity_name_t) will be different each time the rbd
command line tool is run, so 'lock remove' is always breaking a lock.

Fixes: #2556
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoqa: update rbd tests and runner
Josh Durgin [Sat, 8 Sep 2012 01:14:39 +0000 (18:14 -0700)]
qa: update rbd tests and runner

* no longer need to wait for watch timeout since #2948 was fixed
* use --format 2 instead of --new-format
* add test_cls_rbd to run-rbd-tests script

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: use generic cls_lock instead of cls_rbd's locking
Josh Durgin [Sat, 1 Sep 2012 00:02:01 +0000 (17:02 -0700)]
librbd: use generic cls_lock instead of cls_rbd's locking

Update the librbd locking api to make more sense:
 * Add an optional tag to shared locking
 * only make shared vs exclusive different functions in the user-visible api
 * return a list of structs instead of a set of pairs
 * fix incorrect range checking in the C api
 * rename locks to lockers to be consistent with the generic locking class
 * rename other_locker parameter to client, to match the list_lockers usage

Fixes: #2952
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agocls_lock_client: add ObjectOperation-based get_lock_info
Josh Durgin [Fri, 31 Aug 2012 23:51:43 +0000 (16:51 -0700)]
cls_lock_client: add ObjectOperation-based get_lock_info

This will be used by librbd to grab lock info along with
the rest of its header information in a single request.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agocls_lock_types: add missing include
Josh Durgin [Fri, 31 Aug 2012 23:50:06 +0000 (16:50 -0700)]
cls_lock_types: add missing include

msg_types defines entity-related types used here.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agocls_lock_client: return error when decoding fails
Josh Durgin [Fri, 31 Aug 2012 20:06:12 +0000 (13:06 -0700)]
cls_lock_client: return error when decoding fails

Library code shouldn't be using cerr either.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agocls_lock_client: fix indentation
Josh Durgin [Fri, 31 Aug 2012 18:17:17 +0000 (11:17 -0700)]
cls_lock_client: fix indentation

Add indentation settings to header, and reindent.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agocls_lock_client: change modified reference parameters to pointers
Josh Durgin [Fri, 31 Aug 2012 18:14:22 +0000 (10:14 -0800)]
cls_lock_client: change modified reference parameters to pointers

This makes it clear which parameters are modified,
as our style guide states.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agocls_lock_client: clean up reference parameters
Josh Durgin [Fri, 31 Aug 2012 15:18:07 +0000 (08:18 -0700)]
cls_lock_client: clean up reference parameters

These should all be const. The remaining reference parameters
will be converted to pointers in another commit.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agocls_lock: fix some spacing
Josh Durgin [Thu, 30 Aug 2012 23:39:23 +0000 (16:39 -0700)]
cls_lock: fix some spacing

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agocls_lock: specify librados namespace explicitly
Yehuda Sadeh [Tue, 21 Aug 2012 21:56:43 +0000 (14:56 -0700)]
cls_lock: specify librados namespace explicitly

librados namespace was not specified, hence required including
source files to add using namespace. This fixes it.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoradosgw-admin: fix cli test
Sage Weil [Tue, 18 Sep 2012 22:28:32 +0000 (15:28 -0700)]
radosgw-admin: fix cli test

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: only open the destination pool for import
Josh Durgin [Tue, 18 Sep 2012 16:37:44 +0000 (09:37 -0700)]
rbd: only open the destination pool for import

Otherwise importing into another pool when the default pool, rbd,
doesn't exist results in an error trying to open the rbd pool.

Reported-by: Sébastien Han <han.sebastien@gmail.com>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoqa: test args for rbd import
Josh Durgin [Sat, 15 Sep 2012 00:14:47 +0000 (17:14 -0700)]
qa: test args for rbd import

Make sure that --pool/--dest-pool and --image/--dest all work
interchangeably.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: make --pool/--image args easier to understand for import
Josh Durgin [Sat, 15 Sep 2012 00:13:57 +0000 (17:13 -0700)]
rbd: make --pool/--image args easier to understand for import

There's no need to set the default pool in set_pool_image_name - this
is done later, in a way that doesn't ignore --pool if --dest-pool
is not specified.

This means --pool and --image can be used with import, just like
the rest of the commands. Without this change, --dest and --dest-pool
had to be used, and --pool would be silently ignored for rbd import.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd, cls_rbd: close snapshot creation race with old format
Josh Durgin [Mon, 30 Jul 2012 22:19:29 +0000 (15:19 -0700)]
librbd, cls_rbd: close snapshot creation race with old format

If two clients created a snapshot at the same time, the one with the
higher snapshot id might be created first, so the lower snapshot id
would be added to the snapshot context and the snaphot seq would be
set to the lower one.

Instead of allowing this to happen, return -ESTALE if the snapshot id
is lower than the currently stored snapshot sequence number. On the
client side, get a new id and retry if this error is encountered.

Backport: argonaut
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: fix delete[]
Sage Weil [Sat, 25 Aug 2012 02:36:44 +0000 (19:36 -0700)]
librbd: fix delete[]

CID 716902: Non-array delete for scalars (DELETE_ARRAY)
At (15): Deleting array variable "buf" with non-array delete in "delete buf".

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: clarify rbd man page (esp. layering)
Josh Durgin [Thu, 30 Aug 2012 00:30:17 +0000 (17:30 -0700)]
doc: clarify rbd man page (esp. layering)

* a clone's size can't be overridden
* note which commands require format 2
* clarify details of copy
* add examples for cloning
* add pool to map example for consistency
* fix a couple warnings and re-sync man page with rst

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: add --format option
Josh Durgin [Wed, 29 Aug 2012 17:58:30 +0000 (10:58 -0700)]
rbd: add --format option

This chooses whether to use the original (supported by krbd)
or the new (supports layering) format.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: prevent racing clone and snap unprotect
Josh Durgin [Wed, 29 Aug 2012 00:24:47 +0000 (17:24 -0700)]
librbd: prevent racing clone and snap unprotect

If the following sequence of events occured,
a clone could be created of an unprotected snapshot:

1. A: begin clone - check that snap foo is protected
2. B: rbd unprotect snap foo
3. B: check that all pools have no clones of foo
4. B: unprotect snap foo
5. A: finish creating clone of foo, add it as a child

To stop this from happening, check at the beginning and end of
cloning that the parent snapshot is protected. If it is not,
or checking protection status fails (possibly because the parent
snapshot was removed), remove the clone and return an error.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: add "children" command, update cli test files
Dan Mick [Tue, 21 Aug 2012 23:07:25 +0000 (16:07 -0700)]
rbd: add "children" command, update cli test files

Fixes: #2720
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: add {rbd_}list_children() methods
Dan Mick [Tue, 21 Aug 2012 22:58:21 +0000 (15:58 -0700)]
librbd: add {rbd_}list_children() methods

These iterate over all pools and check for children of a
particular snapshot.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agomon: make heartbeat grace and down out interval scaling optional
Sage Weil [Wed, 5 Sep 2012 20:16:21 +0000 (13:16 -0700)]
mon: make heartbeat grace and down out interval scaling optional

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: add tunable to control laggy probability weighting. simplify decoding.
Sage Weil [Wed, 5 Sep 2012 20:15:42 +0000 (13:15 -0700)]
mon: add tunable to control laggy probability weighting.  simplify decoding.

Default to .3. Setting to 0 effectively turns this off.

Also make OSDMap::osd_xinfo_t decode into a float to simplify the
arithmetic conversions.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: apply grace period scaling to mon_osd_down_out_interval
Sage Weil [Wed, 5 Sep 2012 00:17:40 +0000 (17:17 -0700)]
mon: apply grace period scaling to mon_osd_down_out_interval

Scale the down/out interval the same way we do the heartbeat grace, so that
we give laggy osds a bit longer to recovery.

See #3047.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: decay laggy calculations over time
Sage Weil [Tue, 4 Sep 2012 23:55:08 +0000 (16:55 -0700)]
mon: decay laggy calculations over time

Add a configurable halflife for the laggy probability and duration and
apply it at the time those values are used to adjust the heartbeat grace
period.  Both are multiplied together, so it doesn't matter which you
think is being decayed (the probability or the interval).

Default to an hour.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: factor reporter lagginess into grace adjustment
Sage Weil [Tue, 4 Sep 2012 20:52:18 +0000 (13:52 -0700)]
mon: factor reporter lagginess into grace adjustment

Use reporters as a proxy for laggy subclusters within the overall cluster.
See #3046.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: scale heartbeat grace based on laggy probability, interval
Sage Weil [Tue, 4 Sep 2012 20:39:23 +0000 (13:39 -0700)]
mon: scale heartbeat grace based on laggy probability, interval

If, based on historical behavior, an observed osd failure is likely to be
due to unresponsiveness and not the daemon stopping, scale the heartbeat
grace period accordingly:

 grace' = grace + laggy_probabiliy * laggy_interval

This will avoid fruitlessly marking OSDs down and generating additional
map update overhead when the cluster is overloaded and potentially
struggling to keep up with map updates.   See #3045.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: check failures in tick
Sage Weil [Tue, 4 Sep 2012 20:20:32 +0000 (13:20 -0700)]
mon: check failures in tick

Currently we only trigger a failure on receipt of a failure report.  Move
the checks into a helper and check during tick() too, so that we will
trigger failures even when the thresholds are not met at failure report
time.  This is rarely true now, but will be true once we locally scale the
grace period.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: clean up osd failure logging
Sage Weil [Tue, 4 Sep 2012 20:09:11 +0000 (13:09 -0700)]
mon: clean up osd failure logging

Debug log when we get a report, info log when we actual fail the osd.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: reply to all reporters when an osd is failed
Sage Weil [Tue, 4 Sep 2012 20:04:58 +0000 (13:04 -0700)]
mon: reply to all reporters when an osd is failed

Track the latest report message for each reporter.  When the osd is
eventually marked failed, send map updates to them all.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: locally apply osd heartbeat grace to failure checks
Sage Weil [Tue, 4 Sep 2012 18:50:30 +0000 (11:50 -0700)]
mon: locally apply osd heartbeat grace to failure checks

Aggregate the failure reports into a single mon 'failed_since' value (the
max, currently), and wait until we have exceeded the grace period to
consider the osd failed.

WARNING: This slightly changes the semantics.  Previously, the grace could
be adjusted in the [osd] section.  Now, the [osd] option controls when the
failure messages are sent, and the [mon] option controls when it is marked
down, and sane users should set it once in [global].

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: no_reply() to failure messages we don't reply to
Sage Weil [Mon, 3 Sep 2012 22:37:49 +0000 (15:37 -0700)]
mon: no_reply() to failure messages we don't reply to

This makes use clean up request state when requests have been forwarded.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: send 'null' reply to requests we won't reply to
Sage Weil [Sat, 1 Sep 2012 01:23:20 +0000 (18:23 -0700)]
mon: send 'null' reply to requests we won't reply to

This is a no-op if the client was talking to us, but in the forwarded
request case will clean up the request state (and request message) on the
forwarding monitor.  Otherwise, MOSDFailure messages (and probably others)
can accumulate on the non-leader mon indefinitely.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: refactor osd failure report tracking
Sage Weil [Tue, 18 Sep 2012 21:38:47 +0000 (14:38 -0700)]
mon: refactor osd failure report tracking

- use structs to track allegedly failed nodes, and reports against them.
- use methods to handle report, and failure threshold logic.
- calculate failed_since based on OSD's reported failed_for duration

This will make it simpler to extend the logic when we add dynamic
grace periods.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: adjust or decay laggy probabilities on osd boot
Sage Weil [Tue, 28 Aug 2012 03:02:12 +0000 (20:02 -0700)]
mon: adjust or decay laggy probabilities on osd boot

On each osd boot, determine whether the osd was laggy (wrongly marked down)
or newly booted.  Either update the laggy probability and interval or
decay the values, as appropriate.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdmap: include osd_xinfo_t to track laggy probabilities, timestamps
Sage Weil [Tue, 28 Aug 2012 02:57:48 +0000 (19:57 -0700)]
osdmap: include osd_xinfo_t to track laggy probabilities, timestamps

Track information about laggy probabilities for each OSD.  That is, the
probability that if it is marked down it is because it is laggy, and
the expected interval over which it will take to recovery if it is laggy.

We store this in the OSDMap because it is not convenient to keep it
elsewhere in the monitor.  Yet.  When the new mon infrastructure is in
place, there is a bunch of stuff that can be moved out of the OSDMap
'extended' section into other mon data structures.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: include boot_epoch in MOSDBoot
Sage Weil [Tue, 28 Aug 2012 00:23:30 +0000 (17:23 -0700)]
osd: include boot_epoch in MOSDBoot

This will let the monitor infer whether we were wrongly marked down or
the daemon restarted.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: include failed_for in MOSDFailure reports
Sage Weil [Tue, 18 Sep 2012 21:37:55 +0000 (14:37 -0700)]
osd: include failed_for in MOSDFailure reports

The monitor will need this to dynamically adjust the heartbeat grace.

Closes: #3044
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoPG: need pg lock to read osdmap_ref
Samuel Just [Tue, 18 Sep 2012 21:30:22 +0000 (14:30 -0700)]
PG: need pg lock to read osdmap_ref

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoOSD: in enqueue_op, cannot read *pg since we don't hold the pg lock
Samuel Just [Tue, 18 Sep 2012 21:27:06 +0000 (14:27 -0700)]
OSD: in enqueue_op, cannot read *pg since we don't hold the pg lock

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoOSD: remove some commented out pg->unlock calls
Samuel Just [Tue, 18 Sep 2012 21:26:37 +0000 (14:26 -0700)]
OSD: remove some commented out pg->unlock calls

Signed-off-by: Samuel Just <sam.just@inktank.com>