Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-71158

getShardDistribution does not properly support sharded timeseries collections

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 6.0.2
    • Component/s: None
    • Sharding EMEA
    • ALL
    • Hide

      1. Create a shareded timeseries collection
      2. Invoke getShardedDistribution() against the namespace - this will return "Collection ts is not sharded"
      3. Invoke getShardedDistribution() against the corresponding system.buckets.ts collection - this will yield NaN for docs per chunk and docs (total)

      Show
      1. Create a shareded timeseries collection 2. Invoke getShardedDistribution() against the namespace - this will return "Collection ts is not sharded" 3. Invoke getShardedDistribution() against the corresponding system.buckets.ts collection - this will yield NaN for docs per chunk and docs (total)
    • Sharding EMEA 2023-04-17, Sharding EMEA 2023-05-01, Sharding EMEA 2023-05-15

      As of v6.0.2 the getShardDistribution() is not able to recognize a sharded timeseries collection:

      [direct: mongos] test> db.weather.getShardDistribution()
      MongoshInvalidInputError: [SHAPI-10001] Collection weather is not sharded
      

      If invoked against the buckets collection, this will show some details, but a number of fields yield NaN:

      [direct: mongos] test> db.system.buckets.weather.getShardDistribution()
      Shard shard01 at shard01/localhost:27018
      {
        data: '718B',
        docs: undefined,
        chunks: 1,
        'estimated data per chunk': '718B',
        'estimated docs per chunk': NaN
      }
      ---
      Totals
      {
        data: '718B',
        docs: NaN,
        chunks: 1,
        'Shard shard01': [ '100 % data', 'NaN % docs in cluster', '0B avg obj size on shard' ]
      }
      

      This appears to be an oversight as the expectation is that getShardDistribution() should be able to recognize a sharded timeseries collection.

            Assignee:
            antonio.fuschetto@mongodb.com Antonio Fuschetto
            Reporter:
            dmitry.ryabtsev@mongodb.com Dmitry Ryabtsev
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: