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.
SERVER-52767downgrade/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'.
- 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