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

manually removing time-series buckets results in lost inserts

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Storage
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Hide
      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()
      
      Show
      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()
    • Execution Team 2021-01-25, Execution Team 2021-02-08

      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.

            Assignee:
            gregory.noma@mongodb.com Gregory Noma
            Reporter:
            geert.bosch@mongodb.com Geert Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: