[SERVER-70090] Replace CollectionGeneration with UUID in CollectionIndexes Created: 29/Sep/22  Updated: 29/Oct/23  Resolved: 24/Oct/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Allison Easton Assignee: Allison Easton
Resolution: Fixed Votes: 0
Labels: PM-2583-Milestone-2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2022-10-03, Sharding EMEA 2022-10-17, Sharding EMEA 2022-10-31
Participants:

 Description   

Currently the CollectionGeneration is present in the CollectionIndexes class to ensure that the timestamp from the index version is from the correct instance of the collection. However, the CollectionGeneration can be modified by ddl operations that commit only on the config server (such as refine shard key). This means that the index version on the shard would become stale, violating our assumption that the index information on the shard is always correct.

In order to avoid having to do extra work to keep the index version up to date during ddl operations or onShardVersionMismatch, we will instead replace the CollectionGeneration in the CollectionInexes with the UUID of the collection. The shard version being serialized for operations will still contain only the collection generation, the placement version, and the index version. When checking the shard version for an operation, we will check that the CollectionGeneration from the placement information matches the received version and that the UUID from the index information matches that of the placement version. Because a change of the UUID implies a change in the CollectionGeneration, this will allow us to perform correct shard versioning checks without having to maintain the CollectionGeneration in the CollectionIndexes.



 Comments   
Comment by Githook User [ 24/Oct/22 ]

Author:

{'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}

Message: SERVER-70090 Replace CollectionGeneration with UUID in CollectionIndexes
Branch: master
https://github.com/mongodb/mongo/commit/6faa57abb9c9c466531ee008904989ca0cc3b4f4

Generated at Thu Feb 08 06:15:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.