From e5c1b87bd88b54b7650ef9cf11ad4e9d74f358f7 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 24 Apr 2017 10:41:10 +0800 Subject: [PATCH] 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" --- src/mds/SessionMap.cc | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- 2.47.3