Commit Graph

93257 Commits

Author SHA1 Message Date
Sage Weil
572311b614 mon/MonMap: adjust build_initial behavior for mkfs vs probe
For the mkfs case, interpret an ambiguous port as a v2 address.  For probe,
try both.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-01-03 11:17:31 -06:00
Sage Weil
5992a61c2c mon/MonMap: improve ambiguous addr behavior
Signed-off-by: Sage Weil <sage@redhat.com>
2019-01-03 11:17:31 -06:00
Sage Weil
b1493f0d9a qa/suites/rados/upgrade: spread mons a bit
This will mean 2/3 mons have default ports.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-01-03 11:17:31 -06:00
Sage Weil
fbdc1358e6 qa/rados/thrash-old-clients: keep mons on separate hosts
This ensures the mons can use default ports, ceph.conf won't have v1: or
v2: prefixes, and old clients will be happy.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-01-03 11:17:31 -06:00
Sage Weil
7559a47f5b qa/standalone/mon/misc.sh: tweak test to be more robust
Signed-off-by: Sage Weil <sage@redhat.com>
2019-01-03 11:17:31 -06:00
Sage Weil
2f786f3299 qa/tasks/mon_seesaw: expect v1/v2 prefix in addr
Signed-off-by: Sage Weil <sage@redhat.com>
2019-01-03 11:17:31 -06:00
Sage Weil
55a9c7522f osd/OSDMap: fix is_blacklisted() check to assume type ANY
Note that this still does a copy of the addr struct (as it did before).
This could be more efficient...

Signed-off-by: Sage Weil <sage@redhat.com>
2019-01-03 11:17:31 -06:00
Sage Weil
0610e56265 mon/OSDMonitor: use ANY addr type for blacklisting
Client addresses are untyped in that they can connect to v1 or v2 server
endpoints, so blacklist them as TYPE_ANY.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-01-03 11:17:20 -06:00
Sage Weil
5a404f9e4b mon/msg_types: TYPE_V1ORV2 -> TYPE_ANY
..and allow us to parse it.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-22 15:53:13 -06:00
Sage Weil
b84b8c9c66 qa/workunits/cephtool: fix blacklist test
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
0692d06979 qa/suites/upgrade: install old version with only v1 addrs
v1+v2 support is new in nautilus.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
40a7dfbb1f common/options: by default, bind to both msgr v1 and v2 addresses
This will be the case for some time, until v1 clients are fully phased out.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
9f66edbd5e vstart.sh: add --msgr1, --msgr2, --msgr21 options
..and clean up the monmap IP generation.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
7490db6dd1 msg/async/ProtocolV2: be flexible with server identity check
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
35d4283106 msg/msg_types: fix entity_addrvec_t::parse() with null end arg
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
6429537bd7 qa/suites/rados/basic/msgr: no msgr2 addrs in initial monmaps
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
de9b77cd38 qa/tasks/ceph: add 'mon_bind_addrvec' and 'mon_bind_msgr2' options
- Sometimes we don't want to use v2 addrs
- Sometimes we don't want addrvecs at all (e.g., upgrades)

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
7ff8fc7397 monmaptool: add --addv argument to pass in addrvec directly
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
a58fcf9e0f qa/suites/rados/basic/msgr: do not use msgr2 with simplemessenger
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
9a5aa423e0 qa/suites/rados/basic/msgr: async is not experimental
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
a56a7fb695 messages/MOSDBoot: fix compat with pre-nautilus
We can't make an addr -> addrvec transition without a compat encoding,
unfortunately (I screwed this one up back when then ADDR2 feature was
introduced).

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
d16f6e4654 mon/MonMap: allow v1 or v2 to be explicitly specified along with part
If there is a v1: or v2: prefix, that's the protocol/addr type.  Otherwise,
we assume msgr2.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
bdfbd857e2 msg/msg_types: allow parsing of IPs without assuming v1 vs v2
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
12416b77bd msg/msg_types: default parse to v2 addrs
If we parse "1.2.3.4", parse to v2:1.2.3.4:0/0, not a v1 legacy addr.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
f174bbead4 msg: standarize on v1: and v2: prefixes for *all* entity_addr_t's
This is more consistent than 1.2.3.4:0/0 being v1 and msgr2:1.2.3.4:0/0
being v2.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
15684843f0 vstart.sh: use msgr2 by default
This is useful because we tend to bind to random ports

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
399aba37fe mon/MonMap: remove get_addr() methods
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
a6e2cbde8f ceph-mon: adjust startup/bind/join sequence to use addrs
- Use the addrvecs in the monmap, and bind accordingly
- If we are joining the cluster, generate sane addrvec for ourselves
- Adjsut warning about mismatched ceph.conf.  Note that this may become
noisy for old clusters, mostly because the conf-based mon addr options
are ancient and crufty and should not be used.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
8e251c5827 mon: use MonMap::get_addrs() (instead of get_addr())
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
2f0b050fa2 mon/MonClient: change pending_cons to addrvec-based map
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
f926f13793 mon/MonMap: fix set_addr() caller, kill wrapper
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
ba21824296 mon/MonMap: remove addr-based add()
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
446ce2b0dc monmaptool: fix --add to do either legacy or msgr2+legacy
Base the decision on the monmap's required_features vs FEATURE_NAUTILIUS.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
a8cd2f7104 monmaptool: clean up iterator use a bit
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
ab896ec793 mon/MonMap: handle ambiguous mon addrs by trying both legacy and msgr
If we are given a mon addr (a raw IP or hostname) we don't know whether
it is a legacy or msgr2 entity_addr_t.  Either infer from the port number
or probe both protocol types.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
491b3e45c4 mon/MonMap: take addrvec for set_initial_members
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
3045133dda mon/MonMap: use addrvecs for test instances
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
611c1c126d mon: pass addrvec via MMonJoin
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
144cf68917 mon/MonmapMonitor: fix 'mon add' to populate addrvec
If a port is not specified (or the legacy port is specified), add both
the new IANA and legacy addrs to the map.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
b6a7079439 mon/MonMap: addr -> addrvec
Modify MonMap to store an addrvec instead of just an addr.

Add temporary helper/wrapper methods to avoid changing all of the callers
(yet).

No big semantic changes yet!

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:31:32 -06:00
Sage Weil
16a0bbb0aa msg/async/ProtocolV2: only update socket_addr if we learned our addr
Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:30:18 -06:00
Sage Weil
5709fb9122 osd: go active even if mon only accepted our v1 addr
We may bind to v1 and v2 addrs, but we need to behave if the mon only
recognized our v1 addr and still go active.  That's because whether they
see our v2 addr depends on whether we connected to the mon via the v1 or
v2 port, and the mon may not be binding to v2 (yet, or ever).

Add a legacy_equals to entity_addrvec_t, and use that instead of
probably_equals for the OSD boot checks.  The probably_equals returns true
if the IP address portion of the address is empty.. which should never
happen in the OSD boot case since we have learned our real IP long before
we try to send osd_boot.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:30:18 -06:00
Ricardo Dias
dd05584021 test/msgr: add test for msgr2 protocol
Signed-off-by: Ricardo Dias <rdias@suse.com>
2018-12-21 15:30:18 -06:00
Sage Weil
a1401bd3f7 msg/async/ProtocolV2: share socket_addr and all addrs during handshake
Also, drop the sloppy addr checks.. I'm not sure we need them?

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:30:18 -06:00
Sage Weil
3031a65cbb msg/async: print socket_addr for the connection
When we bind to multiple addrs, print the one the current connection is
using for the given connection.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:30:18 -06:00
Ricardo Dias
08d9f8aa08 msg/async: msgr2 protocol placeholder
This commit adds messenger V2 protocol. This V2 protocol is a clone of
the V1 protocol with the additional support for address vectors.
After the banner exchange the peers exchange their address vectors.

Signed-off-by: Ricardo Dias <rdias@suse.com>
2018-12-21 15:30:18 -06:00
Ricardo Dias
8ab05504f0 msg/async: move ProtocolV1 class to its own source file
Signed-off-by: Ricardo Dias <rdias@suse.com>
2018-12-21 15:30:18 -06:00
Sage Weil
3a52d3cf03 msg/async: keep listen addr in ServerSocket, pass to new connections
When we accept a connection, we want to know what listening addr we
accepted on.  Because the addr can change after we create teh listening socket
(when we learn the addr and fill in the IP portion), instead store the position
in our myaddrs addrvec.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:30:18 -06:00
Sage Weil
7ae4affef5 msg/async/AsyncMessenger: fix set_addr_unknowns
Fill in IP address from a v1 or v2 address into any v1 or v2 addresses.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-12-21 15:30:18 -06:00
Sage Weil
6e6159c899 Merge PR #25620 into master
* refs/pull/25620/head:
	os/bluestore: more robust handling for lack of per-pool stats cases.

Reviewed-by: Sage Weil <sage@redhat.com>
2018-12-21 10:12:42 -06:00