Skip to content

Commit

Permalink
TempDisableDurability now does SyncAndTruncate
Browse files Browse the repository at this point in the history
  • Loading branch information
RedBeard0531 committed Jan 10, 2011
1 parent 3625433 commit a593ed7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions db/dur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,12 +593,17 @@ namespace mongo {
if (_wasDur) {
DurableInterface::disableDurability();
cmdLine.dur = false;

//SyncAndTruncate;
MongoFile::flushAll(true);
journalCleanup();
}
}

TempDisableDurability::~TempDisableDurability() {
dbMutex.assertWriteLocked();
if (_wasDur) {
assert(!haveJournalFiles());
cmdLine.dur = true;
DurableInterface::enableDurability();
}
Expand Down
2 changes: 1 addition & 1 deletion db/dur.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace mongo {

class TempDisableDurability : boost::noncopyable {
public:
TempDisableDurability(); // disables durability iff it is enabled
TempDisableDurability(); // disables durability and SyncAndTruncate iff it is enabled
~TempDisableDurability(); // enables durability iff constructor disabled it
private:
const bool _wasDur;
Expand Down

0 comments on commit a593ed7

Please sign in to comment.