From 1675a93a2a3085fd4c2b973324b341b6e167c2af Mon Sep 17 00:00:00 2001 From: Gregory Wlodarek Date: Wed, 30 Jan 2019 17:52:26 -0500 Subject: SERVER-37639 Add CommitQuorumOptions to the Index Builds Coordinator instead of using WriteConcernOptions --- .../database_and_shard_versioning_all_commands.js | 2 +- src/mongo/db/catalog/SConscript | 20 +++- src/mongo/db/catalog/commit_quorum.idl | 11 ++- src/mongo/db/catalog/commit_quorum_options.cpp | 110 +++++++++++++++++++++ src/mongo/db/catalog/commit_quorum_options.h | 87 ++++++++++++++++ .../db/catalog/commit_quorum_options_test.cpp | 97 ++++++++++++++++++ src/mongo/db/catalog/index_build_entry_test.cpp | 39 ++------ src/mongo/db/commands/SConscript | 2 + src/mongo/db/index_builds_coordinator.h | 3 +- src/mongo/db/index_builds_coordinator_mongod.cpp | 2 +- src/mongo/db/index_builds_coordinator_mongod.h | 2 +- .../embedded/index_builds_coordinator_embedded.cpp | 2 +- .../embedded/index_builds_coordinator_embedded.h | 2 +- 13 files changed, 335 insertions(+), 44 deletions(-) create mode 100644 src/mongo/db/catalog/commit_quorum_options.cpp create mode 100644 src/mongo/db/catalog/commit_quorum_options.h create mode 100644 src/mongo/db/catalog/commit_quorum_options_test.cpp diff --git a/jstests/sharding/database_and_shard_versioning_all_commands.js b/jstests/sharding/database_and_shard_versioning_all_commands.js index c504455fe88..9dff71e3862 100644 --- a/jstests/sharding/database_and_shard_versioning_all_commands.js +++ b/jstests/sharding/database_and_shard_versioning_all_commands.js @@ -397,7 +397,7 @@ command: { setIndexCommitQuorum: collName, indexNames: ["index"], - commitQuorum: {w: "majority"} + commitQuorum: {commitQuorum: "majority"} }, cleanUp: function(mongosConn) { assert(mongosConn.getDB(dbName).getCollection(collName).drop()); diff --git a/src/mongo/db/catalog/SConscript b/src/mongo/db/catalog/SConscript index 6b8390933ee..c155995c346 100644 --- a/src/mongo/db/catalog/SConscript +++ b/src/mongo/db/catalog/SConscript @@ -64,14 +64,32 @@ env.Library( ], ) +env.Library( + target='commit_quorum_options', + source=[ + 'commit_quorum_options.cpp', + ], + LIBDEPS_PRIVATE=[ + '$BUILD_DIR/mongo/bson/util/bson_extract', + ], +) + +env.CppUnitTest( + target='commit_quorum_options_test', + source='commit_quorum_options_test.cpp', + LIBDEPS=[ + 'commit_quorum_options', + ], +) + env.Library( target='commit_quorum_idl', source=[ env.Idlc('commit_quorum.idl')[0], ], LIBDEPS=[ + 'commit_quorum_options', '$BUILD_DIR/mongo/base', - '$BUILD_DIR/mongo/db/write_concern_options', '$BUILD_DIR/mongo/idl/idl_parser', ], ) diff --git a/src/mongo/db/catalog/commit_quorum.idl b/src/mongo/db/catalog/commit_quorum.idl index 1c40369f1a1..678043c2e7d 100644 --- a/src/mongo/db/catalog/commit_quorum.idl +++ b/src/mongo/db/catalog/commit_quorum.idl @@ -29,12 +29,13 @@ global: cpp_namespace: "mongo" cpp_includes: - - "mongo/db/write_concern_options.h" + - "mongo/db/catalog/commit_quorum_options.h" types: CommitQuorum: bson_serialization_type: object - description: "CommitQuorum type that shadows the behaviour of WriteConcernOptions." - cpp_type: "mongo::WriteConcernOptions" - serializer: "mongo::WriteConcernOptions::toBSON" - deserializer: "mongo::WriteConcernOptions::deserializerForIDL" + description: "CommitQuorumOptions defines the required quorum for the index builds to + commit." + cpp_type: "mongo::CommitQuorumOptions" + serializer: "mongo::CommitQuorumOptions::toBSON" + deserializer: "mongo::CommitQuorumOptions::deserializerForIDL" diff --git a/src/mongo/db/catalog/commit_quorum_options.cpp b/src/mongo/db/catalog/commit_quorum_options.cpp new file mode 100644 index 00000000000..ac9d90334f1 --- /dev/null +++ b/src/mongo/db/catalog/commit_quorum_options.cpp @@ -0,0 +1,110 @@ +/** + * Copyright (C) 2019-present MongoDB, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * . + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the Server Side Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + +#include "mongo/platform/basic.h" + +#include "mongo/db/catalog/commit_quorum_options.h" + +#include "mongo/base/status.h" +#include "mongo/base/string_data.h" +#include "mongo/bson/util/bson_extract.h" +#include "mongo/db/field_parser.h" +#include "mongo/util/mongoutils/str.h" + +namespace mongo { + +const StringData CommitQuorumOptions::kCommitQuorumField = "commitQuorum"_sd; +const char CommitQuorumOptions::kMajority[] = "majority"; + +const BSONObj CommitQuorumOptions::Majority(BSON(kCommitQuorumField + << CommitQuorumOptions::kMajority)); + +CommitQuorumOptions::CommitQuorumOptions(int numNodesOpts) { + reset(); + numNodes = numNodesOpts; + invariant(numNodes >= 0); +} + +CommitQuorumOptions::CommitQuorumOptions(const std::string& modeOpts) { + reset(); + mode = modeOpts; + invariant(!mode.empty()); +} + +Status CommitQuorumOptions::parse(const BSONObj& obj) { + reset(); + if (obj.isEmpty()) { + return Status(ErrorCodes::FailedToParse, "commit quorum object cannot be empty"); + } + + BSONElement commitQuorumElement; + + for (auto field : obj) { + const auto fieldName = field.fieldNameStringData(); + if (fieldName == kCommitQuorumField) { + commitQuorumElement = field; + } else { + return Status(ErrorCodes::FailedToParse, + str::stream() << "unrecognized commit quorum field: " << fieldName); + } + } + + if (commitQuorumElement.isNumber()) { + numNodes = commitQuorumElement.numberInt(); + } else if (commitQuorumElement.type() == String) { + mode = commitQuorumElement.valuestrsafe(); + } else if (commitQuorumElement.eoo() || commitQuorumElement.type() == jstNULL || + commitQuorumElement.type() == Undefined) { + numNodes = 1; + } else { + return Status(ErrorCodes::FailedToParse, "commitQuorum has to be a number or a string"); + } + + return Status::OK(); +} + +CommitQuorumOptions CommitQuorumOptions::deserializerForIDL(const BSONObj& obj) { + CommitQuorumOptions commitQuorumOptions; + uassertStatusOK(commitQuorumOptions.parse(obj)); + return commitQuorumOptions; +} + +BSONObj CommitQuorumOptions::toBSON() const { + BSONObjBuilder builder; + + if (mode.empty()) { + builder.append(kCommitQuorumField, numNodes); + } else { + builder.append(kCommitQuorumField, mode); + } + + return builder.obj(); +} + +} // namespace mongo diff --git a/src/mongo/db/catalog/commit_quorum_options.h b/src/mongo/db/catalog/commit_quorum_options.h new file mode 100644 index 00000000000..fed8ba885ff --- /dev/null +++ b/src/mongo/db/catalog/commit_quorum_options.h @@ -0,0 +1,87 @@ +/** + * Copyright (C) 2019-present MongoDB, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * . + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the Server Side Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + +#pragma once + +#include + +#include "mongo/db/jsobj.h" + +namespace mongo { + +class Status; + +/** + * The 'CommitQuorumOptions' has the same range of settings as the 'w' field from + * 'WriteConcernOptions'. It can be set to an integer starting from 0 and up, or to a string. The + * string option can either be 'majority' or a replica set tag. + * + * The principal idea behind 'CommitQuorumOptions' is to figure out when an index build should be + * committed on the replica set based on the number of commit ready members. + */ +class CommitQuorumOptions { +public: + static const StringData kCommitQuorumField; // = "commitQuorum" + static const char kMajority[]; // = "majority" + + static const BSONObj Majority; // = {"commitQuorum": "majority"} + + CommitQuorumOptions() { + reset(); + } + + explicit CommitQuorumOptions(int numNodesOpts); + + explicit CommitQuorumOptions(const std::string& modeOpts); + + Status parse(const BSONObj& obj); + + /** + * Returns an instance of CommitQuorumOptions from a BSONObj. + * + * uasserts() if the obj cannot be deserialized. + */ + static CommitQuorumOptions deserializerForIDL(const BSONObj& obj); + + void reset() { + numNodes = 0; + mode = ""; + } + + // Returns the BSON representation of this object. + BSONObj toBSON() const; + + // The 'commitQuorum' parameter to define the required quorum for the index builds to commit. + // The 'mode' represents the string format and takes precedence over the number format + // 'numNodes'. + int numNodes; + std::string mode; +}; + +} // namespace mongo diff --git a/src/mongo/db/catalog/commit_quorum_options_test.cpp b/src/mongo/db/catalog/commit_quorum_options_test.cpp new file mode 100644 index 00000000000..cdcd696fdf0 --- /dev/null +++ b/src/mongo/db/catalog/commit_quorum_options_test.cpp @@ -0,0 +1,97 @@ +/** + * Copyright (C) 2019-present MongoDB, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * . + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the Server Side Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + +#include "mongo/platform/basic.h" + +#include "mongo/db/catalog/commit_quorum_options.h" +#include "mongo/db/jsobj.h" +#include "mongo/unittest/unittest.h" + +namespace mongo { +namespace { + +TEST(CommitQuorumOptionsTest, ParseReturnsFailedToParseOnEmptyDocument) { + auto status = CommitQuorumOptions().parse({}); + ASSERT_EQUALS(ErrorCodes::FailedToParse, status); + ASSERT_EQUALS("commit quorum object cannot be empty", status.reason()); +} + +TEST(CommitQuorumOptionsTest, ParseReturnsFailedToParseIfCommitQuorumIsNotNumberOrString) { + auto status = CommitQuorumOptions().parse(BSON("commitQuorum" << BSONObj())); + ASSERT_EQUALS(ErrorCodes::FailedToParse, status); + ASSERT_EQUALS("commitQuorum has to be a number or a string", status.reason()); +} + +TEST(CommitQuorumOptionsTest, ParseSetsNumNodesIfCommitQuorumIsANumber) { + CommitQuorumOptions options; + ASSERT_OK(options.parse(BSON("commitQuorum" << 3))); + ASSERT_EQUALS(3, options.numNodes); + ASSERT_EQUALS("", options.mode); +} + +TEST(CommitQuorumOptionsTest, ParseSetsModeIfCommitQuorumIsAString) { + CommitQuorumOptions options; + ASSERT_OK(options.parse(BSON("commitQuorum" << CommitQuorumOptions::kMajority))); + ASSERT_EQUALS(0, options.numNodes); + ASSERT_EQUALS(CommitQuorumOptions::kMajority, options.mode); +} + +TEST(CommitQuorumOptionsTest, ParseReturnsFailedToParseOnUnknownField) { + auto status = CommitQuorumOptions().parse(BSON("x" << 123)); + ASSERT_EQUALS(ErrorCodes::FailedToParse, status); + ASSERT_EQUALS("unrecognized commit quorum field: x", status.reason()); +} + +TEST(CommitQuorumOptionsTest, ToBSON) { + { + CommitQuorumOptions options; + ASSERT_OK(options.parse(BSON("commitQuorum" << 1))); + ASSERT_TRUE(options.toBSON().woCompare(BSON("commitQuorum" << 1)) == 0); + } + + { + CommitQuorumOptions options; + ASSERT_OK(options.parse(BSON("commitQuorum" + << "someTag"))); + ASSERT_TRUE(options.toBSON().woCompare(BSON("commitQuorum" + << "someTag")) == 0); + } + + { + // Strings take precedence over numbers. + CommitQuorumOptions options; + options.mode = "majority"; + options.numNodes = 5; + ASSERT_TRUE(options.toBSON().woCompare(BSON("commitQuorum" + << "majority")) == 0); + } +} + +} // namespace +} // namespace mongo diff --git a/src/mongo/db/catalog/index_build_entry_test.cpp b/src/mongo/db/catalog/index_build_entry_test.cpp index 9f774514a9e..10e5221af46 100644 --- a/src/mongo/db/catalog/index_build_entry_test.cpp +++ b/src/mongo/db/catalog/index_build_entry_test.cpp @@ -35,8 +35,8 @@ #include "mongo/bson/bsonobj.h" #include "mongo/bson/bsonobjbuilder.h" #include "mongo/bson/bsontypes.h" +#include "mongo/db/catalog/commit_quorum_options.h" #include "mongo/db/catalog/index_build_entry_gen.h" -#include "mongo/db/write_concern_options.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" #include "mongo/util/net/hostandport.h" @@ -45,8 +45,6 @@ namespace mongo { namespace { -enum CommitQuorumOptions { Number, Majority, Tag }; - const std::vector generateIndexes(size_t numIndexes) { std::vector indexes; for (size_t i = 0; i < numIndexes; i++) { @@ -55,23 +53,6 @@ const std::vector generateIndexes(size_t numIndexes) { return indexes; } -const WriteConcernOptions generateCommitQuorum(CommitQuorumOptions option) { - switch (option) { - case Number: - return WriteConcernOptions(1, WriteConcernOptions::SyncMode::UNSET, 0); - break; - case Majority: - return WriteConcernOptions( - WriteConcernOptions::kMajority, WriteConcernOptions::SyncMode::UNSET, 0); - break; - case Tag: - return WriteConcernOptions("someTag", WriteConcernOptions::SyncMode::UNSET, 0); - break; - default: - return WriteConcernOptions(0, WriteConcernOptions::SyncMode::UNSET, 0); - } -} - const std::vector generateCommitReadyMembers(size_t numMembers) { std::vector members; for (size_t i = 0; i < numMembers; i++) { @@ -83,16 +64,14 @@ const std::vector generateCommitReadyMembers(size_t numMembers) { TEST(IndexBuildEntryTest, IndexBuildEntryWithRequiredFields) { const UUID id = UUID::gen(); const UUID collectionUUID = UUID::gen(); - const WriteConcernOptions commitQuorum = generateCommitQuorum(CommitQuorumOptions::Number); + const CommitQuorumOptions commitQuorum(1); const std::vector indexes = generateIndexes(1); IndexBuildEntry entry(id, collectionUUID, commitQuorum, indexes); ASSERT_EQUALS(entry.getBuildUUID(), id); ASSERT_EQUALS(entry.getCollectionUUID(), collectionUUID); - ASSERT_EQUALS(entry.getCommitQuorum().wNumNodes, 1); - ASSERT_TRUE(entry.getCommitQuorum().syncMode == WriteConcernOptions::SyncMode::UNSET); - ASSERT_EQUALS(entry.getCommitQuorum().wTimeout, 0); + ASSERT_EQUALS(entry.getCommitQuorum().numNodes, 1); ASSERT_EQUALS(entry.getIndexNames().size(), indexes.size()); ASSERT_FALSE(entry.getPrepareIndexBuild()); } @@ -100,7 +79,7 @@ TEST(IndexBuildEntryTest, IndexBuildEntryWithRequiredFields) { TEST(IndexBuildEntryTest, IndexBuildEntryWithOptionalFields) { const UUID id = UUID::gen(); const UUID collectionUUID = UUID::gen(); - const WriteConcernOptions commitQuorum = generateCommitQuorum(CommitQuorumOptions::Majority); + const CommitQuorumOptions commitQuorum(CommitQuorumOptions::kMajority); const std::vector indexes = generateIndexes(3); IndexBuildEntry entry(id, collectionUUID, commitQuorum, indexes); @@ -111,9 +90,7 @@ TEST(IndexBuildEntryTest, IndexBuildEntryWithOptionalFields) { ASSERT_EQUALS(entry.getBuildUUID(), id); ASSERT_EQUALS(entry.getCollectionUUID(), collectionUUID); - ASSERT_EQUALS(entry.getCommitQuorum().wMode, WriteConcernOptions::kMajority); - ASSERT_TRUE(entry.getCommitQuorum().syncMode == WriteConcernOptions::SyncMode::UNSET); - ASSERT_EQUALS(entry.getCommitQuorum().wTimeout, 0); + ASSERT_EQUALS(entry.getCommitQuorum().mode, CommitQuorumOptions::kMajority); ASSERT_EQUALS(entry.getIndexNames().size(), indexes.size()); ASSERT_TRUE(entry.getPrepareIndexBuild()); ASSERT_TRUE(entry.getCommitReadyMembers()->size() == 2); @@ -122,7 +99,7 @@ TEST(IndexBuildEntryTest, IndexBuildEntryWithOptionalFields) { TEST(IndexBuildEntryTest, SerializeAndDeserialize) { const UUID id = UUID::gen(); const UUID collectionUUID = UUID::gen(); - const WriteConcernOptions commitQuorum = generateCommitQuorum(CommitQuorumOptions::Tag); + const CommitQuorumOptions commitQuorum("someTag"); const std::vector indexes = generateIndexes(1); IndexBuildEntry entry(id, collectionUUID, commitQuorum, indexes); @@ -137,9 +114,7 @@ TEST(IndexBuildEntryTest, SerializeAndDeserialize) { ASSERT_EQUALS(rebuiltEntry.getBuildUUID(), id); ASSERT_EQUALS(rebuiltEntry.getCollectionUUID(), collectionUUID); - ASSERT_EQUALS(rebuiltEntry.getCommitQuorum().wMode, "someTag"); - ASSERT_TRUE(rebuiltEntry.getCommitQuorum().syncMode == WriteConcernOptions::SyncMode::UNSET); - ASSERT_EQUALS(rebuiltEntry.getCommitQuorum().wTimeout, 0); + ASSERT_EQUALS(rebuiltEntry.getCommitQuorum().mode, "someTag"); ASSERT_EQUALS(rebuiltEntry.getIndexNames().size(), indexes.size()); ASSERT_FALSE(rebuiltEntry.getPrepareIndexBuild()); ASSERT_TRUE(rebuiltEntry.getCommitReadyMembers()->size() == 3); diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript index c49907727b9..2cf363c4714 100644 --- a/src/mongo/db/commands/SConscript +++ b/src/mongo/db/commands/SConscript @@ -300,6 +300,7 @@ env.Library( env.Idlc('set_index_commit_quorum.idl')[0], ], LIBDEPS_PRIVATE=[ + '$BUILD_DIR/mongo/db/catalog/commit_quorum_options', '$BUILD_DIR/mongo/db/rw_concern_d', '$BUILD_DIR/mongo/idl/idl_parser', ], @@ -352,6 +353,7 @@ env.Library( '$BUILD_DIR/mongo/db/background', '$BUILD_DIR/mongo/db/catalog/catalog_control', '$BUILD_DIR/mongo/db/catalog/catalog_helpers', + '$BUILD_DIR/mongo/db/catalog/commit_quorum_options', '$BUILD_DIR/mongo/db/catalog/index_key_validate', '$BUILD_DIR/mongo/db/cloner', '$BUILD_DIR/mongo/db/commands', diff --git a/src/mongo/db/index_builds_coordinator.h b/src/mongo/db/index_builds_coordinator.h index d61f4c946db..d6987f24864 100644 --- a/src/mongo/db/index_builds_coordinator.h +++ b/src/mongo/db/index_builds_coordinator.h @@ -35,6 +35,7 @@ #include "mongo/base/string_data.h" #include "mongo/db/catalog/collection_options.h" +#include "mongo/db/catalog/commit_quorum_options.h" #include "mongo/db/catalog/index_builds_manager.h" #include "mongo/db/collection_index_builds_tracker.h" #include "mongo/db/database_index_builds_tracker.h" @@ -207,7 +208,7 @@ public: */ virtual Status setCommitQuorum(const NamespaceString& nss, const std::vector& indexNames, - const WriteConcernOptions& newCommitQuorum) = 0; + const CommitQuorumOptions& newCommitQuorum) = 0; /** * TODO: This is not yet implemented. diff --git a/src/mongo/db/index_builds_coordinator_mongod.cpp b/src/mongo/db/index_builds_coordinator_mongod.cpp index 38418ef8f67..54789c9cba8 100644 --- a/src/mongo/db/index_builds_coordinator_mongod.cpp +++ b/src/mongo/db/index_builds_coordinator_mongod.cpp @@ -157,7 +157,7 @@ Status IndexBuildsCoordinatorMongod::voteCommitIndexBuild(const UUID& buildUUID, Status IndexBuildsCoordinatorMongod::setCommitQuorum(const NamespaceString& nss, const std::vector& indexNames, - const WriteConcernOptions& newCommitQuorum) { + const CommitQuorumOptions& newCommitQuorum) { // TODO: not yet implemented. return Status::OK(); } diff --git a/src/mongo/db/index_builds_coordinator_mongod.h b/src/mongo/db/index_builds_coordinator_mongod.h index 15f4995d1c5..efca8bb628c 100644 --- a/src/mongo/db/index_builds_coordinator_mongod.h +++ b/src/mongo/db/index_builds_coordinator_mongod.h @@ -90,7 +90,7 @@ public: Status setCommitQuorum(const NamespaceString& nss, const std::vector& indexNames, - const WriteConcernOptions& newCommitQuorum) override; + const CommitQuorumOptions& newCommitQuorum) override; private: /** diff --git a/src/mongo/embedded/index_builds_coordinator_embedded.cpp b/src/mongo/embedded/index_builds_coordinator_embedded.cpp index 12c1dc62487..72437ac9f09 100644 --- a/src/mongo/embedded/index_builds_coordinator_embedded.cpp +++ b/src/mongo/embedded/index_builds_coordinator_embedded.cpp @@ -98,7 +98,7 @@ Status IndexBuildsCoordinatorEmbedded::voteCommitIndexBuild(const UUID& buildUUI Status IndexBuildsCoordinatorEmbedded::setCommitQuorum(const NamespaceString& nss, const std::vector& indexNames, - const WriteConcernOptions& newCommitQuorum) { + const CommitQuorumOptions& newCommitQuorum) { MONGO_UNREACHABLE; } diff --git a/src/mongo/embedded/index_builds_coordinator_embedded.h b/src/mongo/embedded/index_builds_coordinator_embedded.h index 8b1df3ee0ff..5d9d96e16a1 100644 --- a/src/mongo/embedded/index_builds_coordinator_embedded.h +++ b/src/mongo/embedded/index_builds_coordinator_embedded.h @@ -74,7 +74,7 @@ public: Status voteCommitIndexBuild(const UUID& buildUUID, const HostAndPort& hostAndPort) override; Status setCommitQuorum(const NamespaceString& nss, const std::vector& indexNames, - const WriteConcernOptions& newCommitQuorum) override; + const CommitQuorumOptions& newCommitQuorum) override; private: void _runIndexBuild(OperationContext* opCtx, const UUID& buildUUID) noexcept override; -- cgit v1.2.1