mds: make sure snaptable version > 0

version 0 snaptable confuses snapshot cache code

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
This commit is contained in:
Yan, Zheng 2018-03-28 17:54:48 +08:00
parent 388922ac35
commit 002c732dc3

View File

@ -1322,6 +1322,13 @@ void MDSRank::replay_done()
mdlog->get_journaler()->set_writeable();
mdlog->get_journaler()->trim_tail();
if (snapserver->get_version() == 0) {
// upgraded from old filesystem. version 0 snaptable confuses current code.
dout(1) << "upgrading snaptable version from 0 to 1" << dendl;
snapserver->reset();
sessionmap.save(new C_MDSInternalNoop);
}
if (g_conf->mds_wipe_sessions) {
dout(1) << "wiping out client sessions" << dendl;
sessionmap.wipe();