[Test only] Implicitly sharding a collection upon db.createCollection only works for timeseries

XMLWordPrintableJSON

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

      Run the following test on the sharded_collections_jscore_passthrough suite:

      db.createCollection("standardColl");
      db.createCollection("timeseriesColl", {timeseries: {timeField: 'time'}});
      
      const colls = db.aggregate([{$listClusterCatalog: {}}, {$project: {ns: 1, sharded: 1}}]).toArray();
      jsTestLog("Print sharding state of all collections: " + tojson(colls)); 
      Show
      Run the following test on the  sharded_collections_jscore_passthrough suite: db.createCollection("standardColl"); db.createCollection("timeseriesColl", {timeseries: {timeField: 'time'}}); const colls = db.aggregate([{$listClusterCatalog: {}}, {$project: {ns: 1, sharded: 1}}]).toArray(); jsTestLog("Print sharding state of all collections: " + tojson(colls));
    • 3
    • None
    • 3
    • TBD
    • 🟥 DDL
    • None
    • None
    • None
    • None
    • None
    • None
    • 0

      Some test suites implicitly shard collections to increase the coverage of sharded collections by overriding some functions in implicitly_shard_accessed_collections.js.

      One of the overridden functions is DB.prototype.createCollection. However, it turns out that this function only shards timeseries collections, when it should shard all types of collections.

      The goal of this ticket is to fix the overridden DB.prototype.createCollection function in implicitly_shard_accessed_collections.js to shard all types of collections that can be sharded.

            Assignee:
            Unassigned
            Reporter:
            Silvia Surroca
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: