diff options
author | Ramon Fernandez <rfmnyc@gmail.com> | 2015-11-19 09:37:38 -0500 |
---|---|---|
committer | Ramon Fernandez <rfmnyc@gmail.com> | 2015-11-19 09:41:39 -0500 |
commit | a0771ea5ec1b44537d3c409e3d712db24fd8e6bb (patch) | |
tree | 62517780ad0982ec80b8a6d968a72cf0474df617 /src/third_party/wiredtiger/src/lsm/lsm_tree.c | |
parent | 042d8fa2d252142489c5fa3009927bad20d77efb (diff) | |
download | mongo-a0771ea5ec1b44537d3c409e3d712db24fd8e6bb.tar.gz |
Import wiredtiger-wiredtiger-mongodb-3.2.0-rc3-177-g9d375e3.tar.gz from wiredtiger branch mongodb-3.2
ref: d9ec1ff..9d375e3
16c0a1a WT-1315 Fix some leaks with join cursors.
59857f9 WT-2222 Add statistics for named snapshots.
4368d39 WT-1315 Cursor join implementation
a72ddb7 WT-2218 Add truncate stats
fb9cebe WT-2224 Track which deleted refs are discarded by a split.
e2f1130 WT-2220 Split WT_TIMEDIFF macro into unit specific macros.
be412b5 WT-2182 when internal pages grow large enough, split them into their parents
ce8c091 WT-2219 Enhancements to in-memory testing
347d922 WT-2220 time_t cleanup.
08c0fcd WT-2217 change WT_CURSOR.insert to clear "set" key/value on return
d1b5e7f WT-2135 Fix log_only setting for backup cursor. Fix initialization.
78bd4ac WT-2210 raw compression fails if row-store recovery precedes column-store recovery
c1b2634 WT-2182 fixes for splitting up the tree.
0a1ee34 WT-2199 Fix transaction sync inconsistency.
ee31bb2 WT-2182 Simplify the split deepen logic.
c360d53 WT-2212 Add a "use_environment" config to "wiredtiger_open"
3f132a4 WT-2182 detect internal page split races.
Diffstat (limited to 'src/third_party/wiredtiger/src/lsm/lsm_tree.c')
-rw-r--r-- | src/third_party/wiredtiger/src/lsm/lsm_tree.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_tree.c b/src/third_party/wiredtiger/src/lsm/lsm_tree.c index 30af051bbcf..0c3642e70e8 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_tree.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_tree.c @@ -111,7 +111,7 @@ __lsm_tree_close(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) * other schema level operations will return EBUSY, even though * we're dropping the schema lock here. */ - if (i % 1000 == 0) { + if (i % WT_THOUSAND == 0) { WT_WITHOUT_LOCKS(session, ret = __wt_lsm_manager_clear_tree(session, lsm_tree)); WT_RET(ret); @@ -336,6 +336,11 @@ __wt_lsm_tree_create(WT_SESSION_IMPL *session, } WT_RET_NOTFOUND_OK(ret); + /* In-memory configurations don't make sense for LSM. */ + if (F_ISSET(S2C(session), WT_CONN_IN_MEMORY)) + WT_RET_MSG(session, EINVAL, + "LSM trees not supported by in-memory configurations"); + WT_RET(__wt_config_gets(session, cfg, "key_format", &cval)); if (WT_STRING_MATCH("r", cval.str, cval.len)) WT_RET_MSG(session, EINVAL, @@ -747,7 +752,7 @@ __wt_lsm_tree_throttle( WT_ASSERT(session, WT_TIMECMP(last_chunk->create_ts, ondisk->create_ts) >= 0); timediff = - WT_TIMEDIFF(last_chunk->create_ts, ondisk->create_ts); + WT_TIMEDIFF_NS(last_chunk->create_ts, ondisk->create_ts); lsm_tree->ckpt_throttle = (in_memory - 2) * timediff / (20 * record_count); @@ -783,8 +788,8 @@ __wt_lsm_tree_throttle( } /* Put an upper bound of 1s on both throttle calculations. */ - lsm_tree->ckpt_throttle = WT_MIN(1000000, lsm_tree->ckpt_throttle); - lsm_tree->merge_throttle = WT_MIN(1000000, lsm_tree->merge_throttle); + lsm_tree->ckpt_throttle = WT_MIN(WT_MILLION, lsm_tree->ckpt_throttle); + lsm_tree->merge_throttle = WT_MIN(WT_MILLION, lsm_tree->merge_throttle); /* * Update our estimate of how long each in-memory chunk stays active. @@ -798,15 +803,16 @@ __wt_lsm_tree_throttle( WT_ASSERT(session, prev_chunk->generation == 0); WT_ASSERT(session, WT_TIMECMP( last_chunk->create_ts, prev_chunk->create_ts) >= 0); - timediff = - WT_TIMEDIFF(last_chunk->create_ts, prev_chunk->create_ts); + timediff = WT_TIMEDIFF_NS( + last_chunk->create_ts, prev_chunk->create_ts); WT_ASSERT(session, WT_TIMECMP(prev_chunk->create_ts, ondisk->create_ts) >= 0); - oldtime = WT_TIMEDIFF(prev_chunk->create_ts, ondisk->create_ts); + oldtime = WT_TIMEDIFF_NS( + prev_chunk->create_ts, ondisk->create_ts); if (timediff < 10 * oldtime) lsm_tree->chunk_fill_ms = (3 * lsm_tree->chunk_fill_ms + - timediff / 1000000) / 4; + timediff / WT_MILLION) / 4; } } |