Operational Defect Database

BugZero found this defect 44 days ago.

MongoDB | 2634176

refineCollectionShardKey does not translate metaField

Last update date:

4/6/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

The underlying system.buckets.collections always has a metaField value of "meta". When operations are performed on the time-series view, the metaField name of the view (which could be anything) should be translated to "meta" so that the command could then be performed on the underlying buckets collection internally. It appears that we do not do this for refineCollectionShardKey. So, if we created a time-series collection with metaField: "metadata", we can successfully shard it on, for example, {"metadata.subField1" : hashed} but if we try to refine the shard key to be, for example: {"metadata.subField1" : "hashed", "metadata.subField2": 1} we get the following error: refineCollectionShardKey shard key { metadata.subField1: "hashed", metadata.subField2: 1 } does not extend the current shard key { meta.subField1: "hashed" If the view's metaField was "meta", this command would work fine, which is why I believe we haven't caught this issue before. We should make sure that the metaField name is translated so that users can run refineCollectionShardKey on their view without worrying about the underlying metaField name.

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Needs Scheduling

Learn More

Search:

...