]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: remove session from null_sessions list when marking session dirty
authorYan, Zheng <zyan@redhat.com>
Mon, 24 Apr 2017 02:41:10 +0000 (10:41 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 11 May 2017 06:13:24 +0000 (14:13 +0800)
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" <zyan@redhat.com>
src/mds/SessionMap.cc

index a1ba0db4d80b7037247bad0e66fdf62726a6a40b..561f2db9e8dc5fe8e0eaf321f7c8a6c493d2f2af 100644 (file)
@@ -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);
 }