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

Timeseries - different opcounters insertMany ordered vs unordered

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

      When using timeseries different opcounters are incremented while doing insertMany ordered vs unordered.
      Here a repro:

      a=[]
      for(i=0;i<1000;i++){a.push({ "metadata": { "sensorId": 1000, "type": "temperature" }, "timestamp": ISODate("2021-05-18T00:00:10.000Z"), "temp": i })}
      db.createCollection( "weather", { timeseries: { timeField: "timestamp", metaField: "metadata" } })
      void db.weather.insertMany(a,{ordered:true})
      db.serverStatus().opcounters
      {
        insert: Long('1002'),
        query: Long('17'),
        update: Long('0'),
        delete: Long('0'),
        getmore: Long('0'),
        command: Long('113')
      } 
      db.weather.deleteMany({})
      
      // restart the server in order to reset the stats 
      a=[] 
      for(i=0;i<1000;i++){a.push({ "metadata": { "sensorId": 1000, "type": "temperature" }, "timestamp": ISODate("2021-05-18T00:00:10.000Z"), "temp": i })} 
      void db.weather.insertMany(a,{ordered:false})
      db.serverStatus().opcounters
      {
        insert: Long('1003'),
        query: Long('16'),
        update: Long('1'),
        delete: Long('0'),
        getmore: Long('0'),
        command: Long('55')
      }
      

      When doing the ordered:false insertMany the update counter get increased, this does not happen when ordered:true is used.

      This was tested on MongoDB 7.0.4 replica set

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            renato.riccio@mongodb.com Renato Riccio
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: