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

Pre 7.0 dropDatabase implementation releases the critical section too early

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • Affects Version/s: 7.0.0-rc0
    • Component/s: Sharding
    • None
    • Fully Compatible
    • Sharding EMEA 2023-04-17
    • 135

      This issue was recently introduced in SERVER-73391.  Depending on the version of the coordinator we might use the Recoverable Critical Section  (7.0 or newer) or the just in-memory critical section (pre 7.0). The implementation of the latter one was refactored on SERVER-73391 and we introduced an issue in this statement: rather than directly emplacing the ScopedDatabaseCriticalSection  in the boost::optional what we are actually doing is building a temporary object and then copy construct it to perform the emplacement. Thus, when the temporary ScopedDatabaseCriticalSection is destroyed, the critical section is released. Note that the destruction of the  boost::optional will also call ~ScopedDatabaseCriticalSection, which will realize that the critical section was already released and do nothing.

            Assignee:
            sergi.mateo-bellido@mongodb.com Sergi Mateo Bellido
            Reporter:
            sergi.mateo-bellido@mongodb.com Sergi Mateo Bellido
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: