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

Store the collection UUIDs in the CatalogCache

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0-rc1
    • Affects Version/s: None
    • Component/s: Replication, Sharding
    • None
    • Fully Compatible
    • Repl 2017-10-02, Repl 2017-10-23

      When you call CatalogCache::getCollectionRoutingInfo(), the result should include the collection UUID.

      This is needed for the change streams project, so that when parsing the shard key from an insert entry, we can be sure we have the correct shard key for the collection according to its UUID. We wish to avoid errors where if a collection is dropped and recreated with a different shard key, we extract the wrong shard key from the insert entry.

      This can be accomplished by including the UUID in the CollectionAndChangedChunks and copying it into the ChunkManager in refreshCollectionRoutingInfo().

      On a primary, we populate CollectionAndChangedChunks in getChangedChunks(). We can copy the UUID from the CollectionType into the CollectionAndChangedChunks in that function.

      On a secondary, we populate the CollectionAndChangedChunks from the shard server's config.collections collection in getPersistedMetadataSinceVersion(). Unfortunately, the shard server's config.collections collection does not include the UUID. In 3.8, we intend to have the _id be the UUID. However, for 3.6, we have approval from kaloian.manassiev and dianna.hohensee to add an extra optional field for the UUID.

            Assignee:
            nathan.myers Nathan Myers
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: