diff options
| author | Marcos José Grillo Ramirez <marcos.grillo@mongodb.com> | 2023-07-25 11:38:16 +0000 |
|---|---|---|
| committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-08-17 21:59:24 +0000 |
| commit | 26b3a73aefeeeed6028c9310707d847a08a9454e (patch) | |
| tree | b7d15aa6112ce21ba5dfef31a98f2531d4b6ebe4 | |
| parent | 4b26345ac820515c049558a0b6230123305e93ff (diff) | |
SERVER-78696 Change collmod participant behavior to clear sharding metadata instead of forcing a refresh
(cherry picked from commit f6628e802ff035ca40fbfdba81f35734ff5bb901)
| -rw-r--r-- | src/mongo/db/s/shardsvr_collmod_participant_command.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mongo/db/s/shardsvr_collmod_participant_command.cpp b/src/mongo/db/s/shardsvr_collmod_participant_command.cpp index 5ac61e8d010..9c65322a546 100644 --- a/src/mongo/db/s/shardsvr_collmod_participant_command.cpp +++ b/src/mongo/db/s/shardsvr_collmod_participant_command.cpp @@ -95,14 +95,10 @@ public: "collMod unblocking should always be on a time-series collection", timeseries::getTimeseriesOptions(opCtx, ns(), true)); auto bucketNs = ns().makeTimeseriesBucketsNamespace(); - - try { - forceShardFilteringMetadataRefresh(opCtx, bucketNs); - } catch (const DBException&) { - // If the refresh fails, then set the placement version to UNKNOWN and let a - // future operation to refresh the metadata. - // TODO (SERVER-71444): Fix to be interruptible or document exception. - UninterruptibleLockGuard noInterrupt(opCtx->lockState()); // NOLINT. + { + // Clear the filtering metadata before releasing the critical section to prevent + // scenarios where a stepDown/stepUp will leave the node with wrong metadata. + // Cleanup on secondary nodes is performed by the release of the section. AutoGetCollection autoColl(opCtx, bucketNs, MODE_IX); CollectionShardingRuntime::assertCollectionLockedAndAcquireExclusive(opCtx, bucketNs) |
