From: Yan, Zheng Date: Mon, 24 Apr 2017 02:41:10 +0000 (+0800) Subject: mds: remove session from null_sessions list when marking session dirty X-Git-Tag: v12.1.0~10^2~28^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e5c1b87bd88b54b7650ef9cf11ad4e9d74f358f7;p=ceph.git mds: remove session from null_sessions list when marking session dirty When saving sessionmap, null_sessions is processed after the dirty_sessions. The dirty session gets deleted from omap if it's still in null_sessions. Signed-off-by: "Yan, Zheng" --- diff --git a/src/mds/SessionMap.cc b/src/mds/SessionMap.cc index a1ba0db4d80b..561f2db9e8dc 100644 --- a/src/mds/SessionMap.cc +++ b/src/mds/SessionMap.cc @@ -628,6 +628,9 @@ void SessionMap::touch_session(Session *session) void SessionMap::_mark_dirty(Session *s) { + if (dirty_sessions.count(s->info.inst.name)) + return; + if (dirty_sessions.size() >= g_conf->mds_sessionmap_keys_per_op) { // Pre-empt the usual save() call from journal segment trim, in // order to avoid building up an oversized OMAP update operation @@ -635,6 +638,7 @@ void SessionMap::_mark_dirty(Session *s) save(new C_MDSInternalNoop, version); } + null_sessions.erase(s->info.inst.name); dirty_sessions.insert(s->info.inst.name); }