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

Time-series inserts succeed even if time-series view does not exist

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • ALL
    • Hide
      MongoDB Enterprise > db.createCollection("c", {timeseries: {timeField: "t"}})
      { "ok" : 1 }
      MongoDB Enterprise > db.system.views.find()
      { "_id" : "test.c", "viewOn" : "system.buckets.c", "pipeline" : [ { "$_internalUnpackBucket" : { "timeField" : "t", "bucketMaxSpanSeconds" : 3600 } } ] }
      MongoDB Enterprise > db.adminCommand({applyOps: [{"op": "d", "ns": "test.system.views", "o": {"_id": "test.c"}}]})
      { "applied" : 1, "results" : [ true ], "ok" : 1 }
      MongoDB Enterprise > db.system.views.find()
      MongoDB Enterprise > db.c.insert({t: ISODate()})
      WriteResult({ "nInserted" : 1 })
      MongoDB Enterprise > db.system.buckets.find()
      MongoDB Enterprise > db.system.buckets.c.find()
      { "_id" : ObjectId("63e574602386bee9e7ef7a75"), "control" : { "version" : 1, "min" : { "_id" : ObjectId("63e574734ba6a20dd8db3782"), "t" : ISODate("2023-02-09T22:32:00Z") }, "max" : { "_id" : ObjectId("63e574734ba6a20dd8db3782"), "t" : ISODate("2023-02-09T22:32:19.951Z") } }, "data" : { "_id" : { "0" : ObjectId("63e574734ba6a20dd8db3782") }, "t" : { "0" : ISODate("2023-02-09T22:32:19.951Z") } } }
      
      Show
      MongoDB Enterprise > db.createCollection("c", {timeseries: {timeField: "t"}}) { "ok" : 1 } MongoDB Enterprise > db.system.views.find() { "_id" : "test.c", "viewOn" : "system.buckets.c", "pipeline" : [ { "$_internalUnpackBucket" : { "timeField" : "t", "bucketMaxSpanSeconds" : 3600 } } ] } MongoDB Enterprise > db.adminCommand({applyOps: [{"op": "d", "ns": "test.system.views", "o": {"_id": "test.c"}}]}) { "applied" : 1, "results" : [ true ], "ok" : 1 } MongoDB Enterprise > db.system.views.find() MongoDB Enterprise > db.c.insert({t: ISODate()}) WriteResult({ "nInserted" : 1 }) MongoDB Enterprise > db.system.buckets.find() MongoDB Enterprise > db.system.buckets.c.find() { "_id" : ObjectId("63e574602386bee9e7ef7a75"), "control" : { "version" : 1, "min" : { "_id" : ObjectId("63e574734ba6a20dd8db3782"), "t" : ISODate("2023-02-09T22:32:00Z") }, "max" : { "_id" : ObjectId("63e574734ba6a20dd8db3782"), "t" : ISODate("2023-02-09T22:32:19.951Z") } }, "data" : { "_id" : { "0" : ObjectId("63e574734ba6a20dd8db3782") }, "t" : { "0" : ISODate("2023-02-09T22:32:19.951Z") } } }
    • 14

      If we get into a scenario where a time-series buckets collection exists but the corresponding view does not, inserting into the (would-be) view namespace still succeeds as if it did exist.

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            gregory.noma@mongodb.com Gregory Noma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: