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

Validate the given namespace for refineCollectionShardKey

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • Sharding 2019-07-01, Sharding 2019-07-15

      As described in this section of the design document, _configsvrRefineCollectionShardKey should validate the following things about the namespace given to refineCollectionShardKey:

      1. The namespace must be sharded.
      2. The namespace must have the same epoch as the router that receivedĀ refineCollectionShardKey had in its routing table cache.

      Both of these checks should happen after taking distributed locks on the namespace's database and collection.

      As part of this ticket, an epoch type should be added as a new non-optional field to the _configsvrRefineCollectionShardKey IDL type and mongos should include the epoch of the namespace in its routing table (i.e. ChunkManager) when sendingĀ _configsvrRefineCollectionShardKey.

      The following test cases should be added to jstests/sharding/refine_collection_shard_key_basic.js:

      • A refine will fail if the namespace is not sharded.
      • A refine will fail if the mongos receiving the command believes the given namespace has a different epoch than the namespace currently has (e.g. the namespace has been dropped and re-sharded without the mongos refreshing its metadata).

            Assignee:
            jamie.heppenstall@mongodb.com James Heppenstall (Inactive)
            Reporter:
            jack.mulrow@mongodb.com Jack Mulrow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: