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.
- is related to
-
WT-14542 Enable caching for layered cursors and their constituents in WT
-
- Closed
-