diff options
author | Allison Easton <allison.easton@mongodb.com> | 2022-05-10 09:42:39 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-10 11:07:14 +0000 |
commit | c6e976d9f67a1b50826784e7a0eda9bfe212dd73 (patch) | |
tree | 0f277ab4dff41941a7bdc37b909d5f03b403d0d8 /src/mongo/db/s/resharding | |
parent | 32192ca71d174999785f5e4f784455d93ecb855c (diff) | |
download | mongo-c6e976d9f67a1b50826784e7a0eda9bfe212dd73.tar.gz |
SERVER-64319 Fix the name hiding issue for usages of ShardingCatalogManager::withTransaction
Diffstat (limited to 'src/mongo/db/s/resharding')
-rw-r--r-- | src/mongo/db/s/resharding/resharding_coordinator_service.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/mongo/db/s/resharding/resharding_coordinator_service.cpp b/src/mongo/db/s/resharding/resharding_coordinator_service.cpp index 7273fea46c5..4bef171e9bc 100644 --- a/src/mongo/db/s/resharding/resharding_coordinator_service.cpp +++ b/src/mongo/db/s/resharding/resharding_coordinator_service.cpp @@ -710,21 +710,24 @@ void writeDecisionPersistedState(OperationContext* opCtx, Timestamp newCollectionTimestamp) { // No need to bump originalNss version because its epoch will be changed. - executeMetadataChangesInTxn(opCtx, [&](OperationContext* opCtx, TxnNumber txnNumber) { - // Update the config.reshardingOperations entry - writeToCoordinatorStateNss(opCtx, metrics, coordinatorDoc, txnNumber); + executeMetadataChangesInTxn( + opCtx, + [&metrics, &coordinatorDoc, &newCollectionEpoch, &newCollectionTimestamp]( + OperationContext* opCtx, TxnNumber txnNumber) { + // Update the config.reshardingOperations entry + writeToCoordinatorStateNss(opCtx, metrics, coordinatorDoc, txnNumber); - // Remove the config.collections entry for the temporary collection - writeToConfigCollectionsForTempNss( - opCtx, coordinatorDoc, boost::none, boost::none, txnNumber); + // Remove the config.collections entry for the temporary collection + writeToConfigCollectionsForTempNss( + opCtx, coordinatorDoc, boost::none, boost::none, txnNumber); - // Update the config.collections entry for the original namespace to reflect the new - // shard key, new epoch, and new UUID - updateConfigCollectionsForOriginalNss( - opCtx, coordinatorDoc, newCollectionEpoch, newCollectionTimestamp, txnNumber); + // Update the config.collections entry for the original namespace to reflect the new + // shard key, new epoch, and new UUID + updateConfigCollectionsForOriginalNss( + opCtx, coordinatorDoc, newCollectionEpoch, newCollectionTimestamp, txnNumber); - updateChunkAndTagsDocsForTempNss(opCtx, coordinatorDoc, newCollectionEpoch, txnNumber); - }); + updateChunkAndTagsDocsForTempNss(opCtx, coordinatorDoc, newCollectionEpoch, txnNumber); + }); } void insertCoordDocAndChangeOrigCollEntry(OperationContext* opCtx, |