BugZero found this defect 44 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
4/6/2024
MongoDB Server
No affected releases provided.
No fixed releases provided.
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.