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

Session sweep for stale cursors could be more aggressive.

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

      __wt_session_cursor_cache_sweep is called irregularly - once for every 40 calls to WT_SESSION::reset or __cursor_cache_release. Once it is called, it checks to make sure it hasn't been called in the last second. If those checks pass, then it examines between 5 and 32 buckets out of 512 buckets that the cursor cache is split into. More buckets if it's finding cursors to close. There's an assumption here that there are potentially lots of calls to release cursors and reset, there's never a huge period of time when they are never or hardly ever called.

      I think with session::reset, at least, we should always call the sweeper, not wait for the 40 call countdown. It can return immediately if a second hasn't elapsed since the last sweep. And if many seconds have elapsed, it should scale up the number of buckets to be swept accordingly. Imagine a few minutes have elapsed, we probably want to sweep it all.

            Assignee:
            backlog-server-storage-engines Backlog - Storage Engines Team
            Reporter:
            donald.anderson@mongodb.com Donald Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: