diff options
3 files changed, 0 insertions, 33 deletions
diff --git a/src/mongo/db/s/config/configsvr_refine_collection_shard_key_command.cpp b/src/mongo/db/s/config/configsvr_refine_collection_shard_key_command.cpp index 58674d0212b..ce1065ddb0c 100644 --- a/src/mongo/db/s/config/configsvr_refine_collection_shard_key_command.cpp +++ b/src/mongo/db/s/config/configsvr_refine_collection_shard_key_command.cpp @@ -29,15 +29,12 @@ #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kSharding -#include "mongo/platform/basic.h" - #include "mongo/db/audit.h" #include "mongo/db/auth/authorization_session.h" #include "mongo/db/commands.h" #include "mongo/db/commands/feature_compatibility_version.h" #include "mongo/db/repl/repl_client_info.h" #include "mongo/db/s/config/sharding_catalog_manager.h" -#include "mongo/db/s/dist_lock_manager.h" #include "mongo/db/s/shard_key_util.h" #include "mongo/logv2/log.h" #include "mongo/s/grid.h" @@ -57,8 +54,6 @@ public: using InvocationBase::InvocationBase; void typedRun(OperationContext* opCtx) { - const NamespaceString& nss = ns(); - uassert(ErrorCodes::IllegalOperation, "_configsvrRefineCollectionShardKey can only be run on config servers", serverGlobalParams.clusterRole == ClusterRole::ConfigServer); @@ -73,27 +68,6 @@ public: "downgraded", !fcvRegion->isUpgradingOrDowngrading()); - const boost::optional<bool>& isFromPrimaryShard = request().getIsFromPrimaryShard(); - if (isFromPrimaryShard && *isFromPrimaryShard) { - // If the request has been received from the primary shard, the distributed lock has - // already been acquired. - return _internalRun(opCtx); - } - - // TODO SERVER-54810 don't acquire distributed lock on CSRS after 5.0 has branched out. - // The request has been received from a last-lts router, acquire distlocks on the - // namespace's database and collection. - DistLockManager::ScopedDistLock dbDistLock(uassertStatusOK( - DistLockManager::get(opCtx)->lock(opCtx, - nss.db(), - "refineCollectionShardKey", - DistLockManager::kDefaultLockTimeout))); - DistLockManager::ScopedDistLock collDistLock(uassertStatusOK( - DistLockManager::get(opCtx)->lock(opCtx, - nss.ns(), - "refineCollectionShardKey", - DistLockManager::kDefaultLockTimeout))); - _internalRun(opCtx); } diff --git a/src/mongo/db/s/refine_collection_shard_key_coordinator.cpp b/src/mongo/db/s/refine_collection_shard_key_coordinator.cpp index d56ef28f19f..2edc46ccf38 100644 --- a/src/mongo/db/s/refine_collection_shard_key_coordinator.cpp +++ b/src/mongo/db/s/refine_collection_shard_key_coordinator.cpp @@ -95,9 +95,6 @@ ExecutorFuture<void> RefineCollectionShardKeyCoordinator::_runImpl( ConfigsvrRefineCollectionShardKey configsvrRefineCollShardKey( nss(), _newShardKey.toBSON(), cm.getVersion().epoch()); configsvrRefineCollShardKey.setDbName(nss().db().toString()); - // TODO SERVER-54810 don't set `setIsFromPrimaryShard` once 5.0 becomes last-LTS - configsvrRefineCollShardKey.setIsFromPrimaryShard(true); - auto configShard = Grid::get(opCtx)->shardRegistry()->getConfigShard(); try { diff --git a/src/mongo/s/request_types/refine_collection_shard_key.idl b/src/mongo/s/request_types/refine_collection_shard_key.idl index 60fc4727be2..3bff6d38279 100644 --- a/src/mongo/s/request_types/refine_collection_shard_key.idl +++ b/src/mongo/s/request_types/refine_collection_shard_key.idl @@ -66,7 +66,3 @@ commands: description: "The expected epoch of the namespace provided to refineCollectionShardKey." optional: false - # TODO SERVER-54810 remove the following field once 5.0 becomes last-LTS - isFromPrimaryShard: - type: bool - optional: true |