summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-04-23 14:05:20 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-23 18:25:39 +0000
commit8557ccd48a21b425f526bede831a93dfc1c44e18 (patch)
treea28e758305f9fd17d73d501d86e81ed9bedcf832
parent96d26475d7fb4ff6937c75b822b8ab573b63f860 (diff)
downloadmongo-8557ccd48a21b425f526bede831a93dfc1c44e18.tar.gz
SERVER-47462 remove setIndexCommitQuorum command
-rw-r--r--jstests/core/views/views_all_commands.js1
-rw-r--r--jstests/sharding/database_and_shard_versioning_all_commands.js13
-rw-r--r--jstests/sharding/libs/last_stable_mongos_commands.js1
-rw-r--r--jstests/sharding/safe_secondary_reads_drop_recreate.js1
-rw-r--r--jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js1
-rw-r--r--jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js1
-rw-r--r--src/mongo/db/commands/SConscript14
-rw-r--r--src/mongo/db/commands/set_index_commit_quorum.idl55
-rw-r--r--src/mongo/db/commands/set_index_commit_quorum_command.cpp118
-rw-r--r--src/mongo/s/commands/SConscript2
-rw-r--r--src/mongo/s/commands/cluster_set_index_commit_quorum_cmd.cpp121
11 files changed, 0 insertions, 328 deletions
diff --git a/jstests/core/views/views_all_commands.js b/jstests/core/views/views_all_commands.js
index 2b3f86ec77c..7361b9dcd24 100644
--- a/jstests/core/views/views_all_commands.js
+++ b/jstests/core/views/views_all_commands.js
@@ -452,7 +452,6 @@ let viewsCommandTests = {
saslContinue: {skip: isUnrelated},
saslStart: {skip: isUnrelated},
serverStatus: {command: {serverStatus: 1}, skip: isUnrelated},
- setIndexCommitQuorum: {skip: isUnrelated},
setCommittedSnapshot: {skip: isAnInternalCommand},
setFeatureCompatibilityVersion: {skip: isUnrelated},
setFreeMonitoring: {skip: isUnrelated},
diff --git a/jstests/sharding/database_and_shard_versioning_all_commands.js b/jstests/sharding/database_and_shard_versioning_all_commands.js
index 779f8f3ae89..a8f36b85708 100644
--- a/jstests/sharding/database_and_shard_versioning_all_commands.js
+++ b/jstests/sharding/database_and_shard_versioning_all_commands.js
@@ -384,19 +384,6 @@ let testCases = {
saslContinue: {skip: "not on a user database"},
saslStart: {skip: "not on a user database"},
serverStatus: {skip: "executes locally on mongos (not sent to any remote node)"},
- setIndexCommitQuorum: {
- skipProfilerCheck: true,
- sendsDbVersion: true,
- sendsShardVersion: true,
- setUp: function(mongosConn) {
- // Expects the collection to exist, and doesn't implicitly create it.
- assert.commandWorked(mongosConn.getDB(dbName).runCommand({create: collName}));
- },
- command: {setIndexCommitQuorum: collName, indexNames: ["index"], commitQuorum: "majority"},
- cleanUp: function(mongosConn) {
- assert(mongosConn.getDB(dbName).getCollection(collName).drop());
- },
- },
setFeatureCompatibilityVersion: {skip: "not on a user database"},
setFreeMonitoring:
{skip: "explicitly fails for mongos, primary mongod only", conditional: true},
diff --git a/jstests/sharding/libs/last_stable_mongos_commands.js b/jstests/sharding/libs/last_stable_mongos_commands.js
index 92cacdb3e16..ee3b33465be 100644
--- a/jstests/sharding/libs/last_stable_mongos_commands.js
+++ b/jstests/sharding/libs/last_stable_mongos_commands.js
@@ -20,7 +20,6 @@ const commandsAddedToMongosIn42 = [
'clearJumboFlag',
'commitTransaction',
'dropConnections',
- 'setIndexCommitQuorum',
'startRecordingTraffic',
'stopRecordingTraffic',
'waitForFailPoint',
diff --git a/jstests/sharding/safe_secondary_reads_drop_recreate.js b/jstests/sharding/safe_secondary_reads_drop_recreate.js
index 3a40c3afe62..08a7fbea92f 100644
--- a/jstests/sharding/safe_secondary_reads_drop_recreate.js
+++ b/jstests/sharding/safe_secondary_reads_drop_recreate.js
@@ -277,7 +277,6 @@ let testCases = {
saslStart: {skip: "primary only"},
serverStatus: {skip: "does not return user data"},
setCommittedSnapshot: {skip: "does not return user data"},
- setIndexCommitQuorum: {skip: "primary only"},
setFeatureCompatibilityVersion: {skip: "primary only"},
setFreeMonitoring: {skip: "primary only"},
setParameter: {skip: "does not return user data"},
diff --git a/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js b/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js
index e7e3c6566d4..5b5f8e9183e 100644
--- a/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js
+++ b/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js
@@ -312,7 +312,6 @@ let testCases = {
saslStart: {skip: "primary only"},
serverStatus: {skip: "does not return user data"},
setCommittedSnapshot: {skip: "does not return user data"},
- setIndexCommitQuorum: {skip: "primary only"},
setFeatureCompatibilityVersion: {skip: "primary only"},
setFreeMonitoring: {skip: "primary only"},
setParameter: {skip: "does not return user data"},
diff --git a/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js b/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js
index 2562cd124e1..18c6cd378ce 100644
--- a/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js
+++ b/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js
@@ -282,7 +282,6 @@ let testCases = {
saslStart: {skip: "primary only"},
serverStatus: {skip: "does not return user data"},
setCommittedSnapshot: {skip: "does not return user data"},
- setIndexCommitQuorum: {skip: "primary only"},
setFeatureCompatibilityVersion: {skip: "primary only"},
setFreeMonitoring: {skip: "primary only"},
setParameter: {skip: "does not return user data"},
diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript
index f281ab2b1ab..c41b757eaef 100644
--- a/src/mongo/db/commands/SConscript
+++ b/src/mongo/db/commands/SConscript
@@ -326,18 +326,6 @@ 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/catalog/commit_quorum_options',
- '$BUILD_DIR/mongo/db/rw_concern_d',
- '$BUILD_DIR/mongo/idl/idl_parser',
- ],
-)
-
# Commands that should only be present in mongod
env.Library(
target="mongod",
@@ -358,7 +346,6 @@ env.Library(
"resize_oplog.cpp",
"restart_catalog_command.cpp",
"set_feature_compatibility_version_command.cpp",
- "set_index_commit_quorum_command.cpp",
"sharded_index_consistency_server_status.cpp",
"shutdown_d.cpp",
"snapshot_management.cpp",
@@ -407,7 +394,6 @@ env.Library(
'profile_common',
'server_status',
'servers',
- 'set_index_commit_quorum_idl',
'shell_protocol',
'standalone',
'test_commands_enabled',
diff --git a/src/mongo/db/commands/set_index_commit_quorum.idl b/src/mongo/db/commands/set_index_commit_quorum.idl
deleted file mode 100644
index 8925d73c904..00000000000
--- a/src/mongo/db/commands/set_index_commit_quorum.idl
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (C) 2018-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
-# <http://www.mongodb.com/licensing/server-side-public-license>.
-#
-# 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.
-#
-
-# setIndexCommitQuorum IDL File.
-
-global:
- cpp_namespace: "mongo"
- cpp_includes:
- - "mongo/db/write_concern_options.h"
-
-imports:
- - "mongo/db/catalog/commit_quorum.idl"
- - "mongo/idl/basic_types.idl"
-
-commands:
- setIndexCommitQuorum:
- cpp_name: SetIndexCommitQuorum
- description: "Resets the commitQuorum for an index build."
- strict: false
- namespace: concatenate_with_db
- fields:
- indexNames:
- type: array<string>
- description: "an array of all index names matching a single prior createIndexes
- request."
- commitQuorum:
- type: CommitQuorum
- description: "commitQuorum can be set to the same values as writeConcern.w and
- indicates how many and/or which replica set members are needed for the
- primary to commit the index build."
diff --git a/src/mongo/db/commands/set_index_commit_quorum_command.cpp b/src/mongo/db/commands/set_index_commit_quorum_command.cpp
deleted file mode 100644
index 2c0555442db..00000000000
--- a/src/mongo/db/commands/set_index_commit_quorum_command.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * Copyright (C) 2018-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
- * <http://www.mongodb.com/licensing/server-side-public-license>.
- *
- * 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.
- */
-
-#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommand
-
-#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"
-#include "mongo/db/index_builds_coordinator.h"
-#include "mongo/db/write_concern_options.h"
-#include "mongo/util/log.h"
-
-namespace mongo {
-
-namespace {
-
-/**
- * Resets the commitQuorum set on an index build identified by the list of index names that were
- * previously specified in a createIndexes request.
- *
- * {
- * setIndexCommitQuorum: coll,
- * indexNames: ["x_1", "y_1", "xIndex", "someindexname"],
- * commitQuorum: "majority" / 3 / {"replTagName": "replTagValue"},
- * }
- */
-class SetIndexCommitQuorumCommand final : public TypedCommand<SetIndexCommitQuorumCommand> {
-public:
- using Request = SetIndexCommitQuorum;
-
- std::string help() const override {
- 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 {
- return false;
- }
-
- AllowedOnSecondary secondaryAllowed(ServiceContext*) const override {
- return AllowedOnSecondary::kNever;
- }
-
- class Invocation final : public InvocationBase {
- public:
- using InvocationBase::InvocationBase;
-
- void typedRun(OperationContext* opCtx) {
- uassertStatusOK(
- IndexBuildsCoordinator::get(opCtx)->setCommitQuorum(opCtx,
- request().getNamespace(),
- request().getIndexNames(),
- request().getCommitQuorum()));
- }
-
- private:
- NamespaceString ns() const override {
- return request().getNamespace();
- }
-
- bool supportsWriteConcern() const override {
- return true;
- }
-
- void doCheckAuthorization(OperationContext* opCtx) const override {
- uassert(ErrorCodes::Unauthorized,
- "Unauthorized",
- AuthorizationSession::get(opCtx->getClient())
- ->isAuthorizedForActionsOnResource(
- ResourcePattern::forExactNamespace(request().getNamespace()),
- ActionType::createIndex));
- }
- };
-
-} setCommitQuorumCmd;
-
-} // namespace
-} // namespace mongo
diff --git a/src/mongo/s/commands/SConscript b/src/mongo/s/commands/SConscript
index a135bf56d1a..3f0faf95d6f 100644
--- a/src/mongo/s/commands/SConscript
+++ b/src/mongo/s/commands/SConscript
@@ -75,7 +75,6 @@ env.Library(
'cluster_repl_set_get_status_cmd.cpp',
'cluster_reset_error_cmd.cpp',
'cluster_restart_catalog_command.cpp',
- 'cluster_set_index_commit_quorum_cmd.cpp',
'cluster_set_feature_compatibility_version_cmd.cpp',
'cluster_set_free_monitoring.cpp' if get_option("enable-free-mon") == 'on' else [],
'cluster_shard_collection_cmd.cpp',
@@ -105,7 +104,6 @@ env.Library(
'$BUILD_DIR/mongo/db/commands/list_databases_command',
'$BUILD_DIR/mongo/db/commands/profile_common',
'$BUILD_DIR/mongo/db/commands/servers',
- '$BUILD_DIR/mongo/db/commands/set_index_commit_quorum_idl',
'$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/db/commands/write_commands_common',
'$BUILD_DIR/mongo/db/ftdc/ftdc_server',
diff --git a/src/mongo/s/commands/cluster_set_index_commit_quorum_cmd.cpp b/src/mongo/s/commands/cluster_set_index_commit_quorum_cmd.cpp
deleted file mode 100644
index a19fb187524..00000000000
--- a/src/mongo/s/commands/cluster_set_index_commit_quorum_cmd.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * 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
- * <http://www.mongodb.com/licensing/server-side-public-license>.
- *
- * 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.
- */
-
-#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommand
-
-#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"
-#include "mongo/s/cluster_commands_helpers.h"
-#include "mongo/util/log.h"
-
-namespace mongo {
-namespace {
-
-/**
- * Resets the commitQuorum set on an index build identified by the list of index names that were
- * previously specified in a createIndexes request.
- *
- * {
- * setIndexCommitQuorum: coll,
- * indexNames: ["x_1", "y_1", "xIndex", "someindexname"],
- * commitQuorum: "majority" / 3 / {"replTagName": "replTagValue"},
- * }
- */
-class SetIndexCommitQuorumCommand final : public TypedCommand<SetIndexCommitQuorumCommand> {
-public:
- using Request = SetIndexCommitQuorum;
-
- std::string help() const override {
- 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 {
- return false;
- }
-
- AllowedOnSecondary secondaryAllowed(ServiceContext*) const override {
- return AllowedOnSecondary::kNever;
- }
-
- class Invocation final : public InvocationBase {
- public:
- using InvocationBase::InvocationBase;
-
- void typedRun(OperationContext* opCtx) {
- BSONObj cmdObj = request().toBSON(BSONObj());
- LOG(1) << "setIndexCommitQuorum: " << request().getNamespace()
- << " cmd:" << redact(cmdObj);
-
- scatterGatherOnlyVersionIfUnsharded(
- opCtx,
- request().getNamespace(),
- CommandHelpers::filterCommandRequestForPassthrough(cmdObj),
- ReadPreferenceSetting::get(opCtx),
- Shard::RetryPolicy::kNotIdempotent);
- }
-
- private:
- NamespaceString ns() const override {
- return request().getNamespace();
- }
-
- bool supportsWriteConcern() const override {
- return true;
- }
-
- void doCheckAuthorization(OperationContext* opCtx) const override {
- uassert(ErrorCodes::Unauthorized,
- "Unauthorized",
- AuthorizationSession::get(opCtx->getClient())
- ->isAuthorizedForActionsOnResource(
- ResourcePattern::forExactNamespace(request().getNamespace()),
- ActionType::createIndex));
- }
- };
-
-} setCommitQuorumCmd;
-
-} // namespace
-} // namespace mongo