-
Type: Investigation
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Developer Tools
-
Not Needed
SERVER-77112 changes the index on the buckets collection that is created when using the shardCollection command on a time-series collection with the shard key {timeField: 1}. Previously the index with the key {control.min.time: 1} was created, but this was incorrect. Now we create an index with the key {control.min.time: 1, control.max.time: 1}. Additionally, the name of the index is changed to match the name of the index on unsharded collections. Now the name of the index will be "time_1". Previously the name was "control.min.time_1". This change is gated behind the feature flag AuthoritativeShardCollection which is targeted to be enabled in 8.1. Without the feature flag enabled, no changes are expected. I will update these tickets if the feature flag is enabled earlier.
Description of Linked Ticket
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]
- depends on
-
SERVER-77112 shardCollection and createIndex create different indexes on time-series buckets collections
- Closed