]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
11 years agorbd-fuse.c: remove ridiculous linebreak 1788/head
Danny Al-Gaaf [Thu, 8 May 2014 15:08:32 +0000 (17:08 +0200)]
rbd-fuse.c: remove ridiculous linebreak

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorbd-fuse.c: fix indentation
Danny Al-Gaaf [Thu, 8 May 2014 15:05:48 +0000 (17:05 +0200)]
rbd-fuse.c: fix indentation

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorbd-fuse.c: fix -Wmissing-field-initializers
Danny Al-Gaaf [Thu, 8 May 2014 14:59:45 +0000 (16:59 +0200)]
rbd-fuse.c: fix -Wmissing-field-initializers

Init image_name with NULL to fix:

rbd_fuse/rbd-fuse.c:57:63: warning: missing field 'image_name' initializer
 [-Wmissing-field-initializers]
 struct rbd_options rbd_options = {"/etc/ceph/ceph.conf", "rbd"};

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorbd.cc: init 'snap_protected' to fix -Wconditional-uninitialized
Danny Al-Gaaf [Thu, 8 May 2014 14:09:07 +0000 (16:09 +0200)]
rbd.cc: init 'snap_protected' to fix -Wconditional-uninitialized

Init 'snap_protected' with false to fix:

rbd.cc:544:35: warning: variable 'snap_protected' may be uninitialized
 when used here [-Wconditional-uninitialized]
      f->dump_string("protected", snap_protected ? "true" : "false");
                                  ^~~~~~~~~~~~~~
rbd.cc:482:22: note: initialize the variable 'snap_protected' to silence
 this warning
  bool snap_protected;
                     ^
                      = false

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorbd-fuse.c: init 'rbd' in open_rbd_image()
Danny Al-Gaaf [Thu, 8 May 2014 14:04:18 +0000 (16:04 +0200)]
rbd-fuse.c: init 'rbd' in open_rbd_image()

Init 'rbd' in open_rbd_image() with NULL and add a check for
'rbd' before dereference it to fix:

rbd_fuse/rbd-fuse.c:182:29: warning: variable 'rbd' may be uninitialized
 when used here [-Wconditional-uninitialized]
        int ret = rbd_open(ioctx, rbd->image_name, &(rbd->image), NULL);
                                  ^~~
rbd_fuse/rbd-fuse.c:151:27: note: initialize the variable 'rbd' to silence
 this warning
        struct rbd_openimage *rbd;
                                 ^
                                  = NULL

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoObjectCacher::_wait_for_write(): init 'bool done'
Danny Al-Gaaf [Thu, 8 May 2014 13:54:24 +0000 (15:54 +0200)]
ObjectCacher::_wait_for_write(): init 'bool done'

Init 'bool done' with 'false' to fix:

osdc/Objecter.h:915:27: warning: implicit conversion los: variable 'done'
 may be uninitialized when used here [-Wconditional-uninitialized]
      while (!done)
              ^~~~
osdc/ObjectCacher.cc:1399:14: note: initialize the variable 'done' to
 silence this warning
    bool done;
             ^
              = false

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoObjecter::calc_target(): init best_locality with 0
Danny Al-Gaaf [Thu, 8 May 2014 13:47:08 +0000 (15:47 +0200)]
Objecter::calc_target(): init best_locality with 0

Init best_locality to fix:

