summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_build_entry_helpers.cpp
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2020-08-03 14:25:13 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-04 01:58:47 +0000
commit9102bf998537e744227fe2a28cb22838388bb3f6 (patch)
treeba5d31a3385522fc382a2704135fa7ec835222e2 /src/mongo/db/index_build_entry_helpers.cpp
parente07c2d29aded5a30ff08b5ce6a436b6ef6f44014 (diff)
downloadmongo-9102bf998537e744227fe2a28cb22838388bb3f6.tar.gz
SERVER-48312 Remove support for 'supportsDocLocking = false'
Diffstat (limited to 'src/mongo/db/index_build_entry_helpers.cpp')
-rw-r--r--src/mongo/db/index_build_entry_helpers.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/mongo/db/index_build_entry_helpers.cpp b/src/mongo/db/index_build_entry_helpers.cpp
index d8df85c6d00..95cfcb7c6c5 100644
--- a/src/mongo/db/index_build_entry_helpers.cpp
+++ b/src/mongo/db/index_build_entry_helpers.cpp
@@ -204,21 +204,15 @@ Status addIndexBuildEntry(OperationContext* opCtx, const IndexBuildEntry& indexB
WriteUnitOfWork wuow(opCtx);
- Status status = Status::OK();
- if (supportsDocLocking()) {
- // Reserve a slot in the oplog. This must only be done for document level locking
- // storage engines, which are allowed to insert oplog documents out-of-order into
- // the oplog.
- auto oplogInfo = repl::LocalOplogInfo::get(opCtx);
- auto oplogSlot = oplogInfo->getNextOpTimes(opCtx, 1U)[0];
- status = collection->insertDocument(
- opCtx,
- InsertStatement(kUninitializedStmtId, indexBuildEntry.toBSON(), oplogSlot),
- nullptr);
- } else {
- status = collection->insertDocument(
- opCtx, InsertStatement(indexBuildEntry.toBSON()), nullptr);
- }
+ // Reserve a slot in the oplog as the storage engine is allowed to insert oplog
+ // documents out-of-order into the oplog.
+ auto oplogInfo = repl::LocalOplogInfo::get(opCtx);
+ auto oplogSlot = oplogInfo->getNextOpTimes(opCtx, 1U)[0];
+ Status status = collection->insertDocument(
+ opCtx,
+ InsertStatement(kUninitializedStmtId, indexBuildEntry.toBSON(), oplogSlot),
+ nullptr);
+
if (!status.isOK()) {
return status;
}