mon: Monitor: use rank instead of name when randomly picking monitors

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: Monitor: fix bug on _pick_random_mon() that would choose an invalid rank

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon/Paxos: don't ignore peer first_committed

We go to the effort of keeping a map of the peer's first/last committed
so that we can send the right commits during the first phase of paxos,
but we forgot to record the first value.  This appears to simply be an
oversight.  It is mostly harmless; it just means we send extra states
that the peer already has.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
mon/Paxos: update first_committed when we trim

The Paxos::trim() -> ::trim_to() path trims old states but does not
update first_committed.  This misinforms later paxos rounds such that
peers think they can participate and end up with COMMIT messages
following the COLLECT/LAST exchange that are for future commits they
can't do anything with and then crash out when they get the BEGIN:

mon/Paxos.cc: 557: FAILED assert(begin->last_committed == last_committed)

Fixes: #4879
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Revert "PaxosService: use get and put for version_t"

This reverts commit e725c3e210b244e090d70c77d937c94f4f63a2be.

These inadvertantely got rid of the prefix portion of the key, which
lead to overwriting the wrong keys.

Fixes: #4872
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
doc/rados/deploy: misc edits

Signed-off-by: Sage Weil <sage@inktank.com>
doc/rados/deploy: note that osd delete does not work yet

Signed-off-by: Sage Weil <sage@inktank.com>
Merge remote-tracking branch 'gh/next'
dumper: fix Objecter locking

Locking expectations changed at some point, and the Dumper wasn't
updated to comply:
1) We need to take the lock for Objecter, as it
doesn't do so on its own any more.
2) We need to drop the lock in several places so that Objecter
can take delivery of messages

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
mon: add --mon-leveldb-paranoid flag

This is sort of equivalent to an fsck.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: add --osd-leveldb-paranoid flag

Signed-off-by: Sage Weil <sage@inktank.com>
OSD: cancel_pending_splits needs to cancel all descendants

expand_pg_num() and load_pgs() may result in a pg with children
in pending_splits which also have children in pending_splits (etc).

Signed-off-by: Samuel Just <sam.just@inktank.com>
OSD: load_pgs() should fill in start_split honestly

In load_pgs(), we previously called assigned children starting
at the loaded pg created between its stored epoch and the current
osdmap to have that pg as their parent.  This is not correct, some
of the children may have been split in subsequent epochs from children
split in earlier epochs.  Instead, do each map individually.

Signed-off-by: Samuel Just <sam.just@inktank.com>
tools: ceph-osdomap-tool.cc

Add tool for dumping info from osd omap.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Makefile: put ceph_monstore_tool in bin_DEBUGPROGRAMS

Signed-off-by: Samuel Just <sam.just@inktank.com>
Makefile,gitignore: ceph-monstore-tool, not ceph_monstore_tool

Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge remote-tracking branch 'upstream/wip_4884' into next

Fixes: #4884
Reviewed-by: Greg Farnum <greg@inktank.com>
Merge remote-tracking branch 'gh/wip-doc-cuttlefish' into next
Merge branch 'next'
Update debian.rst

"complete list of distributions" should be complete list of releases since we already know what distributions are supported and the list specifies releases. (Wheezy, Precise etc.)