summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSusan LoVerso <sue@mongodb.com>2017-05-22 12:18:16 -0400
committerbvpvamsikrishna <vamsi.krishna@mongodb.com>2017-09-13 21:01:40 -0400
commit0777ec8c479ddab77bd7522a3691b196afda707b (patch)
treec445fa7e45f38d042ecaf6a2336dcb5a05ee89c8 /src
parentb2938fa104f49b14cbf4f202d696fd9e1766fed7 (diff)
downloadmongo-0777ec8c479ddab77bd7522a3691b196afda707b.tar.gz
SERVER-28637 Remove journal files if journaling is toggled off.
(cherry picked from commit 7d5b12eac722a0f3a564e0c7f778e525f06b6bf7)
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index f48fff37b0b..84c51cd197f 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -253,6 +253,13 @@ WiredTigerKVEngine::WiredTigerKVEngine(const std::string& canonicalName,
msgassertedNoTrace(28718, s.reason());
}
invariantWTOK(_conn->close(_conn, NULL));
+ // After successful recovery, remove the journal directory.
+ try {
+ boost::filesystem::remove_all(journalPath);
+ } catch (std::exception& e) {
+ error() << "error removing journal dir " << journalPath.string() << ' ' << e.what();
+ throw;
+ }
}
// This setting overrides the earlier setting because it is later in the config string.
ss << ",log=(enabled=false),";