osdc/Objecter.cc:1519:26: warning: variable 'best_locality' may be
 uninitialized when used here [-Wconditional-uninitialized]
              (locality >= 0 && best_locality >= 0 &&
                                ^~~~~~~~~~~~~
osdc/Objecter.cc:1511:19: note: initialize the variable 'best_locality'
 to silence this warning
        int best_locality;
                         ^
                          = 0

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoremove superfluous second semicolons at end of lines
Danny Al-Gaaf [Thu, 8 May 2014 08:09:25 +0000 (10:09 +0200)]
remove superfluous second semicolons at end of lines

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agomsg: fix some -Wextra-semi warnings
Danny Al-Gaaf [Thu, 8 May 2014 07:38:28 +0000 (09:38 +0200)]
msg: fix some -Wextra-semi warnings

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agocrush/builder.c: remove some unreachable return statements
Danny Al-Gaaf [Thu, 8 May 2014 07:34:21 +0000 (09:34 +0200)]
crush/builder.c: remove some unreachable return statements

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoECUtil.h: clarify calculation with braces
Danny Al-Gaaf [Wed, 7 May 2014 19:18:44 +0000 (21:18 +0200)]
ECUtil.h: clarify calculation with braces

Fix for cppcheck issue:
 [src/osd/ECUtil.h:61]: (style) Clarify calculation
  precedence for '%' and '?'.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorgw_acl_swift.h: fix #define header guard
Danny Al-Gaaf [Wed, 7 May 2014 16:52:49 +0000 (18:52 +0200)]
rgw_acl_swift.h: fix #define header guard

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorgw_rest_metadata.cc: fix -Wparentheses-equality
Danny Al-Gaaf [Wed, 7 May 2014 16:02:51 +0000 (18:02 +0200)]
rgw_rest_metadata.cc: fix -Wparentheses-equality

Fix for:
warning: equality comparison with extraneous parentheses
 [-Wparentheses-equality]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoReplicatedPG.cc: fix -Wparentheses
Danny Al-Gaaf [Wed, 7 May 2014 16:00:10 +0000 (18:00 +0200)]
ReplicatedPG.cc: fix -Wparentheses

Fix for:
warning: using the result of an assignment as  a condition
 without parentheses [-Wparentheses]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_rgw_manifest.cc: fix VLA of non-POD element type
Danny Al-Gaaf [Wed, 7 May 2014 15:28:31 +0000 (17:28 +0200)]
test_rgw_manifest.cc: fix VLA of non-POD element type

Use vector to fix:
test/rgw/test_rgw_manifest.cc:184:20: error: variable length array
 of non-POD element type 'RGWObjManifest'
  RGWObjManifest pm[num_parts];

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1775 from ceph/wip-rbd-clang
Danny Al-Gaaf [Wed, 7 May 2014 13:47:56 +0000 (15:47 +0200)]
Merge pull request #1775 from ceph/wip-rbd-clang

fix clang-analyzer warnings in rbd and objectcacher

Reviewed-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1782 from xinglin/coverity-fixes
Danny Al-Gaaf [Wed, 7 May 2014 13:34:30 +0000 (15:34 +0200)]
Merge pull request #1782 from xinglin/coverity-fixes

test/libcephfs/test.cc: free cmount structure before return

Reviewed-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1532 from ceph/wip-fast-dispatch
Gregory Farnum [Wed, 7 May 2014 06:06:14 +0000 (23:06 -0700)]
Merge pull request #1532 from ceph/wip-fast-dispatch

fast dispatch
This series adds an ms_fast_dispatch interface to the Messenger/Dispatcher, designed so that you can dispatch messages directly from the Pipe threads without going through the Dispatch queue.
It also sets the OSD to make use of this interface for most operations, and switches to finer-grained locking and use of local data in a bunch of different paths to enable that.

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge remote-tracking branch 'origin/master' into wip-fast-dispatch 1532/head
Greg Farnum [Wed, 7 May 2014 05:23:06 +0000 (22:23 -0700)]
Merge remote-tracking branch 'origin/master' into wip-fast-dispatch

Conflicts:
src/osd/OSD.cc

11 years agotest/libcephfs/test.cc: free cmount structure before return 1782/head
Xing Lin [Mon, 17 Mar 2014 06:00:28 +0000 (00:00 -0600)]
test/libcephfs/test.cc: free cmount structure before return

call ceph_shutdown to free cmount structure before return

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
11 years agoMerge pull request #1774 from ceph/wip-8296
Sage Weil [Tue, 6 May 2014 20:08:39 +0000 (13:08 -0700)]
Merge pull request #1774 from ceph/wip-8296

osd/ReplicatedPG: fix whiteouts for other cache mode

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoPipe: wait for Pipes to finish running, instead of just stop()ing them
Greg Farnum [Mon, 5 May 2014 04:58:04 +0000 (21:58 -0700)]
Pipe: wait for Pipes to finish running, instead of just stop()ing them

Add a stop_and_wait() function that, in addition to closing the Pipe and killing
its socket, waits for any fast_dispatch call which is in-progress. Use this in
several parts of the Pipe and SimpleMessenger code where appropriate.

This fixes several races with fast_dispatch and other avenues; here are two:
1) It could be that we grab the lock while the existing pipe is fast_dispatching
and then proceed to dispatch messages ourself, beating it. Instead, wait for
the other pipe. Add a "reader_dispatching" member which tells bus this is
happening, and when re-locking, signal the cond if we're shutting down.

