From 3b106406facd601fff4f4607db74af626adab4ad Mon Sep 17 00:00:00 2001 From: Max Hirschhorn Date: Wed, 30 Mar 2022 12:21:16 +0000 Subject: Revert "SERVER-64540 Add feature flag just for using txn API for updating document shard key value" This reverts commit 8cf8aae5cb3ce6892ad1714043db6b66aafc9fbc. --- src/mongo/s/commands/SConscript | 1 - .../s/commands/cluster_find_and_modify_cmd.cpp | 4 +-- src/mongo/s/commands/cluster_write_cmd.cpp | 5 +-- ...hard_key_using_transaction_api_feature_flag.idl | 41 ---------------------- 4 files changed, 5 insertions(+), 46 deletions(-) delete mode 100644 src/mongo/s/commands/update_document_shard_key_using_transaction_api_feature_flag.idl diff --git a/src/mongo/s/commands/SConscript b/src/mongo/s/commands/SConscript index aa268681c36..adbc0a3c03c 100644 --- a/src/mongo/s/commands/SConscript +++ b/src/mongo/s/commands/SConscript @@ -162,7 +162,6 @@ env.Library( 'cluster_write_cmd.cpp', 'document_shard_key_update_util.cpp', 'strategy.cpp', - 'update_document_shard_key_using_transaction_api_feature_flag.idl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/commands/core', diff --git a/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp index 2530c8b3772..5931b4b1d73 100644 --- a/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp +++ b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp @@ -41,6 +41,7 @@ #include "mongo/db/commands.h" #include "mongo/db/commands/update_metrics.h" #include "mongo/db/fle_crud.h" +#include "mongo/db/internal_transactions_feature_flag_gen.h" #include "mongo/db/ops/write_ops_gen.h" #include "mongo/db/query/collation/collator_factory_interface.h" #include "mongo/db/storage/duplicate_key_error_info.h" @@ -56,7 +57,6 @@ #include "mongo/s/commands/cluster_explain.h" #include "mongo/s/commands/document_shard_key_update_util.h" #include "mongo/s/commands/strategy.h" -#include "mongo/s/commands/update_document_shard_key_using_transaction_api_feature_flag_gen.h" #include "mongo/s/grid.h" #include "mongo/s/multi_statement_transaction_requests_sender.h" #include "mongo/s/session_catalog_router.h" @@ -541,7 +541,7 @@ private: } if (responseStatus.code() == ErrorCodes::WouldChangeOwningShard) { - if (feature_flags::gFeatureFlagUpdateDocumentShardKeyUsingTransactionApi.isEnabled( + if (feature_flags::gFeatureFlagInternalTransactions.isEnabled( serverGlobalParams.featureCompatibility)) { auto parsedRequest = write_ops::FindAndModifyCommandRequest::parse( IDLParserErrorContext("ClusterFindAndModify"), cmdObj); diff --git a/src/mongo/s/commands/cluster_write_cmd.cpp b/src/mongo/s/commands/cluster_write_cmd.cpp index 9deae5e4e91..e7fb4233e00 100644 --- a/src/mongo/s/commands/cluster_write_cmd.cpp +++ b/src/mongo/s/commands/cluster_write_cmd.cpp @@ -35,6 +35,7 @@ #include "mongo/client/remote_command_targeter.h" #include "mongo/db/catalog/document_validation.h" #include "mongo/db/curop.h" +#include "mongo/db/internal_transactions_feature_flag_gen.h" #include "mongo/db/pipeline/lite_parsed_pipeline.h" #include "mongo/db/stats/counters.h" #include "mongo/db/storage/duplicate_key_error_info.h" @@ -48,7 +49,6 @@ #include "mongo/s/cluster_write.h" #include "mongo/s/commands/cluster_explain.h" #include "mongo/s/commands/document_shard_key_update_util.h" -#include "mongo/s/commands/update_document_shard_key_using_transaction_api_feature_flag_gen.h" #include "mongo/s/grid.h" #include "mongo/s/session_catalog_router.h" #include "mongo/s/transaction_router.h" @@ -288,7 +288,8 @@ bool handleWouldChangeOwningShardError(OperationContext* opCtx, bool updatedShardKey = false; boost::optional upsertedId; - if (feature_flags::gFeatureFlagUpdateDocumentShardKeyUsingTransactionApi.isEnabled( + + if (feature_flags::gFeatureFlagInternalTransactions.isEnabled( serverGlobalParams.featureCompatibility)) { if (isRetryableWrite) { if (MONGO_unlikely(hangAfterThrowWouldChangeOwningShardRetryableWrite.shouldFail())) { diff --git a/src/mongo/s/commands/update_document_shard_key_using_transaction_api_feature_flag.idl b/src/mongo/s/commands/update_document_shard_key_using_transaction_api_feature_flag.idl deleted file mode 100644 index 8865c16559d..00000000000 --- a/src/mongo/s/commands/update_document_shard_key_using_transaction_api_feature_flag.idl +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2022-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. -# - -# Feature flag for enabling usage of the transaction api for update findAndModify and update commands that change a document's shard key. - -global: - cpp_namespace: "mongo::feature_flags" - -imports: - - "mongo/idl/basic_types.idl" - -feature_flags: - featureFlagUpdateDocumentShardKeyUsingTransactionApi: - description: Feature flag to enable usage of the transaction api for update findAndModify and update commands that change a document's shard key. - cpp_varname: gFeatureFlagUpdateDocumentShardKeyUsingTransactionApi - default: false -- cgit v1.2.1