-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
-
Sharding EMEA 2022-10-03, Sharding EMEA 2022-10-17, Sharding EMEA 2022-10-31
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.