mon/PaxosService: remove unused exists_version() variant

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonmapMonitor: avoid exists_version() helper

We are the only user; open-code it.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: drop unused helpers

Signed-off-by: Sage Weil <sage@inktank.com>
mon: make PaxosService::get_value() int return type 64-bit

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
unused get_value()
mon: fix mkfs monmap cleanup

exists_key(a,b) was looking for "monmap/mkfs/monmap".

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: remove mkfs helpers

Keep it simple.  These are one-liners.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: simplify full helpers, drop single-use helper

We are the only caller for get_version(prefix, name), so move it inline
and drop it.  Also rename full_version_name to full_prefix_name, which I
find slightly less confusing.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/OSDMOnitor: use provided get_version_full()

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: drop unused {get,set,put}_version(prefix, a, bl)

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: some whitespace

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: drop unused last_accepted_name

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PaxosService: s/get_version()/get_last_committed()/

Avoid aliasing simple accessors; use a single name instead.  Also, function
name overloading will throw a wrench in the class inheritance later.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: factor out SequencePaxosService from PaxosService

Factor out the parts of PaxosService that assume a sequence of versioned
states into a child class.  The parent class retains all of the basic
hooks around when paxos is active and proposing and pulling state out of
the underlying store.

This will make it possible to implement a PaxosService that is not a
sequence of states.  First up: PGMonitor!

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PGMap: make int type explicit

We get away with this because int is 32-bits on x86_64 and i386 both, but
we should be explicit anyway!

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PGMonitor: drop some dead code

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PGMonitor: store PGMap directly in leveldb

Instead of encoding incrementals and periodically dumping the whole encoded
PGMap in leveldb, instead store everything in a range of keys, and update
between versions using transactions.

Keep a list of updated pgs and osds on each version so that we know which
keys to refresh in update_from_paxos() when moving between versions.

Caveats:
 - dirty lists need to be trimmed
 - upgrade not yet implemented

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