We are erroneously calling into the storage engine as part of CurOp::completeAndLogOperation() without holding any locks. This means there is no synchronization between server shutdown (or rollbackToStable) and this function call to access the statistics on the session.
We need to fix the design of stats gathering and might need to gather the stats earlier, as part of the WriteUnitOfWork destruction, so that stats will be local and can be put into the slow-query log entry.
- causes
-
SERVER-39934 CurOp::completeAndLogOperation should not hang waiting for global lock
- Closed
- is related to
-
SERVER-39654 Storage statistics not logged for a slow transaction
- Closed