]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon, msgr: rework the public addrs support
authorRadosław Zarzyński <rzarzyns@redhat.com>
Mon, 30 Jan 2023 17:28:00 +0000 (18:28 +0100)
committerRadosław Zarzyński <rzarzyns@redhat.com>
Mon, 20 Feb 2023 12:28:58 +0000 (13:28 +0100)
commit69b47c805fdd2ecd4f58547d58c9f019fc62d447
treefb548c176f0387a205599b057e4f8489ac917e1f
parent2757ede2d6021c291b1c5f2bd2c6c0da5374d5a5
mon, msgr: rework the public addrs support

A monitor does support two kinds of addresses when binding msgr:
  1) `bind_addrs` which are basically passed down the stack to
     e.g. the `bind()` syscall -- they are physical, low-level ones;
  2) `public_addrs` which are exposed to peers over Ceph's on-wire
protocols.

This differentation is crucial for Rook and K8S use scenarios
where, due to ephemeral nature of node's physical IPs, virtual
_cluster IPs_ must be used instead for mon accesses.
Although monitors still bind to physical ones, virtuals are exposed.
Then, thankfully to NAT, the latter are converted to the former ones.

Unfortunately, the current implmentation of this feature is based
on the idea to 1) bind-as-usually and then 2) change-the-addrs
via powerful `set_addrs()` setter. This setter is too powerful
but the main issue is the `rebind()` sceario. It doesn't happen
in monitors but OSDs may rebind when they get marked down by
a monitor.

Fixes: https://tracker.ceph.com/issues/58779
Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
(cherry picked from commit 1b24588dc8e03adaff472a94f594f2851b4acec4)
src/ceph_mon.cc
src/msg/Messenger.cc
src/msg/Messenger.h
src/msg/async/AsyncMessenger.cc
src/msg/async/AsyncMessenger.h