]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: don't send stale hb msgr's addresses in MOSDBoot 56520/head
authorRadosław Zarzyński <rzarzyns@redhat.com>
Tue, 7 Mar 2023 12:30:11 +0000 (13:30 +0100)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Tue, 1 Jul 2025 05:30:14 +0000 (12:30 +0700)
commitfa6bdea4ed55afcfe0d994ef196cce65ec4fb10a
treecb864a2a5bad323ea01fb623c4b65e351ad022a6
parente0ff344ec8f30cb2d88997756687f514ceb1c960
osd: don't send stale hb msgr's addresses in MOSDBoot

See comments in the ticket for the RCA.

NOTE: we can't just hold a reference to what `get_myaddrs()`
returns as the `safe_item_history` is involved:

```cpp
template<class T>
class safe_item_history {
  //...
  T *current = nullptr;

  // ...
  const T& operator=(const T& other) {
    std::lock_guard l(lock);
    history.push_back(other);
    current = &history.back();
    return *current;
  }
```

Fixes: https://tracker.ceph.com/issues/58915
Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
(cherry picked from commit 81944f60478abe2d4253caaeb4165da5ccffaca1)
src/osd/OSD.cc