diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2016-04-05 14:43:57 +1000 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2016-04-05 14:44:50 +1000 |
commit | de6f136d83b20f8a58ba6fe4ba02be229b6c9159 (patch) | |
tree | 3221d66b54cbf6208fc3c995fdbb36d347ae85ff /src/third_party/wiredtiger/src/block/block_ckpt.c | |
parent | 5d1262cc394d685b59ae3185d7315227085e897d (diff) | |
download | mongo-de6f136d83b20f8a58ba6fe4ba02be229b6c9159.tar.gz |
Import wiredtiger-wiredtiger-2.8.0-134-g5047aab.tar.gz from wiredtiger branch mongodb-3.4
ref: 9cf8eb2..5047aab
SERVER-23504 Coverity analysis defect 98177: Resource leak
WT-2330 in-memory configurations should not create on-disk collection files
WT-2513 conversion from 'int64_t' to 'uint32_t'
WT-2522 Incorrect format code in message
WT-2525 in-memory configurations: miscellaneous cleanups
WT-2527 OS X compile error, missing POSIX_FADV_WILLNEED #define
WT-2528 style error in WiredTiger build
WT-2529 The readonly test case is crashing with a stack overflow
WT-2531 in-memory tables are allocating unnecessary memory
WT-2532 WT_STREAM_APPEND and WT_STREAM_LINE_BUFFER flag overlap
WT-2533 Ensure that in-memory tables don't report a zero size
SERVER-23517 WiredTiger changes for MongoDB 3.3.5
Diffstat (limited to 'src/third_party/wiredtiger/src/block/block_ckpt.c')
-rw-r--r-- | src/third_party/wiredtiger/src/block/block_ckpt.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/third_party/wiredtiger/src/block/block_ckpt.c b/src/third_party/wiredtiger/src/block/block_ckpt.c index 812bf99acfb..a861a21876b 100644 --- a/src/third_party/wiredtiger/src/block/block_ckpt.c +++ b/src/third_party/wiredtiger/src/block/block_ckpt.c @@ -135,8 +135,11 @@ __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block, * that was done when the checkpoint was first written (re-writing the * checkpoint might possibly make it relevant here, but it's unlikely * enough I don't bother). + * + * If in-memory, we don't read or write the object, and the truncate + * will unnecessarily allocate buffer space. */ - if (!checkpoint) { + if (!checkpoint && !F_ISSET(S2C(session), WT_CONN_IN_MEMORY)) { /* * The truncate might fail if there's a file mapping (if there's * an open checkpoint on the file), that's OK. @@ -144,7 +147,7 @@ __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ERR(__wt_verbose(session, WT_VERB_CHECKPOINT, "truncate file to %" PRIuMAX, (uintmax_t)ci->file_size)); WT_ERR_BUSY_OK( - __wt_block_truncate(session, block->fh, ci->file_size)); + __wt_block_truncate(session, block, ci->file_size)); } if (0) { @@ -192,7 +195,7 @@ __wt_block_checkpoint_unload( * an open checkpoint on the file), that's OK. */ WT_TRET_BUSY_OK( - __wt_block_truncate(session, block->fh, block->fh->size)); + __wt_block_truncate(session, block, block->size)); __wt_spin_lock(session, &block->live_lock); __wt_block_ckpt_destroy(session, &block->live); @@ -738,7 +741,7 @@ __ckpt_update(WT_SESSION_IMPL *session, * if there ever is, this will need to be fixed. */ if (is_live) - ci->file_size = block->fh->size; + ci->file_size = block->size; /* * Copy the checkpoint information into the checkpoint array's address |