summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/rs_initialsync.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/rs_initialsync.cpp')
-rw-r--r--src/mongo/db/repl/rs_initialsync.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/repl/rs_initialsync.cpp b/src/mongo/db/repl/rs_initialsync.cpp
index 86d42d3b7a0..76c39c88d9a 100644
--- a/src/mongo/db/repl/rs_initialsync.cpp
+++ b/src/mongo/db/repl/rs_initialsync.cpp
@@ -42,6 +42,7 @@
#include "mongo/bson/optime.h"
#include "mongo/db/repl/repl_settings.h" // replSettings
#include "mongo/db/repl/initial_sync.h"
+#include "mongo/db/storage/mmap_v1/dur_transaction.h"
#include "mongo/db/structure/catalog/namespace_details.h"
#include "mongo/util/mongoutils/str.h"
@@ -127,6 +128,7 @@ namespace mongo {
static void emptyOplog() {
Client::WriteContext ctx(rsoplog);
+ DurTransaction txn;
Collection* collection = ctx.ctx().db()->getCollection(rsoplog);
// temp
@@ -134,7 +136,7 @@ namespace mongo {
return; // already empty, ok.
LOG(1) << "replSet empty oplog" << rsLog;
- uassertStatusOK( collection->truncate() );
+ uassertStatusOK( collection->truncate(&txn) );
}
const Member* ReplSetImpl::getMemberToSyncTo() {