diff options
author | Jordi Serra Torrens <jordi.serra-torrens@mongodb.com> | 2021-03-16 14:32:42 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-03-18 10:17:20 +0000 |
commit | 6c3c2cd287996ccc1821b7f04595edc7a4be3104 (patch) | |
tree | 3c05eca8c799bed7dec27d99e0965614ddbe7846 /src/mongo/db/s/config/sharding_catalog_manager.h | |
parent | 1299785257ac51faa99cc8197b4b89ed4502489b (diff) | |
download | mongo-6c3c2cd287996ccc1821b7f04595edc7a4be3104.tar.gz |
SERVER-55146: Bump collection version on any modification of config.collections reshardingFields or allowMigrations fields
Diffstat (limited to 'src/mongo/db/s/config/sharding_catalog_manager.h')
-rw-r--r-- | src/mongo/db/s/config/sharding_catalog_manager.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mongo/db/s/config/sharding_catalog_manager.h b/src/mongo/db/s/config/sharding_catalog_manager.h index f2b0d94b92c..10afc542b35 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager.h +++ b/src/mongo/db/s/config/sharding_catalog_manager.h @@ -283,14 +283,19 @@ public: * In a single transaction, effectively bumps the shard version for each shard in the collection * to be the current collection version's major version + 1 inside an already-running * transaction. - * - * Note: it's the responsibility of the caller to ensure that the list of shards is stable, - * as any shards added after the shard ids have been passed in will be missed. */ - void bumpCollShardVersionsAndChangeMetadataInTxn( + void bumpCollectionVersionAndChangeMetadataInTxn( OperationContext* opCtx, const NamespaceString& nss, - const std::vector<ShardId>& shardIds, + unique_function<void(OperationContext*, TxnNumber)> changeMetadataFunc); + + /** + * Same as bumpCollectionVersionAndChangeMetadataInTxn, but bumps the version for several + * collections in a single transaction. + */ + void bumpMultipleCollectionVersionsAndChangeMetadataInTxn( + OperationContext* opCtx, + const std::vector<NamespaceString>& collNames, unique_function<void(OperationContext*, TxnNumber)> changeMetadataFunc); /** |