mds/FSMap: go back to STARTING state when rank doesn't make it pass STARTING
Just like STATE_CREATING, mds could fail or being stopped any where at
STATE_STARTING state, so make sure subsequent take-over mds will start
from STATE_STARTING. Otherwise, we'll end up with empty journal(No ESubtreeMap).
The subsequent take-over mds will fail with no subtrees found and rank will be
marked damaged.
Quick way to reproduce this:
./bin/ceph fs set a down true # take down all rank in filesystem a
#wait for fs to stop all rank
./bin/ceph fs set a down true; pidof ceph-mds | xargs kill
# quickly kill all mds soon after they enter starting state
./bin/ceph-mds -i a -c ./ceph.conf
# start all mds. Then we'll find out that mds rank is reported damaged with following log
-1 log_channel(cluster) log [ERR] : No subtrees found for root MDS rank!
5 mds.beacon.a set_want_state: up:rejoin -> down:damaged
Fixes: https://tracker.ceph.com/issues/65094
Signed-off-by: ethanwu <ethanwu@synology.com>
(cherry picked from commit
767494d68c8c3130097f3cf794aadccc5bd98806)