Skip to content

Commit

Permalink
Disallow the cache_resident flag on LSM trees.
Browse files Browse the repository at this point in the history
Refs WT-1905
  • Loading branch information
agorrod committed May 5, 2015
1 parent f4aec90 commit 3cfca1a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/api_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def __cmp__(self, other):
are also available. See @ref compression for more information''',
func='__wt_compressor_confchk'),
Config('cache_resident', 'false', r'''
do not ever evict the object's pages; see @ref
tuning_cache_resident for more information''',
do not ever evict the object's pages from cache. Not compatible with
LSM tables; see @ref tuning_cache_resident for more information''',
type='boolean'),
Config('checksum', 'uncompressed', r'''
configure block checksums; permitted values are <code>on</code>
Expand Down
3 changes: 2 additions & 1 deletion src/docs/tune-cache.dox
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ the page eviction statistics for the database.
Objects can be created as cache resident - that is their contents will
remain in cache and never be considered for the purposes of cache
eviction. Cache residence can be configured with the WT_SESSION::create
"cache_resident" configuration string.
"cache_resident" configuration string. LSM tree objects do not support
the "cache_resident" setting.

Configuring a cache resident object has several effects:

Expand Down
7 changes: 4 additions & 3 deletions src/include/wiredtiger.in
Original file line number Diff line number Diff line change
Expand Up @@ -996,9 +996,10 @@ struct __wt_session {
* builtin support for \c "bzip2"\, \c "snappy"\, \c "lz4" or \c "zlib"
* compression\, these names are also available. See @ref compression
* for more information., a string; default \c none.}
* @config{cache_resident, do not ever evict the object's pages; see
* @ref tuning_cache_resident for more information., a boolean flag;
* default \c false.}
* @config{cache_resident, do not ever evict the object's pages from
* cache. Not compatible with LSM tables; see @ref
* tuning_cache_resident for more information., a boolean flag; default
* \c false.}
* @config{checksum, configure block checksums; permitted values are
* <code>on</code> (checksum all blocks)\, <code>off</code> (checksum no
* blocks) and <code>uncompresssed</code> (checksum only blocks which
Expand Down
5 changes: 5 additions & 0 deletions src/lsm/lsm_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ __wt_lsm_tree_create(WT_SESSION_IMPL *session,
WT_ERR(__wt_strndup(
session, cval.str, cval.len, &lsm_tree->collator_name));

WT_ERR(__wt_config_gets(session, cfg, "cache_resident", &cval));
if (cval.val != 0)
WT_ERR_MSG(session, EINVAL,
"The cache_resident flag is not compatible with LSM");

WT_ERR(__wt_config_gets(session, cfg, "lsm.auto_throttle", &cval));
if (cval.val)
F_SET(lsm_tree, WT_LSM_TREE_THROTTLE);
Expand Down

0 comments on commit 3cfca1a

Please sign in to comment.