[SERVER-53105] Remove namespace field from config.chunks Created: 30/Nov/20  Updated: 29/Oct/23  Resolved: 16/Feb/21

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

Type: Task Priority: Major - P3
Reporter: Pierlauro Sciarelli Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: PM-1965-Milestone-0-Metadata-Format
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File 0001-SERVER-53105-Read-chunks-with-snapshot-read-concern-.patch    
Issue Links:
Depends
depends on SERVER-54102 Noop write for afterClusterTime/atClu... Closed
depends on SERVER-54167 configOpTime can become ahead of Vect... Closed
depends on SERVER-52767 Handle collectionUUID in config.chunk... Closed
is depended on by SERVER-53106 Preserve chunks entries upon sharded ... Closed
Problem/Incident
causes SERVER-54345 Check for leftover data on shard coll... Closed
causes SERVER-56761 Catalog cache of performance tests st... Closed
Related
related to SERVER-54579 Complete TODO listed in SERVER-53105 Closed
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 0

 Description   

Following the addition of collection uuids in config.chunks documents, it is possible to get rid of the ns field as long as there is no downgrade.

  • Amend SERVER-52767 downgrade/upgrade hooks to add/remove ns to the documents
  • Change ChunkType::NS queries currently targeting by namespace to target by (namespace || uuid) && epoch in order to ensure chunk operations compatibility during downgrade/upgrade (nss || uuid) and to be sure to don't pick chunks from a recreated collection following a rename (&& epoch)
  • Change the CatalogCacheLoader to read config.chunks with a snapshot read concern at the clusterTime the previous read to config.collections returned.
  • In the ConfigServerCatalogCacheLoader, when reading config.chunks, pass a hint to enforce the use of either the 'ns_1_lasmod_1' or 'uuid_1_lastmod_1' index to ensure that config.chunks has a format consistent with what we inferred from the previous read to config.collections.
  • If at the time of reading the config.collections we find that in has a 'timestamp', then we will target the chunks by 'collectionUUID'. Otherwise, we will keep targeting the chunks by 'ns'.

Testing:

  • Add a unit test into initial_split_policy_test.cpp to assert that either namespace either UUID is present in the chunks document
  • Add unit tests around the new query logic


 Comments   
Comment by Githook User [ 17/Feb/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-54579: Complete TODO listed in SERVER-53105
Branch: master
https://github.com/mongodb/mongo/commit/d4ff82a11019aef87701db9053499461601e75d6

Comment by Githook User [ 16/Feb/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-53105: Pass 'hint' when querying config.chunks in ConfigServerCatalogCacheLoader
Branch: master
https://github.com/mongodb/mongo/commit/24a3d286b9c3c7c85af127f3819e2757e175a03d

Comment by Githook User [ 01/Feb/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-53105: Target chunks by collectionUUID
Branch: master
https://github.com/mongodb/mongo/commit/522299492aa5a78339aa8ebb07e88e567ba125d7

Comment by Githook User [ 22/Jan/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-53105: Amend tests that target config.chunks by ns to target by ns or uuid depending on collection timestamp
Branch: master
https://github.com/mongodb/mongo/commit/f3617ccb88b713884ae8e3853eefa42e84feda6d

Generated at Thu Feb 08 05:29:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.