timer: fix RWTimer shutdown

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
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>
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>
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>
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>
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>
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>
rwlock: assert on unlock if not locked

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
objecter: take write lock in ms_handle_reset()

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

Signed-off-by: Sage Weil <sage@redhat.com>
osdc/Objecter: make Objecter a Dispatcher

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

Signed-off-by: Sage Weil <sage@redhat.com>
osdc/Objecter: wire up native Dispatcher fast dispatch

Signed-off-by: Sage Weil <sage@redhat.com>
osd: let Objecter dispatch directly

No need for our ObjecterDispatcher wrapper, now!

Signed-off-by: Sage Weil <sage@redhat.com>
librados: let Objecter dispatch its own messages

Signed-off-by: Sage Weil <sage@redhat.com>
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>
osdc/Objecter: protect pool ops with rwlock

Signed-off-by: Sage Weil <sage@redhat.com>
osdc/Objecter: add name-base pool_delete

Avoid a lookup then delete race.

Signed-off-by: Sage Weil <sage@redhat.com>
osd/OSDMap: make lookup_pg_pool_name const

Signed-off-by: Sage Weil <sage@redhat.com>
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>
osd/OSDMap: return const string from get_pool_name

Signed-off-by: Sage Weil <sage@redhat.com>