summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-01-23 10:48:15 -0500
committerGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-01-24 22:37:20 -0500
commitec4520d72b2a4ff6ba980e913c988b11e7d188a4 (patch)
tree97cabc080446860c2d785011ed256f6a6335e5d4 /src/mongo/db
parent5fb83f78b6740dbe3a771735e3629fec2a854a1d (diff)
downloadmongo-ec4520d72b2a4ff6ba980e913c988b11e7d188a4.tar.gz
SERVER-38506 Create a cluster setIndexCommitQuorum command to parallel createIndexes
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/commands/SConscript12
-rw-r--r--src/mongo/db/commands/set_index_commit_quorum_command.cpp16
2 files changed, 26 insertions, 2 deletions
diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript
index 19896af6656..c49907727b9 100644
--- a/src/mongo/db/commands/SConscript
+++ b/src/mongo/db/commands/SConscript
@@ -294,6 +294,16 @@ env.Library(
],
)
+env.Library(
+ target='set_index_commit_quorum_idl',
+ source=[
+ env.Idlc('set_index_commit_quorum.idl')[0],
+ ],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/rw_concern_d',
+ '$BUILD_DIR/mongo/idl/idl_parser',
+ ],
+)
# Commands that should only be present in mongod
env.Library(
@@ -325,7 +335,6 @@ env.Library(
"txn_cmds.cpp",
"user_management_commands.cpp",
"vote_commit_index_build_command.cpp",
- env.Idlc('set_index_commit_quorum.idl')[0],
env.Idlc('vote_commit_index_build.idl')[0],
],
LIBDEPS=[
@@ -365,6 +374,7 @@ env.Library(
'mongod_fsync',
'profile_common',
'servers',
+ 'set_index_commit_quorum_idl',
'shell_protocol',
'standalone',
'test_commands_enabled',
diff --git a/src/mongo/db/commands/set_index_commit_quorum_command.cpp b/src/mongo/db/commands/set_index_commit_quorum_command.cpp
index 3ea933e43f4..bdff7263a7c 100644
--- a/src/mongo/db/commands/set_index_commit_quorum_command.cpp
+++ b/src/mongo/db/commands/set_index_commit_quorum_command.cpp
@@ -31,6 +31,9 @@
#include "mongo/platform/basic.h"
+#include <iostream>
+#include <string>
+
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/commands.h"
#include "mongo/db/commands/set_index_commit_quorum_gen.h"
@@ -39,6 +42,7 @@
#include "mongo/util/log.h"
namespace mongo {
+
namespace {
/**
@@ -56,7 +60,17 @@ public:
using Request = SetIndexCommitQuorum;
std::string help() const override {
- return "Resets the commitQuorum for an index build";
+ std::stringstream ss;
+ ss << "Resets the commitQuorum for the given index builds in a collection. Usage:"
+ << std::endl
+ << "{" << std::endl
+ << " setIndexCommitQuorum: <string> collection name," << std::endl
+ << " indexNames: array<string> list of index names," << std::endl
+ << " commitQuorum: <string|number|object> option to define the required quorum for"
+ << std::endl
+ << " the index builds to commit" << std::endl
+ << "}";
+ return ss.str();
}
bool adminOnly() const override {