2) It could be that a normally-dispatched Message in the OSD triggers a
mark_down() on the Connection and then clears out the Session
(Connection::priv) pointer, causing a racing fast_dispatch()'ed function to
assert out in the OSD because it requires a valid Session.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agolibrbd: check return value during snap_unprotect 1775/head
Josh Durgin [Tue, 6 May 2014 18:18:28 +0000 (11:18 -0700)]
librbd: check return value during snap_unprotect

This would only fail if the header object was corrupted, so it's
unlikely to occur in practice.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoObjectCacher: remove useless assignment
Josh Durgin [Tue, 6 May 2014 18:11:01 +0000 (11:11 -0700)]
ObjectCacher: remove useless assignment

left is not read after the break. Caught by clang-analyzer.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoosd/ReplicatedPG: fix whiteouts for other cache mode 1774/head
Sage Weil [Tue, 6 May 2014 18:01:27 +0000 (11:01 -0700)]
osd/ReplicatedPG: fix whiteouts for other cache mode

We were special casing WRITEBACK mode for handling whiteouts; this needs to
also include the FORWARD and READONLY modes.  To avoid having to list
specific cache modes, though, just check != NONE.

Fixes: #8296
Backport: firefly
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1601 from ceph/wip-7576
Samuel Just [Tue, 6 May 2014 17:49:46 +0000 (10:49 -0700)]
Merge pull request #1601 from ceph/wip-7576

osd: prevent pg map epochs from lagging too far behind

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1748 from onlyjob/docs
Josh Durgin [Tue, 6 May 2014 17:12:45 +0000 (10:12 -0700)]
Merge pull request #1748 from onlyjob/docs

sample.ceph.conf update:

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge pull request #1653 from ceph/wip-7499
Josh Durgin [Tue, 6 May 2014 17:10:59 +0000 (10:10 -0700)]
Merge pull request #1653 from ceph/wip-7499

rgw, radosgw-admin: bucket link uses bucket instance id now

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge pull request #1768 from daniel-j-h/code_quality
Sage Weil [Tue, 6 May 2014 14:12:00 +0000 (07:12 -0700)]
Merge pull request #1768 from daniel-j-h/code_quality

Variable length array of std::strings (not legal in C++) changed to std::vector<std::string>

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoRevert "Fix installation into user home directory, broken by d3f0c0b"
Sage Weil [Tue, 6 May 2014 14:04:56 +0000 (07:04 -0700)]
Revert "Fix installation into user home directory, broken by d3f0c0b"

This reverts commit 7539281037ce7a755ac8661ecb15aea32e5f79f6.

This breaks mount.fuse.ceph installation.

11 years agodoc: Fixed artifacts from merge.
John Wilkins [Tue, 6 May 2014 10:54:45 +0000 (03:54 -0700)]
doc: Fixed artifacts from merge.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
11 years agodoc: Added sudo to setenforce. Restored merge artifact.
John Wilkins [Tue, 6 May 2014 10:54:08 +0000 (03:54 -0700)]
doc: Added sudo to setenforce. Restored merge artifact.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
11 years agodoc: Added erasure coding and cache tiering notes. Special thanks to Loic Dachary.
John Wilkins [Tue, 6 May 2014 10:53:03 +0000 (03:53 -0700)]
doc: Added erasure coding and cache tiering notes. Special thanks to Loic Dachary.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
11 years agoVariable length array of std::strings (not legal in C++) changed to std::vector<std... 1768/head
Daniel J. Hofmann [Mon, 5 May 2014 14:06:45 +0000 (16:06 +0200)]
Variable length array of std::strings (not legal in C++) changed to std::vector<std::string>

Signed-off-by: Daniel J. Hofmann <daniel@trvx.org>
11 years agoMerge pull request #1770 from ceph/wip-8290
Sage Weil [Mon, 5 May 2014 23:55:49 +0000 (16:55 -0700)]
Merge pull request #1770 from ceph/wip-8290

client: check snap_caps in Incode::is_any_caps()

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoclient: check snap_caps in Incode::is_any_caps() 1770/head
Yan, Zheng [Mon, 5 May 2014 23:44:45 +0000 (07:44 +0800)]
client: check snap_caps in Incode::is_any_caps()

Fixes: #8290
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
11 years agoMerge pull request #1764 from eile/master
Sage Weil [Mon, 5 May 2014 23:26:27 +0000 (16:26 -0700)]
Merge pull request #1764 from eile/master

Fix installation into user home directory, broken by d3f0c0b

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoSimpleMessenger: Don't grab the lock when sending messages if we don't have to
Greg Farnum [Tue, 22 Apr 2014 19:51:37 +0000 (12:51 -0700)]
SimpleMessenger: Don't grab the lock when sending messages if we don't have to

We'd like it if sending a message didn't require any global locks, but the
submit_message() function conditionally needs it in order to create new
Pipes. So:
1) When failing on a dud Pipe, verify that it's still the Pipe the Connection
is linked to; if not, try sending along the newly-linked Pipe.
2) Add an "already_locked" param to submit_message
3) Have the Connection-based interface set this param to false, and
the addr-based interface set it to true, reflecting whether they have
taken the SimpleMessenger::lock.
4) If we discover we need to reference global data structures in
submit_mesage:
  4a) if locked, do as we previously have
  4b) if not locked, take the lock and call into submit_message again.

The net effect of this is that in the typical case, the Connection-based
_send_message() function no longer acquires global locks, only per-Connection
ones. In the case where the Connection must recreate a Pipe, it falls back to
performing like the addr-based _send_message() does. In the case where
we are racing with somebody else recreating a Pipe(either us or the other
end), we may try twice but we will still only take per-Connection/Pipe locks,
which is a fair tradeoff for not taking the global lock.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoOSD: rename share_map_incoming and share_map_outgoing
Greg Farnum [Fri, 25 Apr 2014 21:36:03 +0000 (14:36 -0700)]
OSD: rename share_map_incoming and share_map_outgoing

share_map_incoming -> share_map
share_map_outgoing -> share_map_peer

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: move the peer_epoch and map sharing infrastructure into OSDService
Greg Farnum [Fri, 25 Apr 2014 21:00:00 +0000 (14:00 -0700)]
OSD: move the peer_epoch and map sharing infrastructure into OSDService

None of this code requires OSD-internal data or acquring locks from
anybody else.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: move the {boot,up,bind} epochs into OSDService
Greg Farnum [Fri, 25 Apr 2014 20:36:14 +0000 (13:36 -0700)]
OSD: move the {boot,up,bind} epochs into OSDService

Provide interfaces around setting and retrieving them, instead of accessing
them directly with a lock.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: scan for dropped PGs in consume_map instead of advance_map
Greg Farnum [Fri, 25 Apr 2014 00:20:48 +0000 (17:20 -0700)]
OSD: scan for dropped PGs in consume_map instead of advance_map

We have to wait until after we know that nobody will be adding ops for
newly-dead PGs to the list. While we're moving it, switch the locking
so we only hold a write lock while deleting the actual lists.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: do not take the pre_publish_lock in connection utility functions
Greg Farnum [Fri, 4 Apr 2014 21:32:37 +0000 (14:32 -0700)]
OSD: do not take the pre_publish_lock in connection utility functions

They loop back around for local connections and deadlock, so we use the
map reservation mechanism instead.
TODO: actually that issue is out of date, do we still want this change?

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: enable ms_fast_dispatch
Greg Farnum [Wed, 26 Mar 2014 22:04:39 +0000 (15:04 -0700)]
OSD: enable ms_fast_dispatch

We've been setting it up, now this patch actually adds a fast path for osd ops
which bypasses the osd_lock and should not block on any longly held locks. In
addition to the actual ms_fast_dispatch; we take advantage of the fast_notify
functions in order to create a Session for every peer, since that is now the
data structure around which we handle incoming Messages and waitlisting; and
fast_preprocess in order to track when a peer has already sent us a new map
(otherwise, if we see an op with a too-new epoch, we have to request it from
the monitor).

Signed-off-by: Samuel Just <sam.just@inktank.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: remove dead comment
Greg Farnum [Fri, 25 Apr 2014 00:27:18 +0000 (17:27 -0700)]
OSD: remove dead comment

enqueue_op no longer requires holding the osd_lock.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: Juggle the locking when resurrecting a PG
Greg Farnum [Sun, 13 Apr 2014 06:06:37 +0000 (23:06 -0700)]
OSD: Juggle the locking when resurrecting a PG

Don't hold the old PG's lock in _create_lock_pg. Instead, just copy the
necessary data bits into a holding location. Note that this means we aren't
protecting it against change while the new PG is created, which I *think*
is okay...

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: don't share_map_incoming() directly from handle_replica_op()
Greg Farnum [Fri, 4 Apr 2014 21:52:04 +0000 (14:52 -0700)]
OSD: don't share_map_incoming() directly from handle_replica_op()

Let the op_tp handle it, or our C_SendMap callback in the op_gen_wq.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: use the async workqueue to send OSDMap updates on dropped ops
Greg Farnum [Tue, 25 Mar 2014 03:42:19 +0000 (20:42 -0700)]
OSD: use the async workqueue to send OSDMap updates on dropped ops

Check whether we actually want to send a map in-line, and if we do, create
a GenContext which does so and put that in the op_gen_wq.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: add an op threadpool GenContext workqueue
Greg Farnum [Tue, 25 Mar 2014 03:31:58 +0000 (20:31 -0700)]
OSD: add an op threadpool GenContext workqueue

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: allow build_incremental_map_msg to fail on lookups
Greg Farnum [Tue, 25 Mar 2014 22:32:30 +0000 (15:32 -0700)]
OSD: allow build_incremental_map_msg to fail on lookups

Since we're now building incremental map messages out-of-band with doing
other map updates now, we need to tolerate lookup failures at the bottom
end. Do so by returning a NULL message in that case.
Handle that in send_incremental_map by looping until we get a
message back -- if we fail on the first attempt, we'll get
the OSDSuperblock again and deal with it.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: fix a few map sharing bugs
Greg Farnum [Fri, 11 Apr 2014 21:45:45 +0000 (14:45 -0700)]
OSD: fix a few map sharing bugs

1) do not share OSD maps with peers that already have them
2) do not share maps with oneself

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: move should_share_map and share_map_incoming to OSDService
Greg Farnum [Fri, 21 Mar 2014 22:59:08 +0000 (15:59 -0700)]
OSD: move should_share_map and share_map_incoming to OSDService

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: pass a pointer to last_sent_epoch instead of the whole Session
Greg Farnum [Fri, 21 Mar 2014 22:44:55 +0000 (15:44 -0700)]
OSD: pass a pointer to last_sent_epoch instead of the whole Session

We don't use any other part of the Session, and this interface will
be easier to move out of the OSD class.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: share map updates in the op_tp threads instead of the main dispatch thread
Greg Farnum [Fri, 21 Mar 2014 18:07:36 +0000 (11:07 -0700)]
OSD: share map updates in the op_tp threads instead of the main dispatch thread

Sharing maps can require disk accesses and things. We don't want to do that
in our fast path, so do it in OSD::dequeue_op instead of OSD::handle_op. We're
cheating slightly and still doing it in handle_op if no op actually gets queued,
but we're going to put those into a separate work queue next. We'll also be
moving all the functions necessary for this into OSDService so that our completion
struct doesn't need to be a friend to OSD.
To make this easier, we're adding send_map_update and sent_epoch members to
OpRequest.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: refactor handle_op error handling cases
Greg Farnum [Wed, 26 Mar 2014 20:14:12 +0000 (13:14 -0700)]
OSD: refactor handle_op error handling cases

We move our map version-checking code earlier (to dispatch_op) and refactor
our other fail-to-dispatch cases. This is friendlier for the no-lock
message processing we'll use with fast dispatch.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: change Session handling around _share_map_incoming
Greg Farnum [Thu, 20 Mar 2014 23:12:05 +0000 (16:12 -0700)]
OSD: change Session handling around _share_map_incoming

Move responsibility for the reference up to _share_map_incoming's caller,
and start using the Session::sent_epoch_lock. This looks a little silly
now, but we're going to split up the decide-to-send-maps and send-maps steps
and don't want to block in the decide-to-send step, so we need some
pretty flexible locking up at this level.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: add a Session::sent_epoch_lock
Greg Farnum [Thu, 20 Mar 2014 22:44:15 +0000 (15:44 -0700)]
OSD: add a Session::sent_epoch_lock

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: simplify _share_map_incoming based on _should_share_map()
Greg Farnum [Thu, 20 Mar 2014 22:57:30 +0000 (15:57 -0700)]
OSD: simplify _share_map_incoming based on _should_share_map()

Also, remove the bool return code since nobody looks at it.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: add _should_share_map function
Greg Farnum [Thu, 20 Mar 2014 22:55:50 +0000 (15:55 -0700)]
OSD: add _should_share_map function

Just copy _share_map_incoming and rip out all the parts that actually
update data structures.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: use an OSDMapRef& and require the Session* in _share_map_incoming
Greg Farnum [Thu, 20 Mar 2014 22:50:35 +0000 (15:50 -0700)]
OSD: use an OSDMapRef& and require the Session* in _share_map_incoming

You can pass in a NULL Session*, but both callers do that; and using
an OSDMapRef& reduces shared_ptr copies.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: use safe params in map-sharing functions
Greg Farnum [Thu, 20 Mar 2014 17:05:14 +0000 (10:05 -0700)]
OSD: use safe params in map-sharing functions

We were previously using unprotected access to OSD members.

Unfortunately, this does not make them completely safe: we are looking up
maps asynchronously from when we got access to the cached map bounds, and
so the OSD could delete a map out from underneath us. Fixing that will
require some kind of map bounds lock. :/

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD::send_incremental_map: use service superblock so we can avoid locking osd_lock
Samuel Just [Fri, 8 Nov 2013 22:11:59 +0000 (14:11 -0800)]
OSD::send_incremental_map: use service superblock so we can avoid locking osd_lock

TODO: make it actually safe by dealing with build_incremental_map_msg()

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoOSD::_share_map_incoming: pass osdmap in explicitly
Samuel Just [Fri, 8 Nov 2013 20:41:08 +0000 (12:41 -0800)]
OSD::_share_map_incoming: pass osdmap in explicitly

We'll want to be able to use this method without the osd_lock. Note
that we can't do so yet -- we call send_incremental_map, which is not
safe to call unlocked.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: protect state member with a Spinlock
Greg Farnum [Mon, 14 Apr 2014 17:47:16 +0000 (10:47 -0700)]
OSD: protect state member with a Spinlock

This member was previously protected by the osd_lock (although setting
SHUTDOWN was synchronized with the heartbeat lock, too), but we need
to read it for fast dispatch, so protect it under its own lock at all times.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: protect access to boot_epoch, up_epoch, bind_epoch
Greg Farnum [Tue, 18 Mar 2014 03:49:00 +0000 (20:49 -0700)]
OSD: protect access to boot_epoch, up_epoch, bind_epoch

We need to access these members in some call chains via fast_dispatch,
where they're otherwise unprotected.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: shard heartbeat_lock
Greg Farnum [Thu, 10 Apr 2014 23:43:05 +0000 (16:43 -0700)]
OSD: shard heartbeat_lock

heartbeat_need_update must be protected independently in order to avoid
a loop with the pg_map_lock and the PG::_lock.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: Push responsibility for grabbing pg_map_lock up to callers of _remove_pg()
Greg Farnum [Thu, 10 Apr 2014 21:19:46 +0000 (14:19 -0700)]
OSD: Push responsibility for grabbing pg_map_lock up to callers of _remove_pg()

The atomicity requirements of other systems prevent us dropping the PG lock
inside that function, and the PG lock is ordered underneath the pg_map_lock.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: wake_pg_waiters atomically with pg_map update
Samuel Just [Fri, 8 Nov 2013 23:20:49 +0000 (15:20 -0800)]
OSD: wake_pg_waiters atomically with pg_map update

Also, call enqueue_op directly rather than going back
through the entire dispatch machinery.
Be sure to grab the pg lock under the pg_map_lock in _open_lock_pg() to
preserve necessary lock ordering.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: remove wake_all_pg_waiters
Samuel Just [Fri, 8 Nov 2013 23:17:15 +0000 (15:17 -0800)]
OSD: remove wake_all_pg_waiters

We shouldn't need this -- we check the pg waiters list on each
map.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: add session waiting_for_map mechanisms
Samuel Just [Fri, 8 Nov 2013 23:15:46 +0000 (15:15 -0800)]
OSD: add session waiting_for_map mechanisms

This will replace the existing waiting_for_osdmap mechanism
with a per-session wait list.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: pass osdmap to handle_op and handle_replica_op
Samuel Just [Fri, 8 Nov 2013 17:35:54 +0000 (09:35 -0800)]
OSD: pass osdmap to handle_op and handle_replica_op

We need a map to process them, and we don't want to
take the OSD lock to access one. (And we can't just
use the service because we need all processing of
a message to be done with the same map.)

Signed-off-by: Samuel Just <sam.just@inktank.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: add a RWLock pg_map_lock
Greg Farnum [Fri, 14 Mar 2014 22:46:46 +0000 (15:46 -0700)]
OSD: add a RWLock pg_map_lock

If we're going to dispatch ops without grabbing the osd lock, we need
something else to protect the pg map (and it'll be a little
contended, so use a read-write lock).

We repurpose the (previously oddly-named) _lookup_lock_pg_with_map_lock_held()
function to refer to the pg_map_lock. handle_pg_query and handle_pg_remove
switch to use that version, because they're holding pg_map_lock already and
we know the PG they're referring to exists.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSDService: add osdmap reservation mechanism
Samuel Just [Thu, 7 Nov 2013 20:48:27 +0000 (12:48 -0800)]
OSDService: add osdmap reservation mechanism

The goal here is to be able to get "reserved" refs
to next_map, and ensure that pgs won't see a newer
map until the ref is "released".  I haven't done
a cute RAII trick here yet...probably not worth
the effort.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Conflicts:
src/osd/OSD.h
Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agomsgr: change the delay queue flushing semantics
Greg Farnum [Thu, 10 Apr 2014 23:32:56 +0000 (16:32 -0700)]
msgr: change the delay queue flushing semantics

Since we're doing fast_dispatch out of the delay queue, we don't want to
flush while holding the pipe lock. Instead, make flush set it up for instant
delivery, and steal the delay queue when replacing pipes. If we're shutting
down a pipe, wait until flushing has completed before doing so.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agomsgr: enable fast_dispatch on local connections
Greg Farnum [Fri, 4 Apr 2014 20:55:54 +0000 (13:55 -0700)]
msgr: enable fast_dispatch on local connections

We do two things:
1) Call ms_handle_fast_connect() when setting up the local connection, so
the Dispatcher can set up any state it needs
2)Move local_delivery into a separate thread from the sender's. fast_dispatch
makes this entirely necessary since otherwise we're dipping back in to the
Dispatcher while holding whatever locks it held when it sent the Message.

Implementation starts with a thread and a list of messages to process and
proceeds as you'd expect from that.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoMessenger,DispatchQueue: add ms_fast_dispatch mechanism
Samuel Just [Thu, 7 Nov 2013 21:46:08 +0000 (13:46 -0800)]
Messenger,DispatchQueue: add ms_fast_dispatch mechanism

This adds a Dispatcher interface allowing the implementation
to accept ms_fast_dispatch calls for some messages without
going through the DispatchQueue. To support that, we also add
1) new synchronous notifications on connect and accept events
2) a fast_preprocess mechanism

Signed-off-by: Samuel Just <sam.just@inktank.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoDispatchQueue: factor out pre_dispatch and post_dispatch
Samuel Just [Thu, 7 Nov 2013 21:44:07 +0000 (13:44 -0800)]
DispatchQueue: factor out pre_dispatch and post_dispatch

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: remove never-activated while loop from send_incremental_map
Greg Farnum [Tue, 25 Mar 2014 04:38:48 +0000 (21:38 -0700)]
OSD: remove never-activated while loop from send_incremental_map

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: rename gen_wq, schedule_work, and PG_QueueAsync to include "recovery"
Greg Farnum [Mon, 24 Mar 2014 21:35:02 +0000 (14:35 -0700)]
OSD: rename gen_wq, schedule_work, and PG_QueueAsync to include "recovery"

These all hook into the recovery thread pool and need to make that obvious.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: remove unused push_wq
Greg Farnum [Mon, 24 Mar 2014 18:19:46 +0000 (11:19 -0700)]
OSD: remove unused push_wq

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: replace handle_pg_scan, handle_pg_backfill with handle_replica_op
Samuel Just [Thu, 7 Nov 2013 23:34:27 +0000 (15:34 -0800)]
OSD: replace handle_pg_scan, handle_pg_backfill with handle_replica_op

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoOSD: add handle_osd_map debug output
Greg Farnum [Thu, 3 Apr 2014 21:24:22 +0000 (14:24 -0700)]
OSD: add handle_osd_map debug output

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoOSD::_share_map_incoming: line wrap debug output
Samuel Just [Fri, 8 Nov 2013 20:39:49 +0000 (12:39 -0800)]
OSD::_share_map_incoming: line wrap debug output

Formatting only.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoPG: constify the init() function params
Greg Farnum [Sun, 13 Apr 2014 04:26:55 +0000 (21:26 -0700)]
PG: constify the init() function params

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agoRWLock: assert pthread function return values
Samuel Just [Sat, 9 Nov 2013 22:31:55 +0000 (14:31 -0800)]
RWLock: assert pthread function return values

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoMerge pull request #1769 from ceph/wip-doc-cache-tier
John Wilkins [Mon, 5 May 2014 22:26:27 +0000 (15:26 -0700)]
Merge pull request #1769 from ceph/wip-doc-cache-tier

doc: Support for cache tiering.

11 years agoMerge remote-tracking branch 'origin/wip-doc-radosgw-80'
Josh Durgin [Mon, 5 May 2014 22:12:29 +0000 (15:12 -0700)]
Merge remote-tracking branch 'origin/wip-doc-radosgw-80'

Conflicts:
doc/radosgw/config.rst

11 years agoMerge pull request #1760 from ceph/wip-8283
Samuel Just [Mon, 5 May 2014 21:53:47 +0000 (14:53 -0700)]
Merge pull request #1760 from ceph/wip-8283

osd/ReplicatedPG: fix trim of in-flight hit_sets

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agodoc: Fix hyperlink. 1767/head
John Wilkins [Mon, 5 May 2014 19:35:41 +0000 (12:35 -0700)]
doc: Fix hyperlink.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
11 years agodoc: Index update and librados.
John Wilkins [Mon, 5 May 2014 19:34:59 +0000 (12:34 -0700)]
doc: Index update and librados.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
11 years agodoc: Quotas for Admin Ops API.
John Wilkins [Mon, 5 May 2014 19:33:58 +0000 (12:33 -0700)]
doc: Quotas for Admin Ops API.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
11 years agodoc: New Admin Guide for Ceph Object Storage.
John Wilkins [Mon, 5 May 2014 19:33:30 +0000 (12:33 -0700)]
doc: New Admin Guide for Ceph Object Storage.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
11 years agoFix installation into user home directory, broken by d3f0c0b 1764/head
Stefan Eilemann [Mon, 5 May 2014 07:54:19 +0000 (09:54 +0200)]
Fix installation into user home directory, broken by d3f0c0b

Signed-off-by: Stefan Eilemann <Stefan.Eilemann@epfl.ch>
11 years agoosd: check blacklisted clients in ReplicatedPG::do_op()
Yan, Zheng [Sat, 3 May 2014 21:17:15 +0000 (05:17 +0800)]
osd: check blacklisted clients in ReplicatedPG::do_op()

OSD checks if client is blacklisted only when receiving OSD request.
It's possible that OSD request's sender get blacklisted while OSD
request in in some waiting list.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
(cherry picked from commit f92677c5b2cac03f42f15c826bfb809fec27830d)

11 years agoMerge pull request #1740 from ceph/wip-8155
Sage Weil [Sat, 3 May 2014 22:13:37 +0000 (15:13 -0700)]
Merge pull request #1740 from ceph/wip-8155

mon: OSDMonitor: disallow nonsensical cache-mode transitions

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoceph-object-corpus: rebase onto firefly corpus
Sage Weil [Sat, 3 May 2014 14:59:28 +0000 (07:59 -0700)]
ceph-object-corpus: rebase onto firefly corpus

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1762 from yuyuyu101/wip-8282
Sage Weil [Sat, 3 May 2014 14:41:48 +0000 (07:41 -0700)]
Merge pull request #1762 from yuyuyu101/wip-8282

Fix clone problem

Backport: firefly
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1752 from ceph/wip-da-SCA-fixes-20140501
Sage Weil [Sat, 3 May 2014 13:49:56 +0000 (06:49 -0700)]
Merge pull request #1752 from ceph/wip-da-SCA-fixes-20140501

Various fixes from SCA

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1755 from eile/master
Sage Weil [Sat, 3 May 2014 13:42:04 +0000 (06:42 -0700)]
Merge pull request #1755 from eile/master

Fix out of source builds

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoFix out of source builds 1755/head
Stefan Eilemann [Fri, 2 May 2014 12:10:48 +0000 (14:10 +0200)]
Fix out of source builds

Signed-off-by: Stefan Eilemann <Stefan.Eilemann@epfl.ch>