[SERVER-55096] Indexes on time-series collections need to inherit collation from collection Created: 09/Mar/21  Updated: 29/Oct/23  Resolved: 01/Apr/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Louis Williams Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-55721 Complete TODO listed in SERVER-55096 Closed
related to SERVER-55708 remove unused parameter from IndexDes... Closed
is related to SERVER-55591 Store time-series collection metadata... Closed
is related to SERVER-54050 time-series collections should use th... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-04-05
Participants:

 Description   

New indexes need to inherit the default collation from the time-series collection. This is consistent with behavior for regular collections.

This is incorrect behavior:

> db.createCollection('ts', {timeseries: {timeField: 'time', metaField: 'meta'}, collation: {locale: 'en', strength: 1, numericOrdering: true}})
{ "ok" : 1 }
> db.ts.createIndex({meta: 1})
{
        "numIndexesBefore" : 0,
        "numIndexesAfter" : 1,
        "createdCollectionAutomatically" : false,
        "ok" : 1
}
> db.runCommand({listIndexes: "ts"})
{
        "cursor" : {
                "id" : NumberLong(0),
                "ns" : "test.ts",
                "firstBatch" : [
                        {
                                "v" : 2,
                                "key" : {
                                        "meta" : 1
                                },
                                "name" : "meta_1"
                        }
                ]
        },
        "ok" : 1
}

Notice that the new index does not have a collation.



 Comments   
Comment by Githook User [ 01/Apr/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-55096 add js test for timeseries indexes with collation
Branch: master
https://github.com/mongodb/mongo/commit/38c0f1e107f1a582624280dcb7d85dcb17efb472

Comment by Benety Goh [ 31/Mar/21 ]

After SERVER-55591, the underlying buckets collection has the same collation as the time-series collection, so we no longer need to look up the collation from the time-series collection to add to the index specs before passing to the index builder for the buckets collection.

Comment by Benety Goh [ 31/Mar/21 ]

Previously in SERVER-54050, we had to consider the time-series collection's view in order to compare metadata for buckets.

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