[SERVER-77112] shardCollection and createIndex create different indexes on time-series buckets collections Created: 12/May/23  Updated: 16/Jan/24  Resolved: 16/Jan/24

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

Type: Bug Priority: Major - P3
Reporter: Gil Alon Assignee: Gil Alon
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File SERVER-77112.js    
Issue Links:
Backports
Depends
is depended on by COMPASS-7579 Investigate changes in SERVER-77112: ... Needs Triage
Documented
is documented by DOCS-16588 [SERVER] Investigate changes in SERVE... Backlog
Related
related to SERVER-84180 refineCollectionShardKey does not rew... Open
related to SERVER-84741 Ensure the shard key is rewritten for... Backlog
related to SERVER-85243 Add FCV upgrade/downgrade test for sh... Blocked
is related to SERVER-84682 Create a new version of refineCollect... Closed
Assigned Teams:
Query Integration
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0
Sprint: QI 2023-06-26, QI 2023-07-10, QI 2023-07-24, QI 2023-08-07, QI 2023-08-21, QI 2023-09-04, QI 2023-09-18, QI 2023-10-02, QI 2023-10-16, QI 2023-10-30, QI 2023-11-13, QI 2023-11-27, QI 2023-12-11, QI 2023-12-25, QI 2024-01-08, QI 2024-01-22
Participants:

 Description   

If you create a sharded time-series collection using the shardCollection command that has a shardKey {timeField: 1} the resulting index in the buckets collection will have the key { control.min.time: 1.0 }.

However, calling the createIndex command on a sharded time-series collection with the same key {timeField: 1} results in an index in the buckets collection with the key { control.min.time: 1.0, control.max.time: 1.0 }.

These two indexes have the same key for the view backing the buckets collection.

We should investigate if these two commands should produce indexes with the same keys for the buckets collection. Here is a file to reproduce this SERVER-77112.js



 Comments   
Comment by Githook User [ 16/Jan/24 ]

Author:

{'name': 'Gil Alon', 'email': '47804748+galon1@users.noreply.github.com', 'username': 'galon1'}

Message: SERVER-77112 Convert timeseries shard key on the buckets collection using time-series index conversion helper functions (#17677)

GitOrigin-RevId: b84a34989edeba13f83348f6a0e2ff91fa8ed655
Branch: master
https://github.com/mongodb/mongo/commit/4721c511dfac5244f02df32560913ce7c90cf291

Comment by Gil Alon [ 16/Jan/24 ]

I'm not sure if we want to backport this. I requested the backport ticket so we can discuss in triage.

Comment by Gil Alon [ 13/Dec/23 ]

We need to also consider how this impacts refineCollectionShardKey. This would also impact reshardCollection, but right now we can't reshard a sharded time-series collection.

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