Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27345

reclaim inactive WT sessions on calling closeAllCursors

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.0
    • Component/s: Storage
    • Labels:
      None
    • ALL
    • Storage 2017-01-23

      There is a problem in the way we're caching WiredTigerCursor and WiredTigerSession objects. We cache cursors in each session, and also cache sessions globally. Most operations are short-lived in MongoDB, so that tends not to be a big problem: when we get a WT_BUSY, we go through the cached WiredTigerSession objects and close cached cursors. We also increment the cursor epoch, so that sessions returned subsequently also have their cursors closed. However, we have some internal clients that have very long-running operations: they could run forever. That way, they may have cached cursors that they never give back to the cache, and that will not be freed. This is especially an issue if the session it gets has been used by a client, such as "initandlisten", that may have cursors for thousands of tables. See SERVER-26870.

      This problem is exacerbated by the interruptible sleep improvements (SERVER-21004), as those result in more OperationContext objects, each a possible WiredTigerSession object, in use while sleeping.

      So, implement a way for the WiredTigerSessionCache to reclaim cursors from inactive sessions still owned by a WiredTigerRecoveryUnit. Locally cached MODE_IX and MODE_IS locks have a similar issue, so we may be able to use the same solution.

            Assignee:
            geert.bosch@mongodb.com Geert Bosch
            Reporter:
            geert.bosch@mongodb.com Geert Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: