]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
10 years agotests: histogram prevent re-use of local variables 2333/head
Loic Dachary [Tue, 26 Aug 2014 19:59:39 +0000 (21:59 +0200)]
tests: histogram prevent re-use of local variables

By moving the test to a separate function.

http://tracker.ceph.com/issues/9235 Fixes: #9235

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
10 years agoMerge pull request #2331 from ceph/wip-9238
Sage Weil [Tue, 26 Aug 2014 18:08:44 +0000 (11:08 -0700)]
Merge pull request #2331 from ceph/wip-9238

mds: fix FP error in ROUND_UP_TO

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agomds: fix FP error in ROUND_UP_TO 2331/head
John Spray [Tue, 26 Aug 2014 16:36:16 +0000 (17:36 +0100)]
mds: fix FP error in ROUND_UP_TO

Explicitly handle case where denominator is 0, instead of
passing into ROUND_UP_TO.

Regression from 9449520b121fc6ce0c64948386d4ff77f46f4f5f

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoMerge pull request #2314 from ceph/wip-mds-pc
John Spray [Tue, 26 Aug 2014 15:37:39 +0000 (16:37 +0100)]
Merge pull request #2314 from ceph/wip-mds-pc

mds: clean up perfcounter names

Reviewed-by: John Spray <john.spray@redhat.com>
10 years agoMerge pull request #2325 from xinxinsh/wip-9217
Sage Weil [Tue, 26 Aug 2014 14:53:06 +0000 (07:53 -0700)]
Merge pull request #2325 from xinxinsh/wip-9217

fix wrong value of op_w_latency perf counter

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agoMerge pull request #2327 from theanalyst/fix/vstart_rgw_port
Sage Weil [Tue, 26 Aug 2014 13:23:38 +0000 (06:23 -0700)]
Merge pull request #2327 from theanalyst/fix/vstart_rgw_port

vstart: start rgw on port specified by env var

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agovstart: start rgw on port specified by env var 2327/head
Abhishek Lekshmanan [Tue, 26 Aug 2014 10:16:55 +0000 (15:46 +0530)]
vstart: start rgw on port specified by env var

This ensures that user specified option according to $CEPH_RGW_PORT is
considered before starting radosgw

Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@ril.com>
10 years agodon't update op_rw_rlatency/op_w_rlatency when rlatency is zero 2325/head
xinxin shu [Tue, 26 Aug 2014 00:16:04 +0000 (08:16 +0800)]
don't update op_rw_rlatency/op_w_rlatency when rlatency is zero

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
10 years agofix wrong value of op_w_latency perf counter
xinxin shu [Tue, 26 Aug 2014 05:37:14 +0000 (13:37 +0800)]
fix wrong value of op_w_latency perf counter

Fixes: #9217
Signed-off-by: xinxin shu <xinxin.shu@intel.com>
10 years agoMerge branch 'wip-objecter'
John Spray [Tue, 26 Aug 2014 00:04:27 +0000 (01:04 +0100)]
Merge branch 'wip-objecter'

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agoMerge pull request #2319 from dachary/wip-9209-round-up-to
Sage Weil [Mon, 25 Aug 2014 21:47:33 +0000 (14:47 -0700)]
Merge pull request #2319 from dachary/wip-9209-round-up-to

common: ROUND_UP_TO accepts any rounding factor

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agocommon: ROUND_UP_TO accepts any rounding factor 2319/head
Loic Dachary [Mon, 25 Aug 2014 15:05:04 +0000 (17:05 +0200)]
common: ROUND_UP_TO accepts any rounding factor

The ROUND_UP_TO function was limited to rounding factors that are powers
of two. This saves a modulo but it is not used where it would make a
difference. The implementation is changed so it is generic.

http://tracker.ceph.com/issues/9209 Fixes: #9209

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
10 years agoMerge pull request #2323 from lpabon/fix-quick-guide
Yehuda Sadeh [Mon, 25 Aug 2014 18:53:59 +0000 (11:53 -0700)]
Merge pull request #2323 from lpabon/fix-quick-guide

Fix syntax error in rst documentation

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
10 years agoFix syntax error in rst documentation 2323/head
Luis Pabón [Mon, 25 Aug 2014 18:43:53 +0000 (14:43 -0400)]
Fix syntax error in rst documentation

Signed-off-by: Luis Pabón <lpabon@redhat.com>
10 years agoMerge pull request #2311 from onlyjob/master
Gregory Farnum [Mon, 25 Aug 2014 17:17:59 +0000 (10:17 -0700)]
Merge pull request #2311 from onlyjob/master

Fix FTBFS on alpha due to incorrect check on BLKGETSIZE

Reviewed-by: Greg Farnum <greg@inktank.com>
10 years agoMerge pull request #2318 from dachary/wip-osd-config
Sage Weil [Mon, 25 Aug 2014 15:32:29 +0000 (08:32 -0700)]
Merge pull request #2318 from dachary/wip-osd-config

documentation: update recovery config options defaults

10 years agodocumentation: update recovery config options defaults 2318/head
Loic Dachary [Mon, 25 Aug 2014 13:52:29 +0000 (15:52 +0200)]
documentation: update recovery config options defaults

So they match the values from config_opts.h

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
10 years agoMerge pull request #2275 from ceph/wip-9079
Sage Weil [Mon, 25 Aug 2014 13:25:07 +0000 (06:25 -0700)]
Merge pull request #2275 from ceph/wip-9079

msg/Accepter: do not unlearn_addr on bind()

Reviewed-by: Greg Farnum <greg@inktank.com>
10 years agoMerge pull request #2317 from ashishchandra1/patch-1
Loic Dachary [Mon, 25 Aug 2014 12:10:49 +0000 (14:10 +0200)]
Merge pull request #2317 from ashishchandra1/patch-1

Update python.rst

Reviewed-by: Loic Dachary <loic-201408@dachary.org>
10 years agoUpdate python.rst 2317/head
Ashish Chandra [Mon, 25 Aug 2014 12:06:29 +0000 (17:36 +0530)]
Update python.rst

Signed-off-by:ashish.a.chandra@ril.com

10 years agoMerge pull request #2316 from dachary/wip-warning
John Spray [Mon, 25 Aug 2014 10:06:42 +0000 (11:06 +0100)]
Merge pull request #2316 from dachary/wip-warning

rbd: fix signess warning

Reviewed-by: John Spray <john.spray@redhat.com>
10 years agomsg/Accepter: do not unlearn_addr on bind() 2275/head
Sage Weil [Mon, 25 Aug 2014 04:18:00 +0000 (21:18 -0700)]
msg/Accepter: do not unlearn_addr on bind()

It is dangerous to set need_addr = true as it means someone may set the
addr to something else (specifically the port) in a racing thread.

However, it is not necessary: the only reason we added it way back in
5d5045d31a9e10d21b44eb1bd137db9ae53128ff was so that
local_connection->peer_addr would get updated, and bind() now calls that
unconditionally.

Fixes: #9079
Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoosd: update handle_osd_map call
John Spray [Mon, 25 Aug 2014 00:45:22 +0000 (01:45 +0100)]
osd: update handle_osd_map call

I had changed the implementation in Objecter
to avoid a spurious get/put cycle in "osdc/Objecter: fix resource
management", but this guy was still going a get() before
calling handle_osd_map.

Signed-off-by: John Spray <john.spray@redhat.com>
10 years agocommon/Timer: fix deadlock in RWTimer::shutdown
John Spray [Mon, 25 Aug 2014 00:29:02 +0000 (01:29 +0100)]
common/Timer: fix deadlock in RWTimer::shutdown

Fixes: #9213
Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: fix op_cancel on homeless session
John Spray [Mon, 25 Aug 2014 00:16:39 +0000 (01:16 +0100)]
osdc/Objecter: fix op_cancel on homeless session

Wrote this block without realizing that op_cancel
takes write lock on session lock, and that operation
is undefined when you already hold the read lock.

Fixes: #9214
Signed-off-by: John Spray <john.spray@redhat.com>
10 years agoosdc/Objecter: hold session ref longer in resend
John Spray [Sun, 24 Aug 2014 22:48:57 +0000 (23:48 +0100)]
osdc/Objecter: hold session ref longer in resend

This is mostly cosmetic: in fact we are getting an extra
ref in _map_session and holding the session lock, so
it's safe, but it's awkward to be giving up the ref on
a session and then continuing to refer to it.

Signed-off-by: John Spray <john.spray@redhat.com>
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>