summaryrefslogtreecommitdiff
path: root/src/cursor
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-12-09 15:58:28 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-12-09 15:58:28 +1100
commitbe364821d75c0c42169d79c486fa582c777f7082 (patch)
tree19fbf92ecc10835c4fdbbeb6009f9e5f8dff1c6d /src/cursor
parent7907694fe1a38612b958cf15be82082b3e356583 (diff)
downloadmongo-be364821d75c0c42169d79c486fa582c777f7082.tar.gz
Sweep old handles more aggressively:
1. don't have checkpoint or other periodic operations like statistics logging keep old handles alive; 2. don't wait for all sessions to empty the file from their cache before closing; 3. only update the time of death from the sweep thread.
Diffstat (limited to 'src/cursor')
-rw-r--r--src/cursor/cur_file.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cursor/cur_file.c b/src/cursor/cur_file.c
index e8428b76691..5d6072ceb3e 100644
--- a/src/cursor/cur_file.c
+++ b/src/cursor/cur_file.c
@@ -328,8 +328,11 @@ __curfile_close(WT_CURSOR *cursor)
cbt = (WT_CURSOR_BTREE *)cursor;
CURSOR_API_CALL(cursor, session, close, cbt->btree);
WT_TRET(__wt_btcur_close(cbt));
- if (cbt->btree != NULL)
+ if (cbt->btree != NULL) {
+ /* Increment the data-source's in-use counter. */
+ __wt_cursor_dhandle_decr_use(session);
WT_TRET(__wt_session_release_btree(session));
+ }
/* The URI is owned by the btree handle. */
cursor->internal_uri = NULL;
WT_TRET(__wt_cursor_close(cursor));
@@ -475,6 +478,8 @@ __wt_curfile_open(WT_SESSION_IMPL *session, const char *uri,
WT_ERR(__wt_curfile_create(session, owner, cfg, bulk, bitmap, cursorp));
+ /* Increment the data-source's in-use counter. */
+ __wt_cursor_dhandle_incr_use(session);
return (0);
err: /* If the cursor could not be opened, release the handle. */