Operational Defect Database

BugZero found this defect 157 days ago.

MongoDB | 2524997

refineCollectionShardKey does not rewrite the new shard key for time-series collections

Last update date:

3/15/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

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.

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Open

Learn More

Search:

...