If we donn't flush mds log before requesting STATE_ACTIVE, and
mds happens to stop later before the log reaches journal.
The take-over mds will have no SubtreeMap to replay, and fail
later at non-empty subtree check.
Fixes: https://tracker.ceph.com/issues/65094
Signed-off-by: ethanwu <ethanwu@synology.com>
} else {
dout(2) << "Booting: " << step << ": positioning at end of old mds log" << dendl;
mdlog->append();
- starting_done();
+ auto sle = mdcache->create_subtree_map();
+ mdlog->submit_entry(sle);
+ mdlog->flush();
+ mdlog->wait_for_safe(new C_MDS_VoidFn(this, &MDSRank::starting_done));
}
break;
case MDS_BOOT_REPLAY_DONE:
ceph_assert(is_starting());
request_state(MDSMap::STATE_ACTIVE);
- auto sle = mdcache->create_subtree_map();
- mdlog->submit_entry(sle);
-
// sync snaptable cache
snapclient->sync(new C_MDSInternalNoop);
}