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.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/db/repl/rs_initialsync.cpp b/src/mongo/db/repl/rs_initialsync.cpp
index 32d03e31902..7c882dbe3c4 100644
--- a/src/mongo/db/repl/rs_initialsync.cpp
+++ b/src/mongo/db/repl/rs_initialsync.cpp
@@ -144,8 +144,7 @@ bool _initialSyncClone(OperationContext* opCtx,
options.createCollections = false;
// Make database stable
- ScopedTransaction transaction(opCtx, MODE_IX);
- Lock::DBLock dbWrite(opCtx->lockState(), db, MODE_X);
+ Lock::DBLock dbWrite(opCtx, db, MODE_X);
Status status = cloner.copyDb(opCtx, db, host, options, nullptr, collections);
if (!status.isOK()) {
@@ -360,8 +359,7 @@ Status _initialSync(OperationContext* opCtx, BackgroundSync* bgsync) {
createCollectionParams.push_back(params);
}
- ScopedTransaction transaction(opCtx, MODE_IX);
- Lock::DBLock dbWrite(opCtx->lockState(), db, MODE_X);
+ Lock::DBLock dbWrite(opCtx, db, MODE_X);
auto createStatus = cloner.createCollectionsForDb(opCtx, createCollectionParams, db);
if (!createStatus.isOK()) {