diff options
author | Kamoltat <ksirivad@redhat.com> | 2022-12-05 19:46:11 +0100 |
---|---|---|
committer | Kamoltat <ksirivad@redhat.com> | 2022-12-15 23:11:15 +0100 |
commit | f4bda36a60223d36e2ca6ef29d81d98ff72ec3f6 (patch) | |
tree | 09ac3fa69ce21af8729edd65518ddfe5e6a5eba4 /src/mon/Elector.h | |
parent | Merge pull request #48991 from kamoltat/wip-ksirivad-fix-bz-2121452 (diff) | |
download | ceph-f4bda36a60223d36e2ca6ef29d81d98ff72ec3f6.tar.xz ceph-f4bda36a60223d36e2ca6ef29d81d98ff72ec3f6.zip |
mon/Elector.cc: Compress peer >= rank_size sanity check into send_peer_ping
Problem:
Currently, https://github.com/ceph/ceph/pull/44993
failed to completely fix:
https://tracker.ceph.com/issues/50089
There are certain code paths such as
Elector::handle_ping → Elector::begin_peer_ping →
Elector::send_peer_ping.
that when a monitor is removed before shutdown in
Cephadm it can hit the assert failure.
Solution:
Therefore, we have to enforce sanity checks on
all code paths.
We do this by compressing the `peer >= rank_size`
sanity check into `send_peer_ping`. We also make
`send_peer_ping` return true/false
caller of `send_peer_ping` would drop itself if
recieves a `false`.
Fixes: https://tracker.ceph.com/issues/58155
Signed-off-by: Kamoltat <ksirivad@redhat.com>
Diffstat (limited to 'src/mon/Elector.h')
-rw-r--r-- | src/mon/Elector.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mon/Elector.h b/src/mon/Elector.h index be5eee5d4da..be2f91c0f93 100644 --- a/src/mon/Elector.h +++ b/src/mon/Elector.h @@ -188,7 +188,7 @@ class Elector : public ElectionOwner, RankProvider { * Send a ping to the specified peer. * @n optional time that we will use instead of calling ceph_clock_now() */ - void send_peer_ping(int peer, const utime_t *n=NULL); + bool send_peer_ping(int peer, const utime_t *n=NULL); /** * Check the state of pinging the specified peer. This is our * "tick" for heartbeating; scheduled by itself and begin_peer_ping(). |