summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/multi_index_block.cpp
diff options
context:
space:
mode:
authorDidier Nadeau <didier.nadeau@mongodb.com>2022-02-20 20:36:51 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-20 21:18:11 +0000
commitc8c31330d7b022ef59c97b97f3dfc9f244ccaef7 (patch)
tree715195d58b1e8aec37a19b4f0c4925bccefafb7a /src/mongo/db/catalog/multi_index_block.cpp
parentce3b2db6de5728e161a865caf3b03f352e6daeed (diff)
downloadmongo-c8c31330d7b022ef59c97b97f3dfc9f244ccaef7.tar.gz
SERVER-63266 Allow server to be started without setname in serverless mode
Diffstat (limited to 'src/mongo/db/catalog/multi_index_block.cpp')
-rw-r--r--src/mongo/db/catalog/multi_index_block.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/db/catalog/multi_index_block.cpp b/src/mongo/db/catalog/multi_index_block.cpp
index 84dd6a29067..e5e78d25a34 100644
--- a/src/mongo/db/catalog/multi_index_block.cpp
+++ b/src/mongo/db/catalog/multi_index_block.cpp
@@ -702,8 +702,7 @@ Status MultiIndexBlock::_insert(OperationContext* opCtx,
// Only enforce the mixed-schema data constraint on the primary. Index builds may not fail
// on the secondaries. The primary will replicate an abortIndexBuild oplog entry.
auto replCoord = repl::ReplicationCoordinator::get(opCtx);
- const bool replSetAndNotPrimary = replCoord->getSettings().usingReplSets() &&
- !replCoord->canAcceptWritesFor(opCtx, collection->ns());
+ const bool replSetAndNotPrimary = !replCoord->canAcceptWritesFor(opCtx, collection->ns());
if (docHasMixedSchemaData && !replSetAndNotPrimary) {
return timeseriesMixedSchemaDataFailure(collection.get());
@@ -917,8 +916,7 @@ Status MultiIndexBlock::commit(OperationContext* opCtx,
}
auto replCoord = repl::ReplicationCoordinator::get(opCtx);
- const bool replSetAndNotPrimary = replCoord->getSettings().usingReplSets() &&
- !replCoord->canAcceptWritesFor(opCtx, collection->ns());
+ const bool replSetAndNotPrimary = !replCoord->canAcceptWritesFor(opCtx, collection->ns());
// During the collection scan phase, only the primary will enforce the mixed-schema data
// constraint. Secondaries will only keep track of and take no action if mixed-schema data is