diff options
author | Judah Schvimer <judah@mongodb.com> | 2020-06-08 23:20:37 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-09 22:39:43 +0000 |
commit | 64fcdabe8c7cc38188f31fd606379f935c94555a (patch) | |
tree | 8dbc2fc938b52f9c7f410abff410d30beaeaeceb /src/mongo/db/repl/repl_set_commands.cpp | |
parent | 915402884c52da861b1660cd6a7172c552ce1806 (diff) | |
download | mongo-64fcdabe8c7cc38188f31fd606379f935c94555a.tar.gz |
SERVER-46541 enable automatic reconfigs for initial sync semantics by default
Diffstat (limited to 'src/mongo/db/repl/repl_set_commands.cpp')
-rw-r--r-- | src/mongo/db/repl/repl_set_commands.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mongo/db/repl/repl_set_commands.cpp b/src/mongo/db/repl/repl_set_commands.cpp index de4411d1488..22a42f2da65 100644 --- a/src/mongo/db/repl/repl_set_commands.cpp +++ b/src/mongo/db/repl/repl_set_commands.cpp @@ -77,7 +77,7 @@ namespace repl { using std::string; using std::stringstream; -static const std::string kReplSetReconfigNss = "local.replset.reconfig"; +constexpr StringData kInternalIncludeNewlyAddedFieldName = "$_internalIncludeNewlyAdded"_sd; class ReplExecutorSSM : public ServerStatusMetric { public: @@ -206,7 +206,21 @@ public: bool wantCommitmentStatus; uassertStatusOK(bsonExtractBooleanFieldWithDefault( cmdObj, "commitmentStatus", false, &wantCommitmentStatus)); - ReplicationCoordinator::get(opCtx)->processReplSetGetConfig(&result, wantCommitmentStatus); + + if (cmdObj[kInternalIncludeNewlyAddedFieldName]) { + uassert(ErrorCodes::InvalidOptions, + "The '$_internalIncludeNewlyAdded' option is only supported when testing" + " commands are enabled", + getTestCommandsEnabled()); + } + + bool includeNewlyAdded; + uassertStatusOK(bsonExtractBooleanFieldWithDefault( + cmdObj, kInternalIncludeNewlyAddedFieldName, false, &includeNewlyAdded)); + + ReplicationCoordinator::get(opCtx)->processReplSetGetConfig( + &result, wantCommitmentStatus, includeNewlyAdded); + return true; } |