]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mon: change how we handle removed_ranks
authorKamoltat <ksirivad@redhat.com>
Wed, 2 Nov 2022 01:59:52 +0000 (01:59 +0000)
committerKamoltat <ksirivad@redhat.com>
Mon, 26 Dec 2022 05:13:20 +0000 (05:13 +0000)
commitb90f2cdb270165332965d88f991a8b5283ef83d1
treee13d3cad2b1022130dee2c49cc0203421ea488d1
parent7572521a02f3cfe31b407d5bb0c599cb65f74908
mon: change how we handle removed_ranks

when a new monitor joins, there is a chance that
it will recive a monmap that recently removed
a monitor and ``removed_rank`` will have some
content in it. A new monitor that joins
should never remove rank in peer_tracker but
rather call ``notify_clear_peer_state()``
to reset the `peer_report`.

In the case when it is a monitor that
has joined quorum before and is only 1
epoch behind the newest monmap provided
by the probe_replied monitor. We can
actually remove and adjust ranks in `peer_report`
since we are sure that if there is any content in
removed_ranks, then it has to be because in the
next epoch we are removing a rank, since every
update of an epoch we always clear the removed_ranks.

There is no point in keeping the content
of ``removed_ranks`` after monmap gets updated
to the epoch.

Therefore, clear ``removed_ranks`` every update.

When there is discontinuity between
monmaps for more 1 epoch or the new monitor never joined quorum before,
we always reset `peer_tracker`.

Moreover, beneficial for monitor log to also log
which rank has been removed at the current time
of the monmap. So add removed_ranks to `print_summary`
and `dump` in MonMap.cc.

Fixes: https://tracker.ceph.com/issues/58049
Signed-off-by: Kamoltat <ksirivad@redhat.com>
(cherry picked from commit 04402576fecf1cb97f515b5dc42261a77837e400)

Conflicts:
src/mon/Monitor.cc - trivial fix
src/mon/MonMap.cc
src/mon/Monitor.cc
src/mon/Monitor.h
src/mon/MonmapMonitor.cc