]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't start new segment while finishing disambiguate imports
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 31 Mar 2014 01:46:58 +0000 (09:46 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Wed, 2 Apr 2014 03:03:10 +0000 (11:03 +0800)
This avoid inserting ESubtreeMap among EImportFinish events that
finish disambiguate imports. Because the ESubtreeMap reflects the
subtree state when all EImportFinish events are replayed.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/MDLog.cc

index a71eb025622eeb8bf256a021d84e521220967843..991eaf5d2b90944a0ccd946da0c37c9261ed786b 100644 (file)
@@ -219,8 +219,12 @@ void MDLog::submit_entry(LogEvent *le, Context *c)
   uint64_t last_seg = get_last_segment_offset();
   uint64_t period = journaler->get_layout_period();
   // start a new segment if there are none or if we reach end of last segment
-  if (le->get_type() == EVENT_SUBTREEMAP) {
-    // avoid infinite loop
+  if (le->get_type() == EVENT_SUBTREEMAP ||
+      (le->get_type() == EVENT_IMPORTFINISH && mds->is_resolve())) {
+    // avoid infinite loop when ESubtreeMap is very large.
+    // don not insert ESubtreeMap among EImportFinish events that finish
+    // disambiguate imports. Because the ESubtreeMap reflects the subtree
+    // state when all EImportFinish events are replayed.
   } else if (journaler->get_write_pos()/period != last_seg/period) {
     dout(10) << "submit_entry also starting new segment: last = " << last_seg
             << ", cur pos = " << journaler->get_write_pos() << dendl;