diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2013-06-07 17:17:19 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2013-06-07 17:17:19 +1000 |
commit | 8e5e74e00855fd071570b8aaa286f0dbaecbd767 (patch) | |
tree | a47cd8ab55f3f16e6b585563ace7f056991689ad /src | |
parent | 18f02d8552012331809c94e4241a3d80330d221c (diff) | |
download | mongo-8e5e74e00855fd071570b8aaa286f0dbaecbd767.tar.gz |
Use read-uncommitted isolation for LSM worker sessions: they are always dealing with read-only files.
Diffstat (limited to 'src')
-rw-r--r-- | src/lsm/lsm_tree.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lsm/lsm_tree.c b/src/lsm/lsm_tree.c index af9f759b945..87953244db5 100644 --- a/src/lsm/lsm_tree.c +++ b/src/lsm/lsm_tree.c @@ -264,7 +264,13 @@ __lsm_tree_start_worker(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) wt_conn = &S2C(session)->iface; - WT_RET(wt_conn->open_session(wt_conn, NULL, NULL, &wt_session)); + /* + * All the LSM worker threads do their operations on read-only files. + * Use read-uncommitted isolation to avoid keeping updates in cache + * unnecessarily. + */ + WT_RET(wt_conn->open_session( + wt_conn, NULL, "isolation=read-uncommitted", &wt_session)); lsm_tree->ckpt_session = (WT_SESSION_IMPL *)wt_session; F_SET(lsm_tree->ckpt_session, WT_SESSION_INTERNAL); @@ -274,7 +280,8 @@ __lsm_tree_start_worker(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) if (F_ISSET(S2C(session), WT_CONN_LSM_MERGE)) for (i = 0; i < lsm_tree->merge_threads; i++) { WT_RET(wt_conn->open_session( - wt_conn, NULL, NULL, &wt_session)); + wt_conn, NULL, "isolation=read-uncommitted", + &wt_session)); s = (WT_SESSION_IMPL *)wt_session; F_SET(s, WT_SESSION_INTERNAL); lsm_tree->worker_sessions[i] = s; @@ -287,7 +294,8 @@ __lsm_tree_start_worker(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) __wt_lsm_merge_worker, wargs)); } if (FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_NEWEST)) { - WT_RET(wt_conn->open_session(wt_conn, NULL, NULL, &wt_session)); + WT_RET(wt_conn->open_session( + wt_conn, NULL, "isolation=read-uncommitted", &wt_session)); lsm_tree->bloom_session = (WT_SESSION_IMPL *)wt_session; F_SET(lsm_tree->bloom_session, WT_SESSION_INTERNAL); |