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. :/
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>
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.
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.
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>
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>
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>
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>
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.
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.
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>
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.
David Zafman [Tue, 22 Apr 2014 06:52:04 +0000 (23:52 -0700)]
osd, common: If agent_work() finds no objs to work on delay 5 (default) secs
Add config osd_agent_delay_time of 5 seconds
Honor delay by ignoring agent_choose_mode() calls
Add tier_delay to logger
Treat restart after delay like we were previously idle
Fixes: #8113
Backport: firefly
Signed-off-by: David Zafman <david.zafman@inktank.com>
Danny Al-Gaaf [Fri, 2 May 2014 23:34:10 +0000 (01:34 +0200)]
rgw_bucket.cc: return error if update_containers_stats() fails
In case need_stats is set on rgw_read_user_buckets() and the
update_containers_stats() call fails with !-ENOENT, not only
print out a message but also return the error to the function
caller.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Callig _finish_hunting() clears out the bool hunting flag, which means we
don't retry by connection to another mon periodically. Instead, we send
keepalives every 10s. But, since we aren't yet in state HAVE_SESSION, we
don't check that the keepalives are getting responses. This means that an
ill-timed connection reset (say, after we get a MonMap, but before we
finish authenticating) can drop the monc into a black hole that does not
retry.
Instead, we should *only* call _finish_hunting() when we complete the
authentication handshake.
Fixes: #8278
Backport: firefly, dumpling Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
Kevin Dalley [Fri, 2 May 2014 00:04:43 +0000 (17:04 -0700)]
doc: Include links from hardware-recommendations to glossary
Included :term: in parts of hardware-recommendations so that glossary
links appear. Signed-off-by: Kevin Dalley <kevin@kelphead.org>
Danny Al-Gaaf [Fri, 14 Mar 2014 23:21:44 +0000 (00:21 +0100)]
KeyValueStore: rename s/logger/perf_logger/
[src/os/KeyValueStore.h:368] -> [src/os/ObjectStore.h:100]: (warning) The class
'KeyValueStore' defines member variable with name 'logger' also defined in its
parent class 'ObjectStore'.
KeyValueStore logger is of type PerfCounters while ObjectStore logger is Logger.
Change the name in KeyValueStore to more obvious name perf_logger.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>