From b6af38f40357d1ffd63a26779d15dcfa1604eb97 Mon Sep 17 00:00:00 2001 From: sageweil Date: Tue, 28 Aug 2007 18:40:07 +0000 Subject: [PATCH] logger fixup git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1713 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/common/Logger.cc | 7 ++++--- trunk/ceph/common/Logger.h | 4 ++-- trunk/ceph/mds/MDLog.cc | 6 ------ trunk/ceph/mds/MDLog.h | 2 -- trunk/ceph/mds/MDS.cc | 5 ----- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/trunk/ceph/common/Logger.cc b/trunk/ceph/common/Logger.cc index 591f4ce9cc94b..509f1d39ee668 100644 --- a/trunk/ceph/common/Logger.cc +++ b/trunk/ceph/common/Logger.cc @@ -65,12 +65,12 @@ static void flush_all_loggers() // do any catching up we need to while (now_sec - last_flush >= g_conf.log_interval) { - last_flush += g_conf.log_interval; generic_dout(20) << "fromstart " << fromstart << " last_flush " << last_flush << " flushign" << dendl; for (list::iterator p = logger_list.begin(); p != logger_list.end(); ++p) (*p)->_flush(); + last_flush += g_conf.log_interval; } // schedule next flush event @@ -113,7 +113,6 @@ Logger::Logger(string fn, LogType *type) this->type = type; wrote_header = -1; - last_logged = 0; wrote_header_last = 0; version = 0; @@ -151,12 +150,14 @@ void Logger::set_start(utime_t s) start = s; } +/* void Logger::flush() { logger_lock.Lock(); _flush(); logger_lock.Unlock(); } +*/ void Logger::_flush() { @@ -175,7 +176,7 @@ void Logger::_flush() maybe_resize(type->keys.size()); // write line to log - out << last_logged; + out << last_flush; for (unsigned i=0; ikeys.size(); i++) { if (fvals[i] > 0 && vals[i] == 0) out << "\t" << fvals[i]; diff --git a/trunk/ceph/common/Logger.h b/trunk/ceph/common/Logger.h index 9ec8f72d1daaf..7c97344b50725 100644 --- a/trunk/ceph/common/Logger.h +++ b/trunk/ceph/common/Logger.h @@ -50,7 +50,7 @@ class Logger { ofstream out; // what i've written - int last_logged; + //int last_logged; int wrote_header; int wrote_header_last; @@ -65,7 +65,7 @@ class Logger { double fset(const char *s, double v); double finc(const char *s, double v); - void flush(); + //void flush(); void _flush(); void set_start(utime_t s); diff --git a/trunk/ceph/mds/MDLog.cc b/trunk/ceph/mds/MDLog.cc index 0f262fe838fe9..97c002d12dd4f 100644 --- a/trunk/ceph/mds/MDLog.cc +++ b/trunk/ceph/mds/MDLog.cc @@ -74,12 +74,6 @@ void MDLog::init_journaler() journaler = new Journaler(log_inode, mds->objecter, logger); } -void MDLog::flush_logger() -{ - if (logger) - logger->flush(); -} - void MDLog::reset() diff --git a/trunk/ceph/mds/MDLog.h b/trunk/ceph/mds/MDLog.h index 75464df26e304..d3cfbf11461b5 100644 --- a/trunk/ceph/mds/MDLog.h +++ b/trunk/ceph/mds/MDLog.h @@ -133,8 +133,6 @@ class MDLog { ~MDLog(); - void flush_logger(); - void set_max_events(size_t max) { max_events = max; } size_t get_max_events() { return max_events; } size_t get_num_events() { return num_events + trimming.size(); } diff --git a/trunk/ceph/mds/MDS.cc b/trunk/ceph/mds/MDS.cc index 68247cabe6244..6dc34cf8dce0a 100644 --- a/trunk/ceph/mds/MDS.cc +++ b/trunk/ceph/mds/MDS.cc @@ -1011,11 +1011,6 @@ void MDS::suicide() { dout(1) << "suicide" << dendl; - // flush loggers - if (logger) logger->flush(); - if (logger2) logger2->flush(); - mdlog->flush_logger(); - // stop timers if (beacon_killer) { timer.cancel_event(beacon_killer); -- 2.39.5