-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Environment:OS:
node.js / npm versions:
Additional info:
-
3
-
Iteration Light Year, Iteration Milky Way
-
Not Needed
When the getShardDistribution command is invoked on a sharded time series collection, the output says that the collection is not actually sharded:
[direct: mongos] mydb> db.weather.getShardDistribution() MongoshInvalidInputError: [SHAPI-10001] Collection weather is not sharded
On the other hand, if the user invokes the same command on the related bucket collection, it produces an incorrect output:
[direct: mongos] mydb> db.system.buckets.weather.getShardDistribution() TypeError: Cannot use 'in' operator to search for 'toNumber' in undefined
The problems that I see are essentially two:
- Obviously, the incorrect command result on the bucket collection
- User are typically unaware of how time series collections are implemented and therefore are unaware of bucket collections
Since the user has created a sharded time series collection, the expectation is that calling the getShardDistribution command on that collection will report the correct sharding information, which is actually obtained from the related (under the hood) bucket collection.
To do that, the command should:
- Check that the collection is actually sharded by querying the config.collections collection
- If the collection is not present (because it's probably a time series), check that the related bucket collection is available in the config.collections collection
- Retrieve shard distribution information on the found sharded collection
- is depended on by
-
SERVER-71158 getShardDistribution does not properly support sharded timeseries collections
- Closed