diff options
-rw-r--r-- | db/dur_journal.cpp | 9 | ||||
-rwxr-xr-x | jstests/dur/a_quick.js | 13 |
2 files changed, 17 insertions, 5 deletions
diff --git a/db/dur_journal.cpp b/db/dur_journal.cpp index cb3ecd43d26..129eeb623b2 100644 --- a/db/dur_journal.cpp +++ b/db/dur_journal.cpp @@ -126,6 +126,7 @@ namespace mongo { /** throws */ void removeJournalFiles() { + log() << "removeJournalFiles" << endl; try { for ( boost::filesystem::directory_iterator i( getJournalDir() ); i != boost::filesystem::directory_iterator(); @@ -140,12 +141,18 @@ namespace mongo { } } } - boost::filesystem::remove(lsnPath()); + try { + boost::filesystem::remove(lsnPath()); + } + catch(...) { + log() << "couldn't remove " << lsnPath().string() << endl; + } } catch( std::exception& e ) { log() << "error removing journal files " << e.what() << endl; throw; } + log() << "removeJournalFiles end" << endl; // temp } /** at clean shutdown */ diff --git a/jstests/dur/a_quick.js b/jstests/dur/a_quick.js index 72dc3a8339a..2c817e2cf90 100755 --- a/jstests/dur/a_quick.js +++ b/jstests/dur/a_quick.js @@ -4,7 +4,7 @@ other tests can be slow */
-print("quick.js"); +print("a_quick.js"); // directories var path1 = "/data/db/quicknodur"; @@ -40,7 +40,7 @@ d.getLastError(); // wait // we could actually do getlasterror fsync:1 now, but maybe this is agood
// as it will assure that commits happen on a timely basis. a bunch of the other dur/*js // tests use fsync -log("sleep a bit for a gruop commit"); +log("sleep a bit for a group commit"); sleep(500);
// kill the process hard
@@ -84,8 +84,13 @@ if (jfiles.length) { print("sleeping more waiting for mongod to stop");
sleep(10000);
jfiles = listFiles(path2 + "/journal");
- printjson(jfiles);
- assert(jfiles.length == 0, "journal dir not empty");
+
+ if (jfiles.length) {
+ print("ERROR journal dir " + path2 + "/journal is not empty:");
+ printjson(jfiles);
+ print("\n\n");
+ assert(jfiles.length == 0, "journal dir not empty");
+ }
} log("check data matches"); |