summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcos Grillo <marcos.grillo@mongodb.com>2024-07-11 15:18:06 +0200
committerMongoDB Bot <mongo-bot@mongodb.com>2024-07-11 14:05:18 +0000
commit191b175a01c7f712b4ef851d584f7e7ba5cee056 (patch)
treefa2c7b042f156a03ca42a6d357a648e581b754d3
parent5a803ade2ce49e5dc1ea18a558eedfd5f8a5b3fc (diff)
SERVER-91997 Prevent holding fcv lock while doing remote request in resharding (#24587)r8.0.0-rc13
GitOrigin-RevId: b5271455825d4af9af540e3dd05ae19963355efb
-rw-r--r--src/mongo/db/s/shardsvr_reshard_collection_command.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mongo/db/s/shardsvr_reshard_collection_command.cpp b/src/mongo/db/s/shardsvr_reshard_collection_command.cpp
index a40e9556448..b6039465378 100644
--- a/src/mongo/db/s/shardsvr_reshard_collection_command.cpp
+++ b/src/mongo/db/s/shardsvr_reshard_collection_command.cpp
@@ -118,15 +118,16 @@ public:
uassert(ErrorCodes::IllegalOperation,
"Can't move an internal resharding collection",
!ns().isTemporaryReshardingCollection());
-
- FixedFCVRegion fixedFcvRegion{opCtx};
- bool isReshardingForTimeseriesEnabled =
- mongo::resharding::gFeatureFlagReshardingForTimeseries.isEnabled(
- fixedFcvRegion->acquireFCVSnapshot());
- uassert(ErrorCodes::IllegalOperation,
- "Can't move a timeseries collection",
- !ns().isTimeseriesBucketsCollection() || isReshardingForTimeseriesEnabled);
-
+ {
+ FixedFCVRegion fixedFcvRegion{opCtx};
+ bool isReshardingForTimeseriesEnabled =
+ mongo::resharding::gFeatureFlagReshardingForTimeseries.isEnabled(
+ fixedFcvRegion->acquireFCVSnapshot());
+ uassert(ErrorCodes::IllegalOperation,
+ "Can't move a timeseries collection",
+ !ns().isTimeseriesBucketsCollection() ||
+ isReshardingForTimeseriesEnabled);
+ }
// TODO (SERVER-88623): re-evalutate the need to track the collection before calling
// into moveCollection
ShardsvrCreateCollectionRequest trackCollectionRequest;