msgr: add get_loopback_connection() method

Return the Connection* for ourselves, so we can queue messages for
ourselves.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit a7059eb3f3922cf08c1e5bb5958acc2d45952482)
osd: requeue osdmaps on heartbeat connections for cluster connection

If we receive an OSDMap on the cluster connection, requeue it for the
cluster messenger, and process it there where we normally do.  This avoids
any concerns about locking and ordering rules.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 76705ace2e9767939aa9acf5d9257c800f838854)
osd: pass new maps to dead osds via existing Connection

Previously we were sending these maps to dead osds via their old addrs
using a new outgoing connection and setting the flags so that the msgr
would clean up.  That mechanism is possibly buggy and fragile, and we can
avoid it entirely if we just reuse the existing heartbeat Connection.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 1bc419a7affb056540ba8f9b332b6ff9380b37af)
osd: share incoming maps via Connection*, not addrs

Kill a set of parallel methods that are using the old addr/inst-based
msgr APIs, and instead use Connection handles.  This is much safer and gets
us closer to killing the old msgr API.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 5e2fab54a4fdf2f59e2b635cbddef8a5909acb7c)
osd: kill unused addr-based send_map()

Not used, old API, bad.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit e359a862199c8a94cb238f7271ba1b0edcc0863c)
Merge remote-tracking branch 'gh/wip-bobtail-osd-msgr' into bobtail
osd: tolerate unexpected messages on the heartbeat interface

We should note but not crash on unexpected messages.  Announce this awesome
new "capability" via a feature bit.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit afda30aeaae0a65f83c6886658354ad2b57c4c43)

Conflicts:

	src/include/ceph_features.h
osd: only share maps on hb connection of OSD_HBMSGS feature is set

Back in 1bc419a7affb056540ba8f9b332b6ff9380b37af we started sharing maps
with dead osds via the heartbeat connection, but old code will crash on an
unexpected message.  Only do this if the OSD_HBMSGS feature is present.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 302b26ff70ee5539da3dcb2e5614e2b7e83b9dcd)
mon: handle -EAGAIN in completion contexts

We can get ECANCELED, EAGAIN, or success out of the completion contexts,
but in the EAGAIN case (meaning there was an election) we were sending
a success to the client.  This resulted in client hangs and all-around
confusion when the monitor cluster was thrashing.

Backport: bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Luis <joao.luis@inktank.com>
(cherry picked from commit 17827769f1fe6d7c4838253fcec3b3a4ad288f41)
mon: retry PGStats message on EAGAIN

If we get EAGAIN from a paxos restart/election/whatever, we should
restart the message instead of just blindly acking it.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Luis <joao.luis@inktank.com>
(cherry picked from commit 4837063d447afb45554f55bb6fde1c97559acd4b)
mon: fix typo in C_Stats

Broken by previous commit.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 3cf3710be0b4cccc8de152a97be50d983c35116d)
java: make CephMountTest use user.* xattr names

Changes to the xattr code in Ceph require
a few tweaks to existing test cases.
Specifically, there is now a ceph.file.layout
xattr by default and user defined xattrs
are prepended with "user."

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Noah Watkins <noahwatkins@gmail.com>
librbd: unprotect any non-unprotected snapshot

Include snapshots in the UNPROTECTING state as well, which can occur
after an unprotect is interrupted.

Fixes: #4100
Backport: bobtail
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit fe283813b44a7c45def6768ea0788a3a0635957e)
rgw: change json formatting for swift list container

Fixes: #4048
There is some difference in the way swift formats the
xml output and the json output for list container. In
xml the entity is named 'name' and in json it is named
'subdir'.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 3e4d79fe42dfc3ca70dc4d5d2aff5223f62eb34b)
v0.56.3