WiredTiger uses epochs to manage various resources. The basic idea is that threads publish the current generation number before accessing some resource, then clear it when they are done.
A thread wanting to replace some object in memory can increment the current epoch. Once no threads have the previous epoch published, it is safe to free the memory holding the old version of data.
We already do this for split generations. In addition, LSM trees have generations, there are checkpoint generations, the schema generation, and so on.
Replace all of these special cases with a general mechanism that makes it easy to create and manage epochs. This would include some structure that is global (in WT_CONNECTION) plus some structure in WT_SESSION, and functions that publish / clear a session's epoch for ordinary access, plus a function to switch to a new epoch and wait for the old epoch to drain.
We could use this mechanism to free old hazard arrays once SERVER-26545 is merged.
- related to
-
SERVER-38292 mongodb crash with Got signal: 11 (Segmentation fault)
- Closed
-
WT-3261 add a checkpoint epoch to avoid draining the eviction queue
- Closed
-
WT-3260 switch LSM tree generations to general-purpose generation code.
- Closed
- links to