]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
10 years agotest: fix prematurely released lock in RadosModel
John Spray [Sun, 24 Aug 2014 17:17:59 +0000 (18:17 +0100)]
test: fix prematurely released lock in RadosModel

Should hold this lock while touching context->snaps.  Don't
think this has anything to do with #9203 though.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: fix ref counts in *Map_Latest
John Spray [Sat, 23 Aug 2014 19:03:47 +0000 (20:03 +0100)]
osdc/Objecter: fix ref counts in *Map_Latest

These contexts were putting before continuing to
use the CommandOp/LingerOp.  I added an assert to
reflect that, which was hitting (#9207).

This change is to remove the assertion and put the
put() in the right place (and the end of the function).

Fixes: #9207
Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: avoid locking two sessions at once
John Spray [Fri, 22 Aug 2014 16:22:07 +0000 (17:22 +0100)]
osdc/Objecter: avoid locking two sessions at once

... in close_session

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: disable lockdep for double lock
John Spray [Fri, 22 Aug 2014 12:37:46 +0000 (13:37 +0100)]
osdc/Objecter: disable lockdep for double lock

There is a special case in _recalc_linger_op_target
where we lock two sessions at once to transfer an op
between them.  It is deadlock safe because it's the only
place we lock two at once, and we hold rwlock for write
while we do it.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agocommon/RWLock: allow disable lockdep on calls
John Spray [Fri, 22 Aug 2014 14:19:08 +0000 (15:19 +0100)]
common/RWLock: allow disable lockdep on calls

To support callers with special cases where they
know they can safely take two locks with the
same name at the same time.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: fix resource management
John Spray [Fri, 15 Aug 2014 00:26:20 +0000 (01:26 +0100)]
osdc/Objecter: fix resource management

The refactor introduced various reference leaks, and
lacked cleanup in shutdown.

Things done here:
 * Reinstate _recalc_linger_op_target, which was accidentally
   disabled and let to freezes in notify() (#9112)
 * Make reference counting on OSDSessions much more explicit, using
   put_session and get_session everywhere
 * Add assertions in ~OSDSession and ~Objecter that the various
   maps of operations have been emptied.
 * Reassign ops away from closing session to homeless session in
   close_session()
 * Delete/deref all the ops from the objecter-wide maps of operations
   in shutdown()

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: handle (and ignore) MOSDMap; do not leak
Sage Weil [Tue, 19 Aug 2014 22:18:24 +0000 (15:18 -0700)]
librados: handle (and ignore) MOSDMap; do not leak

We return true, so we should drop the MOSDMap ref.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoclient: handle (and ignore) MOSDMap
Sage Weil [Tue, 19 Aug 2014 22:13:42 +0000 (15:13 -0700)]
client: handle (and ignore) MOSDMap

To avoid spamming the log.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: shut down monclient after objecter
Sage Weil [Fri, 15 Aug 2014 22:31:16 +0000 (15:31 -0700)]
librados: shut down monclient after objecter

The objecter ms_handle_reset may call into monc; shut objecter down first.

Fixes: #9130
Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomon/MonClient: ensure !cur_con == cur_mon.empty()
Sage Weil [Fri, 15 Aug 2014 22:30:30 +0000 (15:30 -0700)]
mon/MonClient: ensure !cur_con == cur_mon.empty()

Keep these in sync.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: verbose logging in ::notify
John Spray [Fri, 15 Aug 2014 13:58:57 +0000 (14:58 +0100)]
librados: verbose logging in ::notify

One is interested in knowning specifically which stage
of the operation we are at.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: fix uninitialized values in notify
John Spray [Fri, 15 Aug 2014 12:09:48 +0000 (13:09 +0100)]
librados: fix uninitialized values in notify

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: separate ::notify return values
John Spray [Fri, 15 Aug 2014 00:28:28 +0000 (01:28 +0100)]
librados: separate ::notify return values

There is a return code from objecter for committing
the notify linger op, and then later a code in the
CEPH_MSG_WATCH_NOTIFY handled by RadosClient directly.
Afaict there isn't any nice ordering guarantee here,
so they could stamp on each other.  Use a SaferCond
for the submit one.

I don't think this was related to #9112 but while
I'm here...

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrbd: handle blacklisting during shutdown
John Spray [Thu, 14 Aug 2014 22:59:16 +0000 (23:59 +0100)]
librbd: handle blacklisting during shutdown

This was failing the test_lock_fence.sh test due to
a crash during shutdown when the rbd client was blacklisted.

We should fix this more generally in ObjectCacher at some
point, but for the moment handle it explicitly in librbd.

Fixes: #9105
Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: refactor watch/notify; return notify error code
Sage Weil [Wed, 13 Aug 2014 00:40:36 +0000 (17:40 -0700)]
librados: refactor watch/notify; return notify error code

Get rid of a level of intermediate classes with confusing names and put
the notify and notify finish logic in a single place so that it is easier
to follow and understand.

Pass the return value from the notify completion message to the caller.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: prefix msg handler with handle_
Sage Weil [Mon, 11 Aug 2014 01:05:53 +0000 (18:05 -0700)]
librados: prefix msg handler with handle_

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: rename watch/notify callback register functions
Sage Weil [Mon, 11 Aug 2014 00:57:43 +0000 (17:57 -0700)]
librados: rename watch/notify callback register functions

Make it clear these are for watch OR notify, not just watch.  I was
confused.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosd: include ETIMEDOUT in notify reply on timeout
Sage Weil [Mon, 11 Aug 2014 00:52:18 +0000 (17:52 -0700)]
osd: include ETIMEDOUT in notify reply on timeout

If a notify operation times out (all watchers to not ACK in time), include
an ETIMEDOUT in the final error message back to the client, so that they
know about it.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomessages/MWatchNotify: include an error code in the message
Sage Weil [Mon, 11 Aug 2014 00:51:08 +0000 (17:51 -0700)]
messages/MWatchNotify: include an error code in the message

Document the fields, while we are here.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: avoid unnecessary locks
John Spray [Thu, 14 Aug 2014 13:39:10 +0000 (14:39 +0100)]
librados: avoid unnecessary locks

Revise wait_for_osdmap to be called outside of RadosClient::lock
and only take the lock if it has to wait for a map.

Also, now that objecter handles its own locking nicely,
there are various places where it is no longer necessary
for RadosClient to take its own lock -- all the calls that
go directly into objecter (RadosClient::pool_*) don't need
to hold RadosClient::lock.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: fix race on osdmap initialization
John Spray [Thu, 14 Aug 2014 10:56:07 +0000 (11:56 +0100)]
librados: fix race on osdmap initialization

This would cause occasional failures where calls
to lookup_pool immediately after connect() would
fail to find any pool because the OSD map had not
yet been loaded.  The wait for the map was lost when
the pool name cache was lost in ce176b827.

To avoid similar issues, the pool_requires_alignment
and pool_required_alignment helpers need the same
wait_for_osdmap before proceeding.  Usually callers
would call lookup_pool before these guys but it's
not guaranteed.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: update Objecter shutdown
John Spray [Wed, 13 Aug 2014 01:19:22 +0000 (02:19 +0100)]
librados: update Objecter shutdown

Previously checking for CONNECTED was equivalent to
checking the objecter had been initialized, but since
the separation between init() and start() that is
no longer the case.  Avoid the need to be smart by
just readint Objecter::initialized to learn whether
to call Objecter::shutdown

Fixes: #9067
Signed-off-by: John Spray <john.spray@redhat.com>
10 years agotools: update for Journaler/Objecter interfaces
John Spray [Tue, 12 Aug 2014 16:47:01 +0000 (17:47 +0100)]
tools: update for Journaler/Objecter interfaces

Journaler now requires a Finisher: construct one in
MDSUtility.

Objecter now requires separate calls to init() and start(),
do that in MDSUtility and also take advantage of Objecter's
new ability to act as its own dispatcher.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agocommon: fix Finisher perf counter
John Spray [Tue, 12 Aug 2014 16:45:40 +0000 (17:45 +0100)]
common: fix Finisher perf counter

This was declared as a long running average
but then .dec() was called on it, which
triggers an assertion.

You only have this problem if you pass a name
argument to Finisher::Finisher, which we mostly
don't do, but may as well fix this anyway.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc: remove unused Blinker.h
John Spray [Mon, 11 Aug 2014 21:33:28 +0000 (22:33 +0100)]
osdc: remove unused Blinker.h

Not used anyway, not touched since 2007.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agotest: add some missing modelines
John Spray [Mon, 11 Aug 2014 21:12:58 +0000 (22:12 +0100)]
test: add some missing modelines

Just happened to be editing these and they had
emacs modelines but no vim modelines.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc: Add lock to Filer::Probe
John Spray [Fri, 8 Aug 2014 00:49:26 +0000 (01:49 +0100)]
osdc: Add lock to Filer::Probe

This is necessary now that Objecter can call back
from multiple OSD op completions in parallel: otherwise
we get multiple threads trying to update
the same Probe object.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds/Server: fix wait_for_osd_map calls
John Spray [Thu, 7 Aug 2014 17:09:59 +0000 (18:09 +0100)]
mds/Server: fix wait_for_osd_map calls

These needed a C_OnFinisher and C_IO_Wrapper because they
are called back from the Objecter like an I/O completion.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Journaler: fix C_RetryRead locking
John Spray [Thu, 7 Aug 2014 17:08:41 +0000 (18:08 +0100)]
osdc/Journaler: fix C_RetryRead locking

Not sure this was ever actually getting used, but
it would have had a problem if it was.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: convert IO contexts
John Spray [Thu, 7 Aug 2014 14:56:40 +0000 (15:56 +0100)]
mds: convert IO contexts

As of this change, the only thing in the MDS inheriting
directly from Context is MDSContext.

The only files touching mds_lock explicitly are MDS, MDLog and
MDSContext -- everyone else should be getting their locking behaviour
via the contexts.  (one minor exception made for an assertion in
Locker).

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Journaler: use finisher for public callbacks
John Spray [Thu, 7 Aug 2014 14:52:58 +0000 (15:52 +0100)]
osdc/Journaler: use finisher for public callbacks

This is needed because of occasional lock cycles with
external callers doing e.g. write_head.

We do get some weird-looking multiply-nested
C_OnFinisher(C_OnFinisher(...)) from this approach,
where one finisher exists to protect journaler from
lock cycles wrt objecter, and the other exists
to protect the MDS from lock cycles wrt journaler.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Journaler: remove unused waitfor_trim
John Spray [Thu, 7 Aug 2014 14:15:38 +0000 (15:15 +0100)]
osdc/Journaler: remove unused waitfor_trim

There was no code path for ever adding contexts to this list.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: Switch to new context types
John Spray [Wed, 6 Aug 2014 13:37:11 +0000 (14:37 +0100)]
mds: Switch to new context types

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: add MDSContext subclasses
John Spray [Wed, 6 Aug 2014 13:35:57 +0000 (14:35 +0100)]
mds: add MDSContext subclasses

These allow contexts within the MDS to identify themselves
as either 'internal' contexts (expecting to be called within
the big MDS lock) or 'IO' contexts (which should take the big
mds lock themselves when called back).

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoinclude: generalize C_Contexts and C_Gather*
John Spray [Wed, 6 Aug 2014 13:31:53 +0000 (14:31 +0100)]
include: generalize C_Contexts and C_Gather*

... by making them templates so that they can be
used in places that expect a subclass of Context.

The existing names are now typedefs to template
instantiations using Context.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agocommon: assert non-null ptrs in OnFinisher
John Spray [Wed, 6 Aug 2014 11:27:13 +0000 (12:27 +0100)]
common: assert non-null ptrs in OnFinisher

Callers should not be constructing C_OnFinisher
if they have no context to call back.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoclient: add missing lock in sync_write_commit
John Spray [Tue, 5 Aug 2014 14:14:14 +0000 (15:14 +0100)]
client: add missing lock in sync_write_commit

This would otherwise assert when entering
the objectcacher.

Also add assertions for all the other Contexts
in Client, which are currently correct but not
so obvious.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoclient: remove unused C_SnapFlush
John Spray [Tue, 5 Aug 2014 13:55:39 +0000 (14:55 +0100)]
client: remove unused C_SnapFlush

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: rename IO completions with _IO_
Sage Weil [Mon, 28 Jul 2014 22:10:31 +0000 (15:10 -0700)]
mds: rename IO completions with _IO_

If they are IO operations and need to take mds_lock on finish, label them.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosdc/Objecter: make homeless_session a pointer
John Spray [Mon, 28 Jul 2014 16:22:59 +0000 (17:22 +0100)]
osdc/Objecter: make homeless_session a pointer

Have a non-pointer member that's a RefCountedObject
was awkward, e.g. tripping nref==0 assertion during
destruction.  Rather than play games with refcount
during destruction, just make it a new/delete instance
instead.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds/MDLog: del stale ref to C_MDS_WroteImportMap
John Spray [Mon, 28 Jul 2014 11:36:37 +0000 (12:36 +0100)]
mds/MDLog: del stale ref to C_MDS_WroteImportMap

(class no longer exists)

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: fix C_MDC_TruncateFinish locking
John Spray [Wed, 23 Jul 2014 16:40:12 +0000 (17:40 +0100)]
mds: fix C_MDC_TruncateFinish locking

This one needed to take mds_lock, and be invoked
from a finisher.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: fix Server::C_MarkEvent locking
John Spray [Wed, 23 Jul 2014 16:36:55 +0000 (17:36 +0100)]
mds: fix Server::C_MarkEvent locking

... it should acquire mds_lock.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: update mds_lock handling in Locker contexts
John Spray [Wed, 23 Jul 2014 16:35:24 +0000 (17:35 +0100)]
mds: update mds_lock handling in Locker contexts

For some contexts, we expect to be called back from the objecter/filer
on an I/O completion, so we must take mds_lock before updating any
MDS metadata.  In others, we expect to be called back from the MDCache
in response to updates to a CInode's state, so we assert that mds_lock
is already held.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds/MDLog: enable Journaler finisher
John Spray [Mon, 28 Jul 2014 16:35:49 +0000 (17:35 +0100)]
mds/MDLog: enable Journaler finisher

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc: Use a finisher from Journaler
John Spray [Wed, 23 Jul 2014 16:32:57 +0000 (17:32 +0100)]
osdc: Use a finisher from Journaler

Completions from I/O operations (i.e. the objecter) hop
through the finisher twice, because of the three layers of
locking (MDS::mds_lock -> Journaler::lock -> Objecter osd session lock)

Because on the way "right" we take the locks in that order, to avoid
deadlock we can't take the locks in the opposite order on the way
"left", hence the finishers.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc: locking for Journaler
John Spray [Wed, 23 Jul 2014 11:48:57 +0000 (12:48 +0100)]
osdc: locking for Journaler

also remove the lock pointers that JournalPointer load/save
used to require in order to use the objecter.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: fix calls to Objecter::wait_for_map
John Spray [Fri, 25 Jul 2014 16:26:22 +0000 (17:26 +0100)]
mds: fix calls to Objecter::wait_for_map

These were wrong in the earlier commit:
"mds: use lock-safe OSDMap accessors; adjust Objecter wait_for_map call"

Rather than checking epoch explicitly and dropping the lock before
calling wait_for_map, just make a single call to wait_for_map and handle
the return code to learn whether we are waiting or not.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: update MDLog._replay_thread for locking
John Spray [Wed, 23 Jul 2014 12:22:17 +0000 (13:22 +0100)]
mds: update MDLog._replay_thread for locking

... no longer use mds_lock as a guard for condition variable
while waiting for journaler contexts.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agomds: use finisher for BootStart contexts
John Spray [Wed, 23 Jul 2014 12:11:46 +0000 (13:11 +0100)]
mds: use finisher for BootStart contexts

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agolibrados: wait for map on create_ioctx failure
Sage Weil [Mon, 21 Jul 2014 21:11:42 +0000 (14:11 -0700)]
librados: wait for map on create_ioctx failure

Ensure we have a map so we don't simply complain that a pool doesn't
exists.  Only take the lock and wait if we fail to lookup the pool,
though, so we avoid contending the lock in the general case.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados/RadosClient: remove unused get_pool_name()
Sage Weil [Mon, 21 Jul 2014 21:07:59 +0000 (14:07 -0700)]
librados/RadosClient: remove unused get_pool_name()

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomds: allow Objecter to dispatch its own messages
Sage Weil [Mon, 21 Jul 2014 14:13:09 +0000 (07:13 -0700)]
mds: allow Objecter to dispatch its own messages

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosdc/Objecter: ignore messenger events before or after initalized
Sage Weil [Mon, 21 Jul 2014 04:14:04 +0000 (21:14 -0700)]
osdc/Objecter: ignore messenger events before or after initalized

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomon/MonClient: fix shutdown typo
Sage Weil [Mon, 21 Jul 2014 04:11:40 +0000 (21:11 -0700)]
mon/MonClient: fix shutdown typo

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados dispatch fix
Sage Weil [Mon, 21 Jul 2014 04:06:57 +0000 (21:06 -0700)]
librados dispatch fix

10 years agoclient: let Objecter dispatch directly
Sage Weil [Mon, 21 Jul 2014 03:50:00 +0000 (20:50 -0700)]
client: let Objecter dispatch directly

Add Objecter as a direct dispatcher.  Drop all of the callbacks and
messages we were passing along.  Wrap the IO completions in client_lock
(via C_Lock) and shunt them to the objecter_finisher.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoclient: add a Finisher for the Objecter
Sage Weil [Mon, 21 Jul 2014 03:49:19 +0000 (20:49 -0700)]
client: add a Finisher for the Objecter

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoinclude/Context: add generic C_Lock
Sage Weil [Mon, 21 Jul 2014 03:47:22 +0000 (20:47 -0700)]
include/Context: add generic C_Lock

Wrap a callback in a Mutex.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomds: push objecter completions to a Finisher
Sage Weil [Sun, 20 Jul 2014 22:00:55 +0000 (15:00 -0700)]
mds: push objecter completions to a Finisher

Most/all of the MDS completions need to be reentrant (and potentially
call back into the Objecter).  Shove them all onto a Finisher to make
sure that is safe.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomds: mark objecter completions with _IO_, take mds_lock
Sage Weil [Sun, 20 Jul 2014 21:51:28 +0000 (14:51 -0700)]
mds: mark objecter completions with _IO_, take mds_lock

For any completion we pass directly to Objecter, make sure we take the
mds_lock in finish(), and mark the class with _IO_ in the name.

Note that this doesn't address the use of Journaler.  And this assumes that
we are not holding the mds_lock already when Objecter::handle_osd_op_reply
is called.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosdc/Objecter: take over ownership of OSDMap
Sage Weil [Sun, 20 Jul 2014 21:16:49 +0000 (14:16 -0700)]
osdc/Objecter: take over ownership of OSDMap

Instead of taking a pointer to an existing OSDMap in our constructor,
allocate our own, so that we completely own it.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosdc/Objecter: make OSDMap private
Sage Weil [Sun, 20 Jul 2014 21:16:00 +0000 (14:16 -0700)]
osdc/Objecter: make OSDMap private

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosdc/Filer: use lock-safe OSDMap accessors
Sage Weil [Sun, 20 Jul 2014 21:15:41 +0000 (14:15 -0700)]
osdc/Filer: use lock-safe OSDMap accessors

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomds/SnapServer: use lock safe OSDMap accessors
Sage Weil [Sun, 20 Jul 2014 21:11:49 +0000 (14:11 -0700)]
mds/SnapServer: use lock safe OSDMap accessors

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomds: use lock-safe OSDMap accessors; adjust Objecter wait_for_map call
Sage Weil [Sun, 20 Jul 2014 21:10:41 +0000 (14:10 -0700)]
mds: use lock-safe OSDMap accessors; adjust Objecter wait_for_map call

We need to handle a race between when we inspect the OSDMap and when we
try to wait for the next map.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomds: use lock safe OSDMap accessors for TMAP2OMAP check
Sage Weil [Sun, 20 Jul 2014 20:41:15 +0000 (13:41 -0700)]
mds: use lock safe OSDMap accessors for TMAP2OMAP check

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoclient/SyntheticClient: use lock safe OSDMap accessors
Sage Weil [Sun, 20 Jul 2014 20:38:38 +0000 (13:38 -0700)]
client/SyntheticClient: use lock safe OSDMap accessors

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agotest_mon_workloadgen: use Objecter::wait_for_osd_map
Sage Weil [Sun, 20 Jul 2014 20:38:19 +0000 (13:38 -0700)]
test_mon_workloadgen: use Objecter::wait_for_osd_map

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosdc/Objecter: make wait_for_osd_map() locking safe
Sage Weil [Sun, 20 Jul 2014 20:36:47 +0000 (13:36 -0700)]
osdc/Objecter: make wait_for_osd_map() locking safe

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoclient: use Objecter::{get,put}_osdmap_read() interface
Sage Weil [Sun, 20 Jul 2014 20:23:46 +0000 (13:23 -0700)]
client: use Objecter::{get,put}_osdmap_read() interface

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: use {get,put}_osdmap_read() accessors
Sage Weil [Sun, 20 Jul 2014 18:08:36 +0000 (11:08 -0700)]
librados: use {get,put}_osdmap_read() accessors

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosd/OSDMap: return const string from get_pool_name
Sage Weil [Sun, 20 Jul 2014 17:52:51 +0000 (10:52 -0700)]
osd/OSDMap: return const string from get_pool_name

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: drop osdmap pool name cache
Sage Weil [Sun, 20 Jul 2014 17:36:44 +0000 (10:36 -0700)]
librados: drop osdmap pool name cache

We now have a rwlock for Objecter; no more need for a separate cache here.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosd/OSDMap: make lookup_pg_pool_name const
Sage Weil [Sun, 20 Jul 2014 17:35:38 +0000 (10:35 -0700)]
osd/OSDMap: make lookup_pg_pool_name const

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosdc/Objecter: add name-base pool_delete
Sage Weil [Sun, 20 Jul 2014 17:27:05 +0000 (10:27 -0700)]
osdc/Objecter: add name-base pool_delete

Avoid a lookup then delete race.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosdc/Objecter: protect pool ops with rwlock
Sage Weil [Sun, 20 Jul 2014 17:22:56 +0000 (10:22 -0700)]
osdc/Objecter: protect pool ops with rwlock

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosdc/Objecter: add OSDMap accessors that are lock-safe
Sage Weil [Sun, 20 Jul 2014 16:48:15 +0000 (09:48 -0700)]
osdc/Objecter: add OSDMap accessors that are lock-safe

Everybody needs to use these to inspect the OSDMap.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agolibrados: let Objecter dispatch its own messages
Sage Weil [Sun, 20 Jul 2014 15:51:25 +0000 (08:51 -0700)]
librados: let Objecter dispatch its own messages

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosd: let Objecter dispatch directly
Sage Weil [Sun, 20 Jul 2014 15:47:54 +0000 (08:47 -0700)]
osd: let Objecter dispatch directly

No need for our ObjecterDispatcher wrapper, now!

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosdc/Objecter: wire up native Dispatcher fast dispatch
Sage Weil [Sun, 20 Jul 2014 16:16:18 +0000 (09:16 -0700)]
osdc/Objecter: wire up native Dispatcher fast dispatch

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosdc/Objecter: make Objecter a Dispatcher
Sage Weil [Sun, 20 Jul 2014 16:17:44 +0000 (09:17 -0700)]
osdc/Objecter: make Objecter a Dispatcher

Note that it's not actually doing it yet, though!

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agomds: add finisher
Sage Weil [Sun, 20 Jul 2014 15:22:22 +0000 (08:22 -0700)]
mds: add finisher

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoobjecter: take write lock in ms_handle_reset()
Yehuda Sadeh [Thu, 17 Jul 2014 22:57:53 +0000 (15:57 -0700)]
objecter: take write lock in ms_handle_reset()

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agorwlock: assert on unlock if not locked
Yehuda Sadeh [Tue, 15 Jul 2014 22:51:21 +0000 (15:51 -0700)]
rwlock: assert on unlock if not locked

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agoobjecter: fix locking
Yehuda Sadeh [Thu, 5 Jun 2014 19:21:53 +0000 (12:21 -0700)]
objecter: fix locking

ms_handle_reset() takes the session lock, needed to be able to call
_kick_requetss() with it held.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agoobjecter: split objecter initialization
Yehuda Sadeh [Wed, 4 Jun 2014 18:46:50 +0000 (11:46 -0700)]
objecter: split objecter initialization

Separate objecter initialization to non cluster related work (e.g.,
internal data structures, other registrations), and to operations that
can initiate cluster interaction. This is so that we don't hit a rare
race where we can get called indirectly from one of the dispatcher callbacks
e.g., into handle_osd_map() when not yet being initialized.
This requires that objecter->init() should be called before
messenger->add_dispatcher_head(), and objecter->start() after it.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agoobjecter: Objecter::Op is refcounted
Yehuda Sadeh [Fri, 30 May 2014 16:46:03 +0000 (09:46 -0700)]
objecter: Objecter::Op is refcounted

Cancellation of lingerin ops collided with ops that we sent osdmap on,
needed to add a refcount for correct object delete.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agoobjecter: don't serialize responses if there's no object name
Yehuda Sadeh [Wed, 28 May 2014 19:12:31 +0000 (12:12 -0700)]
objecter: don't serialize responses if there's no object name

This implicitly fixes an issue with the list_objects() being reentrant,
and triggers a lock dependency issue. The better solution would be to
have the callback context specify whether it's reentrant or not, but
will require a much bigger change.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agoobjecter: shard completion_lock
Yehuda Sadeh [Mon, 12 May 2014 23:58:31 +0000 (16:58 -0700)]
objecter: shard completion_lock

Object ops responses are sharded, lock hashed by object name. This
guarantees ordering on the same object. Cross object order is not
guaranteed anymore.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agoobjecter: a major refactoring
Yehuda Sadeh [Wed, 4 Jun 2014 21:55:13 +0000 (14:55 -0700)]
objecter: a major refactoring

Fixes: #7619
Removed the client_lock (that used to pass in as a param) and replaced
it with a read-write lock (completely controlled by the objecter). Also
added a per-session read-write lock. Adapt code to use the new locking
scheme, removed locking where not needed. Replaced various counters to
atomics instead of grabbing the lock for updates. Moved ops to live
under the session.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
10 years agotimer: fix RWTimer shutdown
Yehuda Sadeh [Wed, 28 May 2014 00:09:50 +0000 (17:09 -0700)]
timer: fix RWTimer shutdown

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agolibrados: cancel operation
Yehuda Sadeh [Wed, 14 May 2014 19:25:40 +0000 (12:25 -0700)]
librados: cancel operation

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agotest_mon_workloadgen: fix for new objecter interface
Yehuda Sadeh [Tue, 22 Apr 2014 04:56:33 +0000 (21:56 -0700)]
test_mon_workloadgen: fix for new objecter interface

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agorgw: abort early from logging function
Yehuda Sadeh [Fri, 7 Mar 2014 20:43:43 +0000 (12:43 -0800)]
rgw: abort early from logging function

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agoosd: adapt to new Objecter interface
Yehuda Sadeh [Sat, 3 May 2014 15:41:05 +0000 (08:41 -0700)]
osd: adapt to new Objecter interface

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agolibrados: remove warning
Yehuda Sadeh [Mon, 31 Mar 2014 23:06:20 +0000 (16:06 -0700)]
librados: remove warning

Seems that the current locking scheme is ok. Objecter handles its
locking internally, librados needs to hold its lock.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agolibrados: push snap related functions down to objecter
Yehuda Sadeh [Sat, 3 May 2014 15:39:53 +0000 (08:39 -0700)]
librados: push snap related functions down to objecter

Need to take appropriate lock.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agolibrados: call objecter->handle_osd_map() under lock
Yehuda Sadeh [Fri, 28 Mar 2014 00:46:08 +0000 (17:46 -0700)]
librados: call objecter->handle_osd_map() under lock

The lock is not shared with the objecter anymore so we need to call
it under this lock, otherwise we're going to race with
wait_for_osdmap().

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
10 years agolibrados: adapt to new objecter interface
Yehuda Sadeh [Fri, 7 Mar 2014 23:35:40 +0000 (15:35 -0800)]
librados: adapt to new objecter interface

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>