osd/ReplicatedPG: do not hit_set_persist while potentially backfilling hit_set_*

The hit_set transactions may include both a modify of the new hit_set and
deletion of an old one, spanning the backfill boundary, and we may end up
sending a backfill target a blank transaction that does not correctly
remove the old object.  Later it will notice the stray object and
throw an assertion.

Fix this by skipping hit_set_persist() if any of the backfill targets are
still working on the very first hash value in the PG (which is where all
of the hit_set objects live).  This is coarse but simple.

Another solution would be to send separate ops for the trim/deletion and
new hit_set update, but that is a bit more complex and a bit more
runtime overhead (twice the messages).

Fixes: #7983
Signed-off-by: Sage Weil <sage@inktank.com>
ceph-post-file: fix installation of ssh key files

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

ceph-post-file: fix installation of ssh key files
Merge pull request #1603 from ceph/wip-7983

osd/ReplicatedPG: do not hit_set_persist while potentially backfilling hit_set_*

Reviewed-by: Samuel Just <sam.just@inktank.com>
ceph-post-file: use getopt for multiple options, add longopts to help

Fixes: #7993
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Merge pull request #1605 from ceph/wip-7993

ceph-post-file: use getopt for multiple options, add longopts to help

Reviewed-by: Sage Weil <sage@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>
osd: fix map subscription in YOU_DIED osd_ping handler

If we have epoch X and find out we died as of epoch Y, we still want to
request X+1.  Among other things, this fixes a 'stall' if Y happens to be
the most recent map published and no new maps are generated because we will
never get anything back from our subscription.

This makes this osdmap_subscribe() caller match every other caller by
passing in current epoch + 1.

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

osd: fix osd map subscribe on YOU_DIED osd_ping

Reviewed-by: Samuel Just <sam.just@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>