[SERVER-70917] Reevaluate the global index catalog persistence format Created: 27/Oct/22  Updated: 26/Oct/23

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

Type: Improvement Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Backlog - Catalog and Routing
Resolution: Unresolved Votes: 0
Labels: oldshardingemea
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Catalog and Routing
Participants:

 Description   

Currently in the config.shard.indexes and config.csrs.indexes we store one document per index, however, considering there won't be too many documents, and trying to make the operations easier to do, we should consider having just one document per collection, and having the indexes as a key-value pair having the index name as the key, that is, instead of:

{
    _id: <uuid>_<indexName1>, 
    indexName: <indexName1>, 
    collectionUUID: <uuid>, 
    keyPattern: <keyPattern1>,
    options: <options>
},
{
    _id: <uuid>_<indexName2>, 
    indexName: <indexName2>,
    keyPattern: <keyPattern2>,
    options: <options>
},
...

Having:

{
    _id: <uuid>,
    <indexName1>: {
        indexName: <indexName1>, 
        collectionUUID: <uuid>, 
        keyPattern: <keyPattern1>,
        options: <options>
    },
    <indexName2>: {
        indexName: <indexName2>,
        keyPattern: <keyPattern2>,
        options: <options>
    },
   ...
}

This would make other operations easier, like for example, the rename.



 Comments   
Comment by Connie Chen [ 13/Feb/23 ]

Originally was part of PM-2583, but placing into PM-2852 for reconsideration when we enable the feature flag and use this API.

Comment by Garaudy Etienne [ 13/Feb/23 ]

If accessing global indexes during refresh due to stale index data mongos is too expensive, we could do this optimization to speed it up.

Generated at Thu Feb 08 06:17:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.