[SERVER-84258] Timeseries - different opcounters insertMany ordered vs unordered Created: 15/Dec/23  Updated: 29/Jan/24

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Renato Riccio Assignee: Backlog - Storage Execution Team
Resolution: Unresolved Votes: 0
Labels: storex-ranked
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution
Operating System: ALL
Participants:

 Description   

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


Generated at Thu Feb 08 06:54:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.