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.
- is caused by
-
SERVER-73391 Use recoverable critical section for drop database
- Closed