mon/MonitorDBStore: expose get_chunk_tx()

Allow users get the transaction unencoded.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: sync all service prefixes, including pgmap_*

This was just recently broken with the merge of the pgmap changes.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/PGMonitor: cleanup: use const strings for pgmap prefixes

Signed-off-by: Sage Weil <sage@inktank.com>
mon: implement a simpler sync

The previous sync implementation was highly stateful and very complex.
This made it very hard to understand and to debug, and there were bugs
still lurking in the timeout code (at least).

Replace it with something much simpler:

 - sync providers are almost stateless.  they keep an iterator, identified
   by a unique cookie, that times out in a simple way.
 - sync requesters sync from whomever they fancy.  namely anyone with newer
   committed paxos state.

There are a few extra fields that might allow sync continuation later, but
this is complex and not necessary at this point.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/Paxos: config min paxos txns to keep separately

We were using paxos_max_join_drift to control the minimum number of
paxos transactions to keep around.  Instead, make this explicit, and
separate from the join drift.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/Paxos: remove unnecessary trim enable/disable

The sync no longer cares if we trim Paxos versions as we go, as long as we
don't trim so fast that we fall behind between GET_CHUNK messages, which
we can consider a tuning problem.

Remove this extra complexity!

Signed-off-by: Sage Weil <sage@inktank.com>
mon/Paxos: move consistent check into Paxos::init()

Signed-off-by: Sage Weil <sage@inktank.com>
mon: add --force-sync startup option

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonitorDBStore: drop unused single prefix synchronizer

Signed-off-by: Sage Weil <sage@inktank.com>
mon: rev the internal mon protocol

This captures the new sync.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: drop single-use is_sync_on_going() check

Signed-off-by: Sage Weil <sage@inktank.com>
mon: no need to reset sync state on restart

If we are in or forcing a sync, we can leave these there until the sync
completes.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: preserve last_committed_floor across sync

Add a paranoid check to prevent us from forgetting how far ahead our
last_committed was when we sync.  This prevents an i'll-timed forced-sync
from allowing paxos to warp back in time.

This should never happen unless there is a perfect storm of bad admin
decisions and/or bugs, but we guard against it anyway.

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

simpler mon sync

Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>