Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-3076

Add a general-purpose epoch manager

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • WT2.9.3, 3.5.9
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage 2017-04-17

      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.

            Assignee:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Reporter:
            michael.cahill@mongodb.com Michael Cahill (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: