diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2014-06-25 09:52:54 +0200 |
---|---|---|
committer | Yan, Zheng <zheng.z.yan@intel.com> | 2014-06-27 09:45:56 +0200 |
commit | 1f3fbc906261b837d144dd51b599757f14216c1b (patch) | |
tree | 0b5e7879506f02364e40e8739a625d1a8f437552 /src/mds | |
parent | mds: introduce sequence number for log events (diff) | |
download | ceph-1f3fbc906261b837d144dd51b599757f14216c1b.tar.xz ceph-1f3fbc906261b837d144dd51b599757f14216c1b.zip |
mds: print sequence number of log segment
Diffstat (limited to 'src/mds')
-rw-r--r-- | src/mds/MDCache.cc | 6 | ||||
-rw-r--r-- | src/mds/MDLog.cc | 29 | ||||
-rw-r--r-- | src/mds/journal.cc | 6 |
3 files changed, 25 insertions, 16 deletions
diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 80cfd8958ff..3aa825af0cf 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6143,14 +6143,16 @@ void MDCache::truncate_inode_logged(CInode *in, MutationRef& mut) void MDCache::add_recovered_truncate(CInode *in, LogSegment *ls) { - dout(20) << "add_recovered_truncate " << *in << " in " << ls << " offset " << ls->offset << dendl; + dout(20) << "add_recovered_truncate " << *in << " in log segment " + << ls->seq << "/" << ls->offset << dendl; ls->truncating_inodes.insert(in); in->get(CInode::PIN_TRUNCATING); } void MDCache::remove_recovered_truncate(CInode *in, LogSegment *ls) { - dout(20) << "remove_recovered_truncate " << *in << " in " << ls << " offset " << ls->offset << dendl; + dout(20) << "remove_recovered_truncate " << *in << " in log segment " + << ls->seq << "/" << ls->offset << dendl; // if we have the logseg the truncate started in, it must be in our list. set<CInode*>::iterator p = ls->truncating_inodes.find(in); assert(p != ls->truncating_inodes.end()); diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index 1a7d3c99def..f98317a277c 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -370,14 +370,16 @@ void MDLog::trim(int m) ++p; if (ls->end > journaler->get_write_safe_pos()) { - dout(5) << "trim segment " << ls->offset << ", not fully flushed yet, safe " + dout(5) << "trim segment " << ls->seq << "/" << ls->offset << ", not fully flushed yet, safe " << journaler->get_write_safe_pos() << " < end " << ls->end << dendl; break; } if (expiring_segments.count(ls)) { - dout(5) << "trim already expiring segment " << ls->offset << ", " << ls->num_events << " events" << dendl; + dout(5) << "trim already expiring segment " << ls->seq << "/" << ls->offset + << ", " << ls->num_events << " events" << dendl; } else if (expired_segments.count(ls)) { - dout(5) << "trim already expired segment " << ls->offset << ", " << ls->num_events << " events" << dendl; + dout(5) << "trim already expired segment " << ls->seq << "/" << ls->offset + << ", " << ls->num_events << " events" << dendl; } else { try_expire(ls, op_prio); } @@ -396,11 +398,11 @@ void MDLog::try_expire(LogSegment *ls, int op_prio) assert(expiring_segments.count(ls) == 0); expiring_segments.insert(ls); expiring_events += ls->num_events; - dout(5) << "try_expire expiring segment " << ls->offset << dendl; + dout(5) << "try_expire expiring segment " << ls->seq << "/" << ls->offset << dendl; gather_bld.set_finisher(new C_MaybeExpiredSegment(this, ls, op_prio)); gather_bld.activate(); } else { - dout(10) << "try_expire expired segment " << ls->offset << dendl; + dout(10) << "try_expire expired segment " << ls->seq << "/" << ls->offset << dendl; _expired(ls); } @@ -410,7 +412,8 @@ void MDLog::try_expire(LogSegment *ls, int op_prio) void MDLog::_maybe_expired(LogSegment *ls, int op_prio) { - dout(10) << "_maybe_expired segment " << ls->offset << " " << ls->num_events << " events" << dendl; + dout(10) << "_maybe_expired segment " << ls->seq << "/" << ls->offset + << ", " << ls->num_events << " events" << dendl; assert(expiring_segments.count(ls)); expiring_segments.erase(ls); expiring_events -= ls->num_events; @@ -424,11 +427,13 @@ void MDLog::_trim_expired_segments() while (!segments.empty()) { LogSegment *ls = segments.begin()->second; if (!expired_segments.count(ls)) { - dout(10) << "_trim_expired_segments waiting for " << ls->offset << " to expire" << dendl; + dout(10) << "_trim_expired_segments waiting for " << ls->seq << "/" << ls->offset + << " to expire" << dendl; break; } - dout(10) << "_trim_expired_segments trimming expired " << ls->offset << dendl; + dout(10) << "_trim_expired_segments trimming expired " + << ls->seq << "/" << ls->offset << dendl; expired_events -= ls->num_events; expired_segments.erase(ls); num_events -= ls->num_events; @@ -452,10 +457,12 @@ void MDLog::_trim_expired_segments() void MDLog::_expired(LogSegment *ls) { - dout(5) << "_expired segment " << ls->offset << " " << ls->num_events << " events" << dendl; + dout(5) << "_expired segment " << ls->seq << "/" << ls->offset + << ", " << ls->num_events << " events" << dendl; if (!capped && ls == peek_current_segment()) { - dout(5) << "_expired not expiring " << ls->offset << ", last one and !capped" << dendl; + dout(5) << "_expired not expiring " << ls->seq << "/" << ls->offset + << ", last one and !capped" << dendl; } else { // expired. expired_segments.insert(ls); @@ -906,7 +913,7 @@ void MDLog::standby_trim_segments() LogSegment *seg = get_oldest_segment(); if (seg->end > expire_pos) break; - dout(10) << " removing segment " << seg->offset << dendl; + dout(10) << " removing segment " << seg->seq << "/" << seg->offset << dendl; seg->dirty_dirfrags.clear_list(); seg->new_dirfrags.clear_list(); seg->dirty_inodes.clear_list(); diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 1db55d11e6a..616e9ffa003 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -67,7 +67,7 @@ void LogSegment::try_to_expire(MDS *mds, C_GatherBuilder &gather_bld, int op_pri { set<CDir*> commit; - dout(6) << "LogSegment(" << offset << ").try_to_expire" << dendl; + dout(6) << "LogSegment(" << seq << "/" << offset << ").try_to_expire" << dendl; assert(g_conf->mds_kill_journal_expire_at != 1); @@ -275,11 +275,11 @@ void LogSegment::try_to_expire(MDS *mds, C_GatherBuilder &gather_bld, int op_pri } if (gather_bld.has_subs()) { - dout(6) << "LogSegment(" << offset << ").try_to_expire waiting" << dendl; + dout(6) << "LogSegment(" << seq << "/" << offset << ").try_to_expire waiting" << dendl; mds->mdlog->flush(); } else { assert(g_conf->mds_kill_journal_expire_at != 5); - dout(6) << "LogSegment(" << offset << ").try_to_expire success" << dendl; + dout(6) << "LogSegment(" << seq << "/" << offset << ").try_to_expire success" << dendl; } } |