diff options
author | Keith Bostic <keith@wiredtiger.com> | 2015-09-30 15:12:47 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2015-09-30 15:12:47 -0400 |
commit | e6b6d12fd0ff483af48e26a7445ce49334964f74 (patch) | |
tree | bc249f4e968be3eca04a602191c152483ec12616 /src/conn/conn_cache_pool.c | |
parent | ffcb88877201021dd6cb9062ec8acf2b53943798 (diff) | |
download | mongo-e6b6d12fd0ff483af48e26a7445ce49334964f74.tar.gz |
WT-2149: open private lookaside cursors as part of creating an internal
thread's session, in order to avoid deadlocks later.
Change callers of __wt_open_internal_session() to pass a set of session
flags. If those flags include WT_SESSION_LOOKASIDE_CURSOR, a lookaside
table cursor is opened as part of creating the session.
Previously, __wt_open_internal_session() had a uses_dhandles boolean.
If that boolean was false, the session flag WT_SESSION_NO_DATA_HANDLES
was set. That boolean is gone, callers of __wt_open_internal_session()
should pass WT_SESSION_NO_DATA_HANDLES to __wt_open_internal_session().
Create the lookaside table before starting the worker threads, the order
is required if lookaside table cursors are opened as part of the worker
threads opening internal sessions.
Flip the order of creation in the initial lookaside table setup: we now
first create the lookaside table itself, then open the WT_CONNECTION_IMPL
lookaside session/cursor, that allows the cursor open to happen when the
connection's lookaside table session is first opened, like every other
internal thread.
Re-organize the lookaside table code to expect a lookaside table cursor
to be available in any session with the WT_SESSION_LOOKASIDE_CURSOR flag,
including the WT_CONNECTION_IMPL structure's lookaside session.
Diffstat (limited to 'src/conn/conn_cache_pool.c')
-rw-r--r-- | src/conn/conn_cache_pool.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/conn/conn_cache_pool.c b/src/conn/conn_cache_pool.c index 6294e3b01a7..22af88c66b1 100644 --- a/src/conn/conn_cache_pool.c +++ b/src/conn/conn_cache_pool.c @@ -243,6 +243,7 @@ __wt_conn_cache_pool_open(WT_SESSION_IMPL *session) WT_CACHE_POOL *cp; WT_CONNECTION_IMPL *conn; WT_DECL_RET; + uint32_t session_flags; conn = S2C(session); cache = conn->cache; @@ -252,8 +253,9 @@ __wt_conn_cache_pool_open(WT_SESSION_IMPL *session) * Create a session that can be used by the cache pool thread, do * it in the main thread to avoid shutdown races */ + session_flags = WT_SESSION_NO_DATA_HANDLES; if ((ret = __wt_open_internal_session( - conn, "cache-pool", false, false, &cache->cp_session)) != 0) + conn, "cache-pool", false, session_flags, &cache->cp_session)) != 0) WT_RET_MSG(NULL, ret, "Failed to create session for cache pool"); |