session_get_dhandle returning EBUSY leaves hanging handle

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Engines, Storage Engines - Foundations
    • SE Foundations - Q3+ Backlog
    • 2

      From investigation of WT-14542, a bug has been encountered when fetching a dhandle using session_get_dhandle. After __session_get_dhandle, we need to check if we want to lock the dhandle using __wt_session_lock_dhandle. In this case we can return early and leave the dhandle in an incomplete state, here is the code:

              /*
               * If the handle is already open for a special operation, give up.
               */
              if (btree != NULL && F_ISSET(btree, WT_BTREE_SPECIAL_FLAGS))
                  return (__wt_set_return(session, EBUSY));
      

      In this case, if the handle has the WT_BTREE_SPECIAL_FLAGS set, we return back EBUSY but never set session->dhandle to NULL. Users are still allowed to access this dhandle and potentially create a race condition when not allowed.

              Assignee:
              [DO NOT USE] Backlog - Storage Engines Team
              Reporter:
              Jie Chen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: