[SERVER-57562] Orphaned system.buckets collections Created: 09/Jun/21  Updated: 29/Oct/23  Resolved: 17/Jun/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.0.0-rc0
Fix Version/s: 5.0.0-rc3, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Michael Gargiulo Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: time-series
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Steps To Reproduce:

 > db.createCollection('coll1' )
{ "ok" : 1 }
 > show collections
 coll1
 > 
 > db.createCollection('coll1', { timeseries: \\{ timeField: 'ts' }} )
{ "ok" : 0, "errmsg" : "Collection already exists. NS: test.coll1", "code" : 48, "codeName" : "NamespaceExists" }
> 
 > show collections
 coll1
 system.buckets.coll1
 > 
 > db.coll1.drop()
 true
 > 
 > show collections
 system.buckets.coll1
 

Sprint: Execution Team 2021-06-28
Participants:

 Description   

There is a path where a system.buckets collection can be orphaned if a previously created collection shares the namespace of a proposed createCollection with timeseries options. This bug can likely be addressed in the createCollection path for timeseries where a system.buckets collection is created prior to any namespace checking for existing collections. 



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 17/Jun/21 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-57562 Check if Collection or View exist on namespace before creating timeseries bucket collection.

(cherry picked from commit fde9102ad5294e53d7dca2ba1535633735586094)
Branch: v5.0
https://github.com/mongodb/mongo/commit/47274c9d16659ff1647966abaf0738400e17fb60

Comment by Githook User [ 17/Jun/21 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-57562 Check if Collection or View exist on namespace before creating timeseries bucket collection.
Branch: master
https://github.com/mongodb/mongo/commit/fde9102ad5294e53d7dca2ba1535633735586094

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