Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-70090

Replace CollectionGeneration with UUID in CollectionIndexes

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • 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.

            Assignee:
            allison.easton@mongodb.com Allison Easton
            Reporter:
            allison.easton@mongodb.com Allison Easton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: