diff options
author | Luke Chen <luke.chen@mongodb.com> | 2018-11-13 15:55:44 +1100 |
---|---|---|
committer | Luke Chen <luke.chen@mongodb.com> | 2018-11-13 16:10:13 +1100 |
commit | fc13d160fed315b480222c15b32afa51de8b681a (patch) | |
tree | 769820090631e851add00e78123a60ce97d53c79 /src/third_party/wiredtiger/src/cursor/cur_std.c | |
parent | a5ce10b0982c7a0378ba92f1c7d3e02d49d0b18a (diff) | |
download | mongo-fc13d160fed315b480222c15b32afa51de8b681a.tar.gz |
Import wiredtiger: 849c21c26c879bb1195f211b63bdea74868094ea from branch mongodb-4.2
ref: e8cf194d81..849c21c26c
for: 4.1.6
WT-4043 Take locks while dumping the cache to avoid crashes
WT-4399 Fix compression for workgen's wtperf emulation
WT-4401 workgen: wtperf emulation: sample_interval broken with integer values
WT-4402 Add rollback support and monitor JSON output in wtperf
WT-4411 Added connection statistic for current total of cached cursors
WT-4412 wtperf coverity fixes
WT-4418 Don't keep key/value memory buffers allocated for cached cursors
WT-4422 Don't queue clean pages for urgent eviction
Diffstat (limited to 'src/third_party/wiredtiger/src/cursor/cur_std.c')
-rw-r--r-- | src/third_party/wiredtiger/src/cursor/cur_std.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/src/cursor/cur_std.c b/src/third_party/wiredtiger/src/cursor/cur_std.c index 597323cb4fa..3217b55cfa4 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_std.c +++ b/src/third_party/wiredtiger/src/cursor/cur_std.c @@ -598,6 +598,10 @@ __wt_cursor_cache(WT_CURSOR *cursor, WT_DATA_HANDLE *dhandle) WT_TRET(cursor->reset(cursor)); + /* Don't keep buffers allocated for cached cursors. */ + __wt_buf_free(session, &cursor->key); + __wt_buf_free(session, &cursor->value); + /* * Acquire a reference while decrementing the in-use counter. * After this point, the dhandle may be marked dead, but the @@ -617,7 +621,8 @@ __wt_cursor_cache(WT_CURSOR *cursor, WT_DATA_HANDLE *dhandle) (void)__wt_atomic_sub32(&S2C(session)->open_cursor_count, 1); WT_STAT_DATA_DECR(session, session_cursor_open); - WT_STAT_DATA_INCR(session, session_cursor_cached); + WT_STAT_DATA_INCR(session, session_cursors_cached); + WT_STAT_CONN_INCR(session, cursors_cached); F_SET(cursor, WT_CURSTD_CACHED); return (ret); } @@ -642,7 +647,8 @@ __wt_cursor_reopen(WT_CURSOR *cursor, WT_DATA_HANDLE *dhandle) } (void)__wt_atomic_add32(&S2C(session)->open_cursor_count, 1); WT_STAT_DATA_INCR(session, session_cursor_open); - WT_STAT_DATA_DECR(session, session_cursor_cached); + WT_STAT_DATA_DECR(session, session_cursors_cached); + WT_STAT_CONN_DECR(session, cursors_cached); bucket = cursor->uri_hash % WT_HASH_ARRAY_SIZE; TAILQ_REMOVE(&session->cursor_cache[bucket], cursor, q); |