summaryrefslogtreecommitdiff
path: root/src/mongo/db/cloner.cpp
diff options
context:
space:
mode:
authorSuganthi Mani <suganthi.mani@mongodb.com>2020-02-28 15:54:31 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-02 08:02:54 +0000
commit4628f264e60fd69cd09388e6fca0d3dd1b82f14c (patch)
treebca64008b3010bfb3500c2e6b4dabfb28d5d8862 /src/mongo/db/cloner.cpp
parenta5582fa42435116ab05efcabddf17219fbd573d6 (diff)
downloadmongo-4628f264e60fd69cd09388e6fca0d3dd1b82f14c.tar.gz
SERVER-39071 Implements commit quorum for two phase index builds.
Diffstat (limited to 'src/mongo/db/cloner.cpp')
-rw-r--r--src/mongo/db/cloner.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp
index cfd795a3b52..4f444b9f755 100644
--- a/src/mongo/db/cloner.cpp
+++ b/src/mongo/db/cloner.cpp
@@ -404,8 +404,16 @@ void Cloner::copyIndexes(OperationContext* opCtx,
MultiIndexBlock::OnInitFn onInitFn;
if (opCtx->writesAreReplicated() && buildUUID) {
onInitFn = [&](std::vector<BSONObj>& specs) {
- opObserver->onStartIndexBuild(
- opCtx, to_collection, collection->uuid(), *buildUUID, specs, fromMigrate);
+ // Since, we don't use IndexBuildsCoordinatorMongod thread pool to build indexes,
+ // it's ok to set the commit quorum option as 1. Also, this is currently only get
+ // called in rollback via refetch. So, onStartIndexBuild() call will be a no-op.
+ opObserver->onStartIndexBuild(opCtx,
+ to_collection,
+ collection->uuid(),
+ *buildUUID,
+ specs,
+ CommitQuorumOptions(1),
+ fromMigrate);
return Status::OK();
};
} else {