-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Engines - Server Integration
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
This creates a circular lifetime dependency that is not enforced, thus allowing read-after-write / use-after-free data races, especially during process termination. For example, running the shutdownTask on a shard server will result in rolling back stashed transactions – this may cause using opCtx pointers stored on instances of RecoveryUnit, while the actual opCtx might have been deleted already.
My recommendation is to avoid storing opCtx pointers in RecoveryUnit. Instead, we should have its public APIs expect a pointer to opCtx if needed, or store pointers to objects that will always outlive any instance of RecoveryUnit.
- related to
-
SERVER-125707 Store a pointer to the `storageEngine` in RU's rollback handler
-
- Closed
-