os/LevelDBStore: do compact_prefix() work asynchronously

We generally do not want to block while compacting a range of leveldb.
Push the blocking+waiting off to a separate thread.  (leveldb will do what
it can to avoid blocking internally; no reason for us to wait explicitly.)

This addresses part of #5176.

Signed-off-by: Sage Weil <sage@inktank.com>
os/LevelDBStore: allow compaction of key ranges

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonitorDBStore: allow compaction of ranges

Allow a transaction to describe the compaction of a range of keys.  Do this
in a backward compatible say, such that older code will interpret the
compaction of a prefix + range as compaction of the entire prefix.  This
allows us to avoid introducing any new feature bits.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: compact trimmed range, not entire prefix

This will reduce the work that leveldb is asked to do by only triggering
compaction of the keys that were just trimmed.

We ma want to further reduce the work by compacting less frequently, but
this is at least a step in that direction.

Signed-off-by: Sage Weil <sage@inktank.com>
debian: only stop daemons on removea; not upgrade

Signed-off-by: Sage Weil <sage@inktank.com>
debian: stop sysvinit ceph-mds daemons

Signed-off-by: Sage Weil <sage@inktank.com>
debian: stop radosgw daemons on package removal

Signed-off-by: Sage Weil <sage@inktank.com>
mon: Monitor: backup monmap using all ceph features instead of quorum's

When a monitor is freshly created and for some reason its initial sync is
aborted, it will end up with an incorrect backup monmap.  This monmap is
incorrect in the sense that it will not contain the monitor's names as
it will expect on the next run.

This results from us being using the quorum features to encode the monmap
when backing it up, instead of CEPH_FEATURES_ALL.

Fixes: #5203

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: return instead of exit(3) via preforker

This lets us run all the locally-scoped dtors so that leak checking will
work.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: fix leak of health_monitor and config_key_service

Switch to using regular pointers here.  The lifecycle of these services is
very simple such that refcounting is overkill.

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

Reviewed-by: Sage Weil <sage@inktank.com>
os/LevelDBStore: merge adjacent ranges in compactionqueue

If we get behind and multiple adjacent ranges end up in the queue, merge
them so that we fire off compaction on larger ranges.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: make compaction bounds overlap

When we trim items N to M, compact over range (N-1) to M so that the
items in the queue will share bounds and get merged.  There is no harm in
compacting over a larger range here when the lower bound is a key that
doesn't exist anyway.

Signed-off-by: Sage Weil <sage@inktank.com>
os/LevelDBStore: add perfcounters

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

Reviewed-by: Samuel Just <sam.just@inktank.com>
fix test users of LevelDBStore

Need to pass in cct.

Signed-off-by: Sage Weil <sage@inktank.com>
debian: invoke-rc.d does not work with upstart jobs

Broken by 19c5ac37ef87aeb3d3c30aa35cd61b6f3a8414bf.

Signed-off-by: Sage Weil <sage@inktank.com>
debian: add radosgw.postinst

Start radosgw-all job.

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

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
Merge branch 'wip-deb-removal' into next

Tested by Tamil, Gary.