$listClusterCatalog reports wrong sharding metadata for timeseries collections

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 8.0.0, 8.1.0, 8.2.0
    • Component/s: None
    • Catalog and Routing
    • ALL
    • Hide

      Create a sharded collection

      sh.shardCollection("test.ts", {'my_meta.sensorId': 1}, false, {timeseries: {metaField: 'my_meta', timeField: 'my_time'}})
      

      Call $listClusterCatalog:

      db.aggregate([{ $listClusterCatalog: {}}, {$match: {ns: 'test.ts'}}, {$project: {'options.validator': 0}}]);
      
      [
        {
          ns: 'test.ts',
          db: 'test',
          type: 'timeseries',
          options: {
            timeseries: {
              timeField: 'my_time',
              metaField: 'my_meta',
              granularity: 'seconds',
              bucketMaxSpanSeconds: 3600
            }
          },
          info: { readOnly: false },
          sharded: false
        }
      ]
      
      Show
      Create a sharded collection sh.shardCollection("test.ts", {'my_meta.sensorId': 1}, false, {timeseries: {metaField: 'my_meta', timeField: 'my_time'}}) Call $listClusterCatalog: db.aggregate([{ $listClusterCatalog: {}}, {$match: {ns: 'test.ts'}}, {$project: {'options.validator': 0}}]); [ { ns: 'test.ts', db: 'test', type: 'timeseries', options: { timeseries: { timeField: 'my_time', metaField: 'my_meta', granularity: 'seconds', bucketMaxSpanSeconds: 3600 } }, info: { readOnly: false }, sharded: false } ]
    • 🟥 DDL
    • None
    • None
    • None
    • None
    • None
    • None

      $listClusterCatalog for a timeseries view namespace reports the sharding metadata of the view instead of the one of the system.buckets collection. For instance it always report the view namespace as not sharded whereas the timeseries collection is actually sharded. Moreover, it does not report the shard key for a sharded timeseries collection.

            Assignee:
            Unassigned
            Reporter:
            Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: