|
AutoGetCollection first takes AutoGetDb, and later performs a collection lookup in the catalog.
These opens the possibility for two operations that run concurrently, such that one of them creates the database and the collection, and another takes an AutoGetCollection, to cause an AutoGetCollection to return a valid collection pointer, but a null database pointer. This is something unexpected, as the assumption is that if the collection exists, the database exists.
Do we want to do something about this?
| Create |
Other |
|
|
AutoGetCollection |
|
|
> AutoGetDb (_db = 0x0) |
| AutoGetCollection |
|
| > AutoGetDb |
|
| > acquire collection locks |
|
| > _coll = lookupCollection |
|
| create database |
|
| create collection |
|
| commit |
|
|
|
> acquire collection locks |
|
|
> _coll = lookupCollection |
|
|
if(autoColl) succeeds |
|
|
autoColl.getDb() null |
|