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

Review how WiredTiger uses WT_PUBLISH and WT_ORDERED_WRITE

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      There has been some contention between michael.cahill, keith.bostic and alexander.gorrod about when and how to control cases where it's important the order in which updates to different member variables are visible to other threads.

      A recent example of this was in WT-5119, where we added the WT_ORDERED_WRITE macro, which has the same semantic as WT_PUBLISH.

      Let's use this ticket to decide how to manage ordering in such cases, and be consistent moving forward.

      Some relevant content is in the Intel assembly documentation for sfence, which is how WT_PUBLISH is implemented. Specifically the section:

      The SFENCE instruction is ordered with respect to memory stores, other SFENCE instructions, MFENCE instructions, and any serializing instructions (such as the CPUID instruction). It is not ordered with respect to memory loads or the LFENCE instruction.

      We have some disagreement about whether an sfence implies that reads will also be ordered in respect to the sfence operation.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            alexander.gorrod@mongodb.com Alexander Gorrod
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: