Update RBD doc for OpenStack

Some updates from Icehouse, best practice configurations and
explanations.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>

Conflicts:
	doc/rbd/rbd-openstack.rst
Add Header cache to KeyValueStore

In the performance statistic recently, the header lookup becomes the main time
consuming for the read/write operations. Most of time it occur 50% to deal with
header lookup, decode/encode logics.

Now adding header cache using SharedLRU structure which will maintain the header
cache and caller will get the pointer to the real header. It also avoid too much
header copy operations overhead.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Remove exclusive lock on GenericObjectMap

Now most of GenericObjectMap interfaces use header as argument not the union of
coll_t and ghobject_t. So caller should be responsible for maintain the
exclusive header.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
decrement WBThrottle perfcounters in clear_object

We observed that the WBThrottle perfcounters are leaking upwards
at a rate of around 50-100 ios_dirtied per day. The counters are
currently not decremented in clear_object, so that's the likely
explanation. Decrement them like elsewhere in WBThrottle.

Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
Revert "OSD: move waiting_for_pg into Session"

This reverts commit ecda2fef8ce982df3581a3b47ba74ae581d82479.

This leaves Session* refs indefinitely in the map.

This was one source of #7995.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: clear Sessions for loopback Connections on shutdown

Starting with the fast dispatch patches, we are calling the handle_connect
on loopback.  Make sure we zap them on shutdown to break the Session <->
Connection ref cycle.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: fix session leak when waiting on map

We don't want to leak the Session if this Session is already waiting on
a map.

Introduced by eb30f88c942d80cbc951d4d0f375479069d15624.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: clear sessions_waiting_on_map on shutdown

Wake up these ops and drop the Session refs on shutdown.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #2081 from ceph/wip-osd-leaks

osd: fix several memory leaks from fast dispatch

Reviewed-by: Samuel Just <sam.just@inktank.com>
messages: MForward: fix compat version

A while ago we bumped the head version and reset the compat version to 0.
Doing this so happens to make the messenger assume that the message does
not support the compat versioning and sets the compat version to the head
version -- thus making compat = 2 when it should have been 1.

The nasty side-effect of this is that upgrading from emperor to firefly
will have emperor-leaders being unable to decode forwarded messages from
firefly-peons.

Fixes: #8727

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Merge pull request #2082 from ceph/wip-8727

messages: MForward: fix compat version

Reviewed-by: Sage Weil <sage@redhat.com>
Merge pull request #2076 from cernceph/wip-wbthrottle-perfcounters

decrement WBThrottle perfcounters in clear_object

Reviewed-by: Samuel Just <sam.just@inktank.com>
mon: OSDMonitor: add 'osd pool get-quota' command

Enables us to obtain current quotas for a given pool.

Fixes: #8523

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
qa/workunits: cephtool: test for 'osd pool {get,set}-quota'

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Merge remote-tracking branch 'gh/next'
osd: separate cleanup from PGBackend::on_change()

The generic portion of on_change() cleaned up temporary on-disk objects
and requires a Transaction.  The rest is clearing out in-memory state and
does not.  Separate the two.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: clear PGBackend state on shutdown

This was leaking state on shutdown whenever there were in-flight repops
that were canceled.

Fixes: #7891
Signed-off-by: Sage Weil <sage@inktank.com>
osd: s/applying repop/canceling repop/

The 'applying' language dates back to when we would wait for acks from
replicas before applying writes locally.  We don't do any of that any more;
now, this loop just cancels the repops with remove_repop() and some other
cleanup.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: cancel agent_timer events on shutdown

We need to cancel all agent timer events on shutdown.  This also needs to
happen early so that any in-progress events will execute before we start
flushing and cleaning up PGs.

Backport: firefly
Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #2085 from ceph/wip-7891

osd: fix pg ref leaks on shutdown

Reviewed-by: Samuel Just <sam.just@inktank.com>