summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2011-03-01 21:20:34 -0500
committerdwight <dwight@10gen.com>2011-03-01 21:20:34 -0500
commit0fe9db187a513e6ac0419dae5f06e9625ba3a209 (patch)
tree3930ab6661942aacd5d245558e85b716b154e32e /db
parentdf7248a721a0c722e0eec2ae5e018299bd41b982 (diff)
downloadmongo-0fe9db187a513e6ac0419dae5f06e9625ba3a209.tar.gz
clarify confusing log line
Diffstat (limited to 'db')
-rw-r--r--db/dur_journal.cpp6
-rw-r--r--db/dur_journal.h7
-rw-r--r--db/dur_journalimpl.h2
-rw-r--r--db/instance.cpp3
4 files changed, 11 insertions, 7 deletions
diff --git a/db/dur_journal.cpp b/db/dur_journal.cpp
index d193c758260..a3a2a493192 100644
--- a/db/dur_journal.cpp
+++ b/db/dur_journal.cpp
@@ -190,10 +190,12 @@ namespace mongo {
/** at clean shutdown */
bool okToCleanUp = false; // successful recovery would set this to true
- void Journal::cleanup() {
+ void Journal::cleanup(bool _log) {
if( !okToCleanUp )
return;
+ if( _log )
+ log() << "journalCleanup..." << endl;
try {
scoped_lock lk(_curLogFileMutex);
closeCurrentJournalFile();
@@ -204,7 +206,7 @@ namespace mongo {
throw;
}
}
- void journalCleanup() { j.cleanup(); }
+ void journalCleanup(bool log) { j.cleanup(log); }
bool _preallocateIsFaster() {
bool faster = false;
diff --git a/db/dur_journal.h b/db/dur_journal.h
index 81957b55726..e8e3dfd1465 100644
--- a/db/dur_journal.h
+++ b/db/dur_journal.h
@@ -27,8 +27,11 @@ namespace mongo {
*/
extern bool okToCleanUp;
- /** at termination after db files closed & fsynced */
- void journalCleanup();
+ /** at termination after db files closed & fsynced
+ also after covery
+ @param log report in log that we are cleaning up if we actually do any work
+ */
+ void journalCleanup(bool log = false);
/** assure journal/ dir exists. throws */
void journalMakeDir();
diff --git a/db/dur_journalimpl.h b/db/dur_journalimpl.h
index 2b1f585186d..0648a534ea2 100644
--- a/db/dur_journalimpl.h
+++ b/db/dur_journalimpl.h
@@ -47,7 +47,7 @@ namespace mongo {
boost::filesystem::path getFilePathFor(int filenumber) const;
unsigned long long lastFlushTime() const { return _lastFlushTime; }
- void cleanup();
+ void cleanup(bool log);
// Rotate after reaching this data size in a journal (j._<n>) file
// We use a smaller size for 32 bit as the journal is mmapped during recovery (only)
diff --git a/db/instance.cpp b/db/instance.cpp
index 3b668ee5ae4..a4ca8cd49d4 100644
--- a/db/instance.cpp
+++ b/db/instance.cpp
@@ -763,8 +763,7 @@ namespace mongo {
rawOut( ss3.str() );
if( cmdLine.dur ) {
- log() << "shutdown: journalCleanup..." << endl;
- dur::journalCleanup();
+ dur::journalCleanup(true);
}
#if !defined(__sunos__)