Dhandle sweep should quickly expire outdated btrees

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: DHandles
    • None
    • Storage Engines - Foundations
    • None
    • None

      Outdated btrees occur as a result of picking up a new checkpoint.  When a new checkpoint comes in old btrees opened at a previous checkpoint are located and marked to be "outdated".  This causes any future opens of the btree to do a complete open (getting the new checkpoint).  However, there's no special handling of outdated btrees past that point.

      At some point, all cursors that were open on the outdated btree are closed.  At that point, the sweep machinery starts, treating this dhandle like any other: the dhandle is marked with a timeofdeath, and we wait until close_idle_time seconds have passed.  By default WT sets this to 30.  However it looks like it is set to 600 for mongodb here: https://github.com/mongodb/mongo/blob/46fd0f67d113797c0a78c34d6ed96cf40e4f24be/src/mongo/db/storage/wiredtiger/wiredtiger_global_options.idl#L201

      So, we're probably keeping those old trees around for 10 minutes.  For an outdated btree that has all cursors closed, there should be no path for any session to reopen the btree, so it should be closed immediately.

            Assignee:
            Donald Anderson
            Reporter:
            Donald Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: