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

Renaming a collection or a view should fail if a buckets namespace exists

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL
    • Hide
      // Create a buckets collection
      db.createCollection("system.buckets.foo", {timeseries: {timeField: t}})
      
      // Create a collection
       db.createCollection("ts") 
      
      // Rename the buckets collection
       db["system.buckets.foo"].renameCollection("system.buckets.ts")
      
      // Now we are in a state with "ts" and "system.buckets.ts" but "ts" is not a time-series view.
      Show
      // Create a buckets collection db.createCollection( "system.buckets.foo" , {timeseries: {timeField: t}}) // Create a collection  db.createCollection( "ts" ) // Rename the buckets collection  db[ "system.buckets.foo" ].renameCollection( "system.buckets.ts" ) // Now we are in a state with "ts" and "system.buckets.ts" but "ts" is not a time-series view.
    • 1

      Similar to SERVER-90682, when renaming a buckets collection the rename should be blocked if a view or collection exists on the namespace. This is to avoid ending in an inconsistent state where a view or collection and unrelated buckets collection exist. If we enter this state, we can lead to the error described in SERVER-91248

            Assignee:
            Unassigned Unassigned
            Reporter:
            gil.alon@mongodb.com Gil Alon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: