-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Storage Execution
-
Execution Team 2024-02-19, Execution Team 2024-03-04, Execution Team 2024-03-18
> db.getSiblingDB('mydb').createCollection('foo') > db.getSiblingDB('mydb').foo.drop() > db.getSiblingDB('Mydb').createCollection('foo') MongoServerError: db already exists with different case already have: [mydb] trying to create [Mydb]
^^ The above happens even in replica sets (i.e., unsharded clusters). Happens in the last 4.2 version as well as 7.0.5.
Per matt.kneiser@mongodb.com, it looks like the reason is:
It looks like the DatabaseHolderImpl/DBsIndex, requires an explicit dropDb() call to unregister the namespace. Otherwise, we keep state around in memory that a database with "mydb" exists.
Ideas:
- The last collection drop should probably clear out the DB state.
- Should that mean we get an oplog dropDatabase entry (and change event), too?
Additional context: Mongosync can’t do `dropDatabase` commands—even in response to events of that name—because there’s no UUID.
- is related to
-
SERVER-76342 Drop system.views when the last view is removed
- Blocked
-
SERVER-43925 Proactively close newly empty databases
- Needs Scheduling