[SERVER-53964] manually removing time-series buckets results in lost inserts Created: 22/Jan/21  Updated: 29/Oct/23  Resolved: 30/Jan/21

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Geert Bosch Assignee: Gregory Noma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

rs.PRIMARY>  db.createCollection("a", {timeseries:{timeField: "time"}} )
{...
}
rs:PRIMARY> db.a.insert({time:new Date(), x:1})
WriteResult({ "nInserted" : 1 })
rs:PRIMARY> db.a.find()
{ "time" : ISODate("2021-01-21T23:54:20.876Z"), "_id" : ObjectId("600a142cf8fd3a198d9e4c4b"), "x" : 1 }
rs:PRIMARY> db.system.buckets.a.remove({})
WriteResult({ "nRemoved" : 1 })
rs:PRIMARY> db.a.insert({time:new Date(), x:2})
WriteResult({ "nInserted" : 1 })
rs:PRIMARY> db.a.find()

Sprint: Execution Team 2021-01-25, Execution Team 2021-02-08
Participants:

 Description   

There seem to be two issues at play: an insert of a measurement into a time-series collection where a bucket has been removed manually may result in a bucket update that matches no buckets, but does not generate an error even though it should.

Possible solutions for this issue may include having an OpObserver invalidate buckets belonging to a time-series collections on direct operations on the bucket collection. Alternatively we can do that on detecting an error in the update.



 Comments   
Comment by Githook User [ 30/Jan/21 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-53964 Handle time-series bucket removal
Branch: master
https://github.com/mongodb/mongo/commit/c08203fe14a89e789b7dc5353c427e34c4c2b31e

Generated at Thu Feb 08 05:32:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.