diff options
author | Mathias Stearn <mathias@10gen.com> | 2011-01-12 15:54:31 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2011-01-12 16:16:25 -0500 |
commit | b4094b20bb0668800ee456f7b6198d0822343f1a (patch) | |
tree | 89c954918d5c8b3161047359ddd408d2de5f3a24 /db/dur.cpp | |
parent | 1bc1c3cc3ab111d7177c426b1757221c36171fc0 (diff) | |
download | mongo-b4094b20bb0668800ee456f7b6198d0822343f1a.tar.gz |
get rid of TempDisableDurability and replace with syncDataAndTruncateJournal
Diffstat (limited to 'db/dur.cpp')
-rw-r--r-- | db/dur.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/db/dur.cpp b/db/dur.cpp index 50d3c8ae093..05401225e7f 100644 --- a/db/dur.cpp +++ b/db/dur.cpp @@ -588,27 +588,14 @@ namespace mongo { boost::thread t(durThread); } - TempDisableDurability::TempDisableDurability() : _wasDur(cmdLine.dur), _lock(durThreadMutex) { + void DurableImpl::syncDataAndTruncateJournal() { dbMutex.assertWriteLocked(); - if (_wasDur) { - groupCommit(); - - DurableInterface::disableDurability(); - cmdLine.dur = false; - //SyncAndTruncate; - MongoFile::flushAll(true); - journalCleanup(); - } - } + groupCommit(); + MongoFile::flushAll(true); + journalCleanup(); - TempDisableDurability::~TempDisableDurability() { - dbMutex.assertWriteLocked(); - if (_wasDur) { - assert(!haveJournalFiles()); - cmdLine.dur = true; - DurableInterface::enableDurability(); - } + assert(!haveJournalFiles()); // Double check post-conditions } } // namespace dur |