[SERVER-84180] refineCollectionShardKey does not rewrite the new shard key for time-series collections Created: 14/Dec/23  Updated: 06/Feb/24

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

Type: Bug Priority: Major - P3
Reporter: Gil Alon Assignee: Jordi Serra Torrens
Resolution: Unresolved Votes: 0
Labels: car-investigation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-85243 Add FCV upgrade/downgrade test for sh... Blocked
is depended on by SERVER-84682 Create a new version of refineCollect... Closed
Related
related to SERVER-84741 Ensure the shard key is rewritten for... Backlog
is related to SERVER-77112 shardCollection and createIndex creat... Closed
Assigned Teams:
Catalog and Routing
Operating System: ALL
Sprint: CAR Team 2024-01-08, CAR Team 2024-01-22, CAR Team 2024-02-05, CAR Team 2024-02-19
Participants:

 Description   

refineCollectionShardKey can be called on a time-series collection to change the shardKey from {metaField: 1} to {metaField: 1, timeField: 1}. However, we hit this error when trying to do so. When we compare the old key and the new key the old key is correctly rewritten for a time-series collection, but the new key is not rewritten, leading to the error. There is an example of this error in the comments.

We do have a test that covers this case, but it did not show up in testing, because the tests have the metaField named "meta", so we didn't catch the error where we are not rewriting the shardKey. The test is here and should avoid using "meta" as the metaField name. We noticed this while investigating SERVER-77112.


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