-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
-
ALL
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.
- duplicates
-
SERVER-84180 refineCollectionShardKey does not rewrite the new shard key for time-series collections
- Backlog