[SERVER-41943] Validate the given namespace for refineCollectionShardKey Created: 26/Jun/19  Updated: 29/Oct/23  Resolved: 03/Jul/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Task Priority: Major - P3
Reporter: Jack Mulrow Assignee: James Heppenstall (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2019-07-01, Sharding 2019-07-15
Participants:

 Description   

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).


 Comments   
Comment by Githook User [ 03/Jul/19 ]

Author:

{'name': 'Jamie Heppenstall', 'email': 'jamie.heppenstall@mongodb.com', 'username': 'JamesHeppenstall'}

Message: SERVER-41943 Validate the given namespace for refineCollectionShardKey
Branch: master
https://github.com/mongodb/mongo/commit/558bc6285f0410c9d48fb491173212408bc6b48d

Generated at Thu Feb 08 04:59:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.