mon/Elector: Added sanity check for peer & ranks size
Check if ``peer >= ranks_size``, then we
remove the current peer from ``live_pinging`` sets,
incase the peer was already removed out of the quorum
but for some reason the Elector code didn't
get to update ``live_pinging`` and ``dead_pinging`` sets
in time with when ranks.size() of monmap is changed.
This is to prevent going into assertion error later at
MonMap.h:get_addrs().
Fixes: https://tracker.ceph.com/issues/50089
Signed-off-by: Kamoltat <ksirivad@redhat.com>
(cherry picked from commit
fd8c9cf29e4f5f72b8723a999a69d6ca406e104b)