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

AutoGetCollection can return a valid collection and null database

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • Execution Team 2022-12-12, Execution Team 2022-12-26

    Description

      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

       

      Attachments

        Activity

          People

            yujin.kang@mongodb.com Yujin Kang Park
            yujin.kang@mongodb.com Yujin Kang Park
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: