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

Investigate using thread.join during wiredtiger shutdown

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 8
    • StorEng - Defined Pipeline

      Potential improvement identified during PM-3221.

      During __wt_connection_close we currently set the WT_CONN_CLOSING flag and then place a FULL_BARRIER.
      It's not immediately clear what the purpose of this barrier is, but we have the following theories:

      1. This was used to encourage the flushing of data out of a CPUs cache and into main memory faster.
      2. This forces an ordering of operations where the flag must be set before we're allowed to continue calling functions like __wt_capacity_server_destroy. This might imply there's some conditions where other threads must see the flag change before __wt_capacity_server_destroy destroys resources.

      One of the goals of PM-3221 is to identify places where we can remove unclear uses of barriers and replace them with more common patters such as locks. This seems like a candidate for removing the FULL_BARRIER and instead having __wt_connection_close wait for all other threads to join before progressing. Since this is taking place on shutdown we don't think there's any performance impacts to be considered.

      The scope of this ticket is to investigate replacing the FULL_BARRIER here with proper thread locking, and if it's possible to deliver the change.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            andrew.morton@mongodb.com Andrew Morton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: