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

Disallow users from creating collections with 'system.buckets' prefix

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • Hide

      > db.createCollection("system.new")

      { "ok" : 0, "errmsg" : "Invalid system namespace: test.system.new", "code" : 73, "codeName" : "InvalidNamespace" }

      > db.createCollection("system.buckets.new")

      { "ok" : 1 }

      > db.new.insert({})
      WriteCommandError(

      { "ok" : 0, "errmsg" : "time-series insert failed: test.new :: caused by :: Time-series buckets collection is missing time-series options", "code" : 72, "codeName" : "InvalidOptions" }

      )

      Show
      > db.createCollection("system.new") { "ok" : 0, "errmsg" : "Invalid system namespace: test.system.new", "code" : 73, "codeName" : "InvalidNamespace" } > db.createCollection("system.buckets.new") { "ok" : 1 } > db.new.insert({}) WriteCommandError( { "ok" : 0, "errmsg" : "time-series insert failed: test.new :: caused by :: Time-series buckets collection is missing time-series options", "code" : 72, "codeName" : "InvalidOptions" } )
    • Execution Team 2022-10-17, Execution Team 2022-10-31
    • 105

      There are a few places in the code which assume that a collection name with 'system.buckets' prefix implies that, the collection is a time-series collection. But we do allow users to create a regular collection with 'system.buckets' prefix. This might lead to some inconsistent behaviour. We generally don't allow users to create a collection with 'system.' prefix, so we should not treat 'system.buckets' prefix differently.

            Assignee:
            gregory.noma@mongodb.com Gregory Noma
            Reporter:
            arun.banala@mongodb.com Arun Banala
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: