AutoGetCollection can return a valid collection and null database

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Execution Team 2022-12-12, Execution Team 2022-12-26
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

       

            Assignee:
            Yujin Kang Park
            Reporter:
            Yujin Kang Park
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: