client: Remove object from oset before deleting

Prevent invalid memory references for cases where
a truncate causes an object to be deleted but the
object set still references it.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
osdc/ObjectCacher: do not take Object ref for bh writes

This reverts commit 46897fd4ffc2fe2fc2cc0c39b5d4c510df1e6c25.

There is no reason to carry a ref for the writes; it just makes things
more confusing because the refs aren't used for lifecycle, only for
LRU pinning.  We would need to duplicate the close_object() conditional
here for this to work right.

This fixes #3431, in which a slow osd reply has an Object pinned, but when
we try to truncate it away we hit the assert in can_close().

Signed-off-by: Sage Weil <sage@inktank.com>
mon: use parse_osd_id() throughout

Signed-off-by: Sage Weil <sage@inktank.com>
mon: correctly identify crush names

get_item_id() returns 0 if the name already exists; that's not what we
want here.  Verify the name exists before checking its id.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: clean up 'ceph osd ...' list output

No more 'osd.0 is already inosd.1 is already in' crap.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: OSDMonitor: fix spacing when outputting items on command reply

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: OSDMonitor: clarify some command replies

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
rgw: ops log can also go to socket

Adding a new ops log output (into a unix domain socket).
Configuration:
  rgw_enable_usage_log : master switch for ops log
  rgw ops log socket path : set socket path
  rgw ops log rados : whether ops should be logged in the rados
                      cluster
  rgw ops log data backlog : max size in MB to be accumulated
                             without flushing

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Merge remote-tracking branch 'gh/wip-3431' into next
mon/MonClient: use thread-safe RNG for picking monitors

Avoid using shared-state rand() when picking monitors.  This way we don't
screw with library users like test_librbd_fsx that rely on srand() and
rand() being deterministic.

Signed-off-by: Sage Weil <sage@inktank.com>
rgw: add -lresolv flags to Makefile.am

radosgw depends on libresolv since since the commit 951c6be. So we need to
add -lresolve flags, or it cannot link right library.

Signed-off-by: Chen Baozi <baozich@gmail.com>
ceph_mon: cleanup on shutdown

Properly cleanup the throttlers, 'g_ceph_context' and the
async_singnal_handler.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: remove all sessions on shutdown

Signed-off-by: Sage Weil <sage@inktank.com>
mon: Monitor: drop election messages if entity doesn't have enough caps

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: Monitor: finish contexts on shutdown

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: Paxos{,Service}: finish contexts and put messages on shutdown

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: Monitor: make MSG_MON_PAXOS case a bit more consistent

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
msg/Pipe: don't leak session_security

Make sure we free old instances of sesseion_security before we reset the
pointer.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: sessions get cleaned up before dtor

Signed-off-by: Sage Weil <sage@inktank.com>
mon: drop con->session reference in remove_session()

This captures all callers.

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