Insert to a viewless timeseries collection by its UUID returns CollectionUUIDMismatch

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 8.2.0-rc0
    • Component/s: None
    • None
    • Storage Execution
    • ALL
    • Hide

      no_passthrough test:

      const conn =
          MongoRunner.runMongod({setParameter: {featureFlagCreateViewlessTimeseriesCollections: 1}});
      const db = conn.getDB("test");
      db.createCollection("ts", {timeseries: {timeField: "t"}});
      const uuid = db.getCollectionInfos({name: "ts"})[0].info.uuid;
      assert.commandWorked(
          db.runCommand({insert: "ts", documents: [{t: ISODate()}], collectionUUID: uuid}));
      MongoRunner.stopMongod(conn);
       
      Show
      no_passthrough test: const conn = MongoRunner.runMongod({setParameter: {featureFlagCreateViewlessTimeseriesCollections: 1}}); const db = conn.getDB("test"); db.createCollection("ts", {timeseries: {timeField: "t"}}); const uuid = db.getCollectionInfos({name: "ts"})[0].info.uuid; assert.commandWorked( db.runCommand({insert: "ts", documents: [{t: ISODate()}], collectionUUID: uuid})); MongoRunner.stopMongod(conn);
    • Storage Execution 2025-06-23
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • 0

      Since viewless timeseries collection have an UUID, it should be possible to insert to it specifying the collectionUUID parameter on the insert command line this:

      db.runCommand({
          "insert": "ts",
          "documents": [{ "t": ISODate() }],
          "collectionUUID": UUID("a1b2c3d4-e5f6-7890-1234-567890abcdef")
      });
      

       

      However, currently this fails with a CollectionUUIDMismatch error with expectedCollection being the same as actualCollection:

      {
          "ok" : 0,
          "errmsg" : "time-series insert failed: test.ts :: caused by :: Collection UUID does not match that specified",
          "code" : 361,
          "codeName" : "CollectionUUIDMismatch",
          "db" : "test",
          "collectionUUID" : UUID("a1b2c3d4-e5f6-7890-1234-567890abcdef"),
          "expectedCollection" : "ts",
          "actualCollection" : "ts"
      }
       

      This case should be tested by the timeseries_collection_uuid.js test.

            Assignee:
            Ayesha Islam
            Reporter:
            Joan Bruguera Micó
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: