summaryrefslogtreecommitdiff
path: root/src/mongo/db/pdfile.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2014-04-30 18:08:51 -0400
committerMathias Stearn <mathias@10gen.com>2014-05-01 12:36:50 -0400
commite3a0652d1e34b72a08315bc4a8a713bee07ea7a0 (patch)
treebeff0b9df7dc994b5afe8f5942d1e86d20e4f93d /src/mongo/db/pdfile.cpp
parent4ac7bff98e0c6ffea094afa4155e83e4ce375fd2 (diff)
downloadmongo-e3a0652d1e34b72a08315bc4a8a713bee07ea7a0.tar.gz
SERVER-13643 Use TransactionExperiment in dropDatabase()
Diffstat (limited to 'src/mongo/db/pdfile.cpp')
-rw-r--r--src/mongo/db/pdfile.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/db/pdfile.cpp b/src/mongo/db/pdfile.cpp
index 758ca40957a..45f3d6c2bb6 100644
--- a/src/mongo/db/pdfile.cpp
+++ b/src/mongo/db/pdfile.cpp
@@ -79,6 +79,7 @@ _ disallow system* manipulations from the database.
#include "mongo/util/processinfo.h"
#include "mongo/db/stats/timer_stats.h"
#include "mongo/db/stats/counters.h"
+#include "mongo/db/storage/mmap_v1/dur_transaction.h"
namespace mongo {
@@ -141,6 +142,7 @@ namespace mongo {
void dropAllDatabasesExceptLocal() {
Lock::GlobalWrite lk;
+ DurTransaction txn;
vector<string> n;
getDatabaseNames(n);
@@ -149,12 +151,12 @@ namespace mongo {
for( vector<string>::iterator i = n.begin(); i != n.end(); i++ ) {
if( *i != "local" ) {
Client::Context ctx(*i);
- dropDatabase(ctx.db());
+ dropDatabase(&txn, ctx.db());
}
}
}
- void dropDatabase(Database* db ) {
+ void dropDatabase(TransactionExperiment* txn, Database* db ) {
invariant( db );
string name = db->name(); // just to have safe
@@ -173,7 +175,7 @@ namespace mongo {
//
// RWLockRecursive::Exclusive lk(MongoFile::mmmutex);
- getDur().syncDataAndTruncateJournal();
+ txn->syncDataAndTruncateJournal();
Database::closeDatabase( name, db->path() );
db = 0; // d is now deleted