OSD: _share_map_outgoing whenever sending a message to a peer

This ensures that they get new maps before an op which requires them (that
they would then request from the monitor).

Signed-off-by: Greg Farnum <greg@inktank.com>
mon: wait for quorum for MMonGetVersion

We should not respond to checks for map versions when we are in the
probing or electing states or else clients will get incorrect results when
they ask what the latest map version is.

Fixes: #7997
Signed-off-by: Sage Weil <sage@inktank.com>
mds: fix uninitialized fields in MDiscover

Fixes: #7739
Signed-off-by: Sage Weil <sage@inktank.com>
msgr: add ms_dump_on_send option

This is useful only for debugging.  The encoded contents of a message are
dumped to the log on message send.  This is useful when valgrind is
triggering warnings about uninitialized memory in messages because the
call chain will indicate which message type is to blame, whereas the
usual writer thread context does not tell us any useful information.

Signed-off-by: Sage Weil <sage@inktank.com>
mds: fix uninit MMDSSlaveRequest lock_type

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

mds: fix some uninitialized message fields

Reviewed-by: Zheng Yan <zheng.z.yan@intel.com>
Merge pull request #1607 from ceph/wip-7997

mon: wait for quorum for MMonGetVersion

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
mds: fix uninit val in MMDSSlaveRequest

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

OSD: _share_map_outgoing whenever sending a message to a peer

Reviewed-by: Sage Weil <sage@inktank.com>
ReplicatedPG::finish_promote: add debugging assert for clone_size

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::find_object_context: check obs.exists on clone obc before checking snaps

Fixes: #7858
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::_scrub: account for clone_overlap on each clone

Otherwise, we end up subtracting off clone_overlap for evicted clones
whose sizes we did not add in.

Fixes: #7964
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: use get_clone_bytes on evict/promote

Fixes: #7964
Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge pull request #1616 from ceph/wip-7916

ReplicatedPG: improve get_object_context debugging

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #1614 from ceph/wip-7964

Wip 7964

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #1617 from ceph/wip-7904

Wip 7904

Reviewed-by: Sage Weil <sage@inktank.com>
ReplicatedPG::make_writeable: check for evicted clone before adjusting for clone_overlap

Fixes: #7964
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::trim_object: account evicted prev clone for stats

If the previous clone is evicted, we shouldn't adjust the stats to
account for its new clone_overlap value.

Fixes: #7964
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: do not evict head while clone is being promoted

Fixes: #8003
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG,rados: add CEPH_OSD_[COPY_FROM]_IGNORE_RMED_SNAP

When attempting to promote a particular clone, we need to be able to able to
handle the posibility that the snap we are using to specify the clone may have
been removed.  Also, the cloneid used by the backing pool may not be the same
as the clone id used in the cache pool in the event that the cache pool's
cloneid has been removed before the clone in question has been flushed.  Thus,
we will promote using a snap which currently maps to the clone we want.  The
backend will do 1 of 2 things:
1) If the clone still exists, our requested snap will map to that clone
2) If the clone has been trimmed, we may end up reading from another
subsequent object.
We handle case 2) by, in finish_promote, verifying that our current pool info
indicates that the clone should still exist.

This also allows us to ignore the snaps returned by copy_get.

Fixes: #7942
Signed-off-by: Samuel Just <sam.just@inktank.com>