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

MetaField is being added to the control block of time-series buckets

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0, 6.3.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v6.3
    • Hide

      1. 
      db.adminCommand(

      {setParameter: 1, timeseriesIdleBucketExpiryMemoryUsageThreshold: 1024}

      )
      2. db.createCollection(
      "coll", {timeseries: {timeField:"time", metaField:"tag"}})
      3.

       const docs = [\{"time": new Date(), "tag": i},...]; // array of 1000 measurements with increasing metaField 
      4. 
      assert.commandWorked(db.runCommand({insert: "coll", documents: docs, ordered: ordered}));
      5.
      // insert where we will reopen previous bucket

      Show
      1.  db.adminCommand( {setParameter: 1, timeseriesIdleBucketExpiryMemoryUsageThreshold: 1024} ) 2. db.createCollection( "coll", {timeseries: {timeField:"time", metaField:"tag"}}) 3.  const docs = [\{"time": new Date(), "tag": i},...] ; // array of 1000 measurements with increasing metaField  4.  assert.commandWorked(db.runCommand({insert: "coll", documents: docs, ordered: ordered})); 5. // insert where we will reopen previous bucket
    • Execution Team 2023-03-06, Execution Team 2023-03-20

      I noticed in jstests/concurrency/fsm_workloads/timeseries_insert_idle_bucket_expiration.js we can arrive to this invalid state:

       

      {
              "_id" : ObjectId("63fe115071dee89626713073"),
              "control" : {
                      "version" : 1,
                      "min" : {
                              "time" : ISODate("2023-02-28T14:36:00Z"),
                              "tag" : 1
                      },
                      "max" : {
                              "time" : ISODate("2023-02-28T14:42:42.177Z"),
                              "tag" : 1
                      }
              },
              "meta" : 1,
              "data" : {
                      "time" : {
                              "0" : ISODate("2023-02-28T14:36:02.572Z"),
                              "1" : ISODate("2023-02-28T14:42:42.177Z")
                      }
              }
      }
      

      For some reason we are adding the metaField value to the control block. Possibly in the process of reopening buckets and inserting more measurements into it.

            Assignee:
            fausto.leyva@mongodb.com Fausto Leyva (Inactive)
            Reporter:
            fausto.leyva@mongodb.com Fausto Leyva (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: