mds: skip journaling blocklisted clients when in `replay` state
When a standby MDS is transitioning to active, it passes through
`replay` state. When the MDS is in this state, there are no journal
segments available for recording journal updates. If the MDS receives
an OSDMap update in this state, journaling blocklisted clients causes
a crash since no journal segments are available. This is a bit hard
to reproduce as it requires correct timing of an OSDMap update along
with various other factors.
Note that, when the MDS reaches `reconnect` state, it will journal
the blocklisted clients anyway.
This partially fixes tracker: https://tracker.ceph.com/issues/51589
which mentions a similar crash but in `reconnect` state. However,
that crash was seen in nautilus.
A couple of minor changes include removing hardcoded function names
and carving out reusable parts into a separate function.
Partially-fixes: https://tracker.ceph.com/issues/51589
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit
6d6236dc8d15636af8060057e6e69c26c473f987)