[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: |
|
||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| 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: GitOrigin-RevId: b84a34989edeba13f83348f6a0e2ff91fa8ed655 |
| 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. |