mon: MDSMonitor: remove reference to no-longer-used encode_trim()

We weren't using it and it's no longer used by anyone anyway.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: MDSMonitor: consider 'debug level' parameter on 'print_map()'

The parameter was there, just not used.  It does default to 7, so
existing callers are okay.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: MDSMonitor: print map on encode_pending() iff debug mon = 30+

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: MDSMonitor: implement 'get_trim_to()' to let the mon trim mdsmaps

This commit also adds two options to the MDSMonitor:

  - mon_max_mdsmap_epochs: the maximum amount of maps we'll keep (def: 500)
  - mon_mds_force_trim: the version we want to trim to

This results in 'get_trim_to()' returning the possible values:

  - if we have set mon_mds_force_trim, and this value is greater than the
    last committed version, trim to mon_mds_force_trim
  - if we hold more than the max number of maps, trim to last - max
  - if we have set mon_mds_force_trim and if we hold more than the max
    number of maps, and mon_mds_force_trim is lower than last - max,
    then trim to last - max

Backport: dumpling
Backport: emperor

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: MDSMonitor: let PaxosService decide on whether to propose

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: Have 'ceph report' print last committed versions

Only for those services that weren't doing it.

Backport: dumpling
Backport: emperor

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
tools: ceph-kvstore-tool: output value contents to file on 'get'

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: ceph-kvstore-tool: get size of value for prefix/key

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

mon: MDSMonitor: trim versions and let PaxosService decide whether to propose

We were not trimming mdsmap versions and were generating a new map every time
we modified the pending value.

Now we not only make sure that MDSMonitor will trim old maps (configurable
option allowing us to set the maximum number of maps to keep, defaulting to 500,
much like other services do) but we also delegate to PaxosService the decision on
whether to propose our pending value.

We also perform several modifications to 'ceph-kvstore-tool', allowing one to obtain
the contents of a given prefix:key and have them outputted to a file instead of stdout,
and also add support for getting the size of a given prefix:key's value.

'ceph report' was also modified so that we always output the first and last
committed versions for all services; up until this point, we would only output the
first committed version on all services, and only a few were also outputting the
last committed version.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>