From: Yan, Zheng Date: Mon, 31 Mar 2014 01:46:58 +0000 (+0800) Subject: mds: don't start new segment while finishing disambiguate imports X-Git-Tag: v0.79~27^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b65a818407b3c3ae01b550f8849097702c2d2bc3;p=ceph.git mds: don't start new segment while finishing disambiguate imports 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 --- diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index a71eb025622..991eaf5d2b9 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -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;