From 34b38436d0e9f5fefe9fd038c7efa91ff36b4626 Mon Sep 17 00:00:00 2001 From: Alex Gorrod Date: Wed, 7 Nov 2012 10:02:26 +1100 Subject: Add partial implementation for sub-sets of configuration options. --- dist/api_data.py | 29 ++-- dist/config.py | 84 +++++++++-- src/config/config_def.c | 346 +++++++++++++++++++++++----------------------- src/include/config.h | 1 + src/include/extern.h | 2 + src/include/wiredtiger.in | 109 +++++++++++---- 6 files changed, 343 insertions(+), 228 deletions(-) diff --git a/dist/api_data.py b/dist/api_data.py index 3aa986007ba..a512117c13a 100644 --- a/dist/api_data.py +++ b/dist/api_data.py @@ -35,10 +35,11 @@ class Method: self.flags = flags class Config: - def __init__(self, name, default, desc, **flags): + def __init__(self, name, default, desc, subconfig=None, **flags): self.name = name self.default = default self.desc = desc + self.subconfig = subconfig self.flags = flags def __cmp__(self, other): @@ -228,24 +229,20 @@ table_meta = format_meta + table_only_meta # Connection runtime config, shared by conn.reconfigure and wiredtiger_open connection_runtime_config = [ - Config('cache_pool', '', r''' + Config('cache', '', r''' + cache configuration setup''', type='category', subconfig=[ + Config('size', '100MB', r''' + maximum heap memory to allocate for the cache''', + min='1MB', max='10TB'), + Config('pool', '', r''' name of a cache pool that is shared between databases'''), - Config('cache_pool_size', '', r''' - size of a cache pool that is shared between databases. Only valid if - the cache_pool option is also specified. Must be specified if this - connection may create the cache pool''', + Config('pool_min', '', r''' + minimum amount of cache a connection in a cache pool can have''', min='1MB', max='10TB'), - Config('cache_pool_chunk', '', r''' + Config('pool_chunk', '', r''' the granularity that a cache pool is shared out. Only valid if the - cache_pool option is also specified.''', - min='1MB', max='10TB'), - Config('cache_pool_quota', '', r''' - the maximum amount of the cache pool a single database can use. Only - valid if the cache_pool option is also specified.''', - min='1MB', max='10TB'), - Config('cache_size', '100MB', r''' - maximum heap memory to allocate for the cache''', - min='1MB', max='10TB'), + cache_pool option is also specified''', + min='1MB', max='10TB')]), Config('error_prefix', '', r''' prefix string for error messages'''), Config('eviction_target', '80', r''' diff --git a/dist/config.py b/dist/config.py index b3dd944eefa..251b9b3aaeb 100644 --- a/dist/config.py +++ b/dist/config.py @@ -23,6 +23,15 @@ def gettype(c): ctype = 'int' return ctype or 'string' +def getsubconfigstr(c): + '''Return a string indicating if an item has sub configuration''' + ctype = gettype(c) + if ctype == 'category': + return '__wt_confchk_' + c.name + '_subconfigs' + else: + return 'NULL' + + def typedesc(c): '''Descripe what type of value is expected for the given config item''' checks = c.flags @@ -52,6 +61,28 @@ def typedesc(c): desc += ' of strings' return desc +def categorydesc(c): + desc = 'a list of configuration settings' + desc += ' @subconfigstart{' + c.name + ', see dist/api_data.py}' + for subc in c.subconfig: + desc += ' ' + parseconfig(subc) + desc = desc.replace('@config', '@subconfig') + desc += ' @subconfigend' + return desc + +def parseconfig(c): + desc = textwrap.dedent(c.desc) + '.' + desc = desc.replace(',', '\\,') + default = '\\c ' + str(c.default) if c.default or gettype(c) == 'int' \ + else 'empty' + if gettype(c) == 'category': + tdesc = categorydesc(c) + ';\n' + else: + tdesc = typedesc(c) + '; default ' + default + '.' + tdesc = tdesc.replace(',', '\\,') + output = '@config{' + ','.join((c.name, desc, tdesc)) + '}' + return output + skip = False for line in open(f, 'r'): if skip: @@ -96,14 +127,7 @@ for line in open(f, 'r'): lastname = name if 'undoc' in c.flags: continue - - desc = textwrap.dedent(c.desc) + '.' - desc = desc.replace(',', '\\,') - default = '\\c ' + str(c.default) if c.default or gettype(c) == 'int' \ - else 'empty' - tdesc = typedesc(c) + '; default ' + default + '.' - tdesc = tdesc.replace(',', '\\,') - output = '@config{' + ','.join((name, desc, tdesc)) + '}' + output = parseconfig(c) for l in w.wrap(output): tfile.write(prefix + l + '\n') @@ -134,11 +158,15 @@ def checkstr(c): cmin = str(checks.get('min', '')) cmax = str(checks.get('max', '')) choices = checks.get('choices', []) + subconfig = checks.get('subconfig', []) result = [] if cmin: result.append('min=' + cmin) if cmax: result.append('max=' + cmax) + if subconfig: + result.append('subconfig=' + '[' + + ','.join('\\"' + parseconfig(c) + '\\"' for c in subconfig) + ']') if choices: result.append('choices=' + '[' + ','.join('\\"' + s + '\\"' for s in choices) + ']') @@ -156,6 +184,33 @@ def get_default(c): else: return '' +created_subconfigs=set() + +def add_subconfig(c, tfile): + created_subconfigs.add(c.name) + subname = c.name.replace('.', '_') + tfile.write(''' +const char * +__wt_confdfl_%(name)s_subconfigs = +%(config)s; +''' % { + 'name' : subname, + 'config' : '\n'.join('\t"%s"' % line + for line in w.wrap(','.join('%s=%s' % (subc.name, get_default(subc)) + for subc in sorted(c.subconfig))) or [""]), +}) + tfile.write(''' +WT_CONFIG_CHECK +__wt_confchk_%(name)s_subconfigs[] = { +\t%(check)s +\t{ NULL, NULL, NULL, NULL } +}; +''' % { + 'name' : c.name, + 'check' : '\n\t'.join('"\n\t "'.join(w.wrap('{ "%s", "%s", %s, NULL },' % + (subc.name, gettype(subc), checkstr(subc)))) for subc in sorted(c.subconfig)), +}) + for name in sorted(api_data.methods.keys()): ctype = api_data.methods[name].config name = name.replace('.', '_') @@ -169,13 +224,18 @@ __wt_confdfl_%(name)s = for line in w.wrap(','.join('%s=%s' % (c.name, get_default(c)) for c in sorted(ctype))) or [""]), }) + # Deal with subsets of configuration settings. + for c in sorted(ctype): + if gettype(c) == 'category' and c.name not in created_subconfigs: + add_subconfig(c, tfile) + # Construct an array of allowable configuration options. Always append an empty # string as a terminator for iteration if not ctype: tfile.write(''' WT_CONFIG_CHECK __wt_confchk_%(name)s[] = { -\t{ NULL, NULL, NULL } +\t{ NULL, NULL, NULL, NULL } }; ''' % { 'name' : name }) else: @@ -183,12 +243,12 @@ __wt_confchk_%(name)s[] = { WT_CONFIG_CHECK __wt_confchk_%(name)s[] = { \t%(check)s -\t{ NULL, NULL, NULL } +\t{ NULL, NULL, NULL, NULL } }; ''' % { 'name' : name, - 'check' : '\n\t'.join('"\n\t "'.join(w.wrap('{ "%s", "%s", %s },' % - (c.name, gettype(c), checkstr(c)))) for c in sorted(ctype)), + 'check' : '\n\t'.join('"\n\t "'.join(w.wrap('{ "%s", "%s", %s, %s },' % + (c.name, gettype(c), checkstr(c), getsubconfigstr(c)))) for c in sorted(ctype)), }) tfile.close() diff --git a/src/config/config_def.c b/src/config/config_def.c index 7da2d8fd419..cbed4f729c0 100644 --- a/src/config/config_def.c +++ b/src/config/config_def.c @@ -8,10 +8,10 @@ __wt_confdfl_colgroup_meta = WT_CONFIG_CHECK __wt_confchk_colgroup_meta[] = { - { "columns", "list", NULL }, - { "source", "string", NULL }, - { "type", "string", "choices=[\"file\",\"lsm\"]" }, - { NULL, NULL, NULL } + { "columns", "list", NULL, NULL }, + { "source", "string", NULL, NULL }, + { "type", "string", "choices=[\"file\",\"lsm\"]", NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -20,7 +20,7 @@ __wt_confdfl_connection_add_collator = WT_CONFIG_CHECK __wt_confchk_connection_add_collator[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -29,7 +29,7 @@ __wt_confdfl_connection_add_compressor = WT_CONFIG_CHECK __wt_confchk_connection_add_compressor[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -38,7 +38,7 @@ __wt_confdfl_connection_add_data_source = WT_CONFIG_CHECK __wt_confchk_connection_add_data_source[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -47,7 +47,7 @@ __wt_confdfl_connection_add_extractor = WT_CONFIG_CHECK __wt_confchk_connection_add_extractor[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -56,7 +56,7 @@ __wt_confdfl_connection_close = WT_CONFIG_CHECK __wt_confchk_connection_close[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -65,9 +65,9 @@ __wt_confdfl_connection_load_extension = WT_CONFIG_CHECK __wt_confchk_connection_load_extension[] = { - { "entry", "string", NULL }, - { "prefix", "string", NULL }, - { NULL, NULL, NULL } + { "entry", "string", NULL, NULL }, + { "prefix", "string", NULL, NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -77,31 +77,38 @@ __wt_confdfl_connection_open_session = WT_CONFIG_CHECK __wt_confchk_connection_open_session[] = { { "isolation", "string", "choices=[\"read-uncommitted\"," - "\"read-committed\",\"snapshot\"]" }, - { NULL, NULL, NULL } + "\"read-committed\",\"snapshot\"]", NULL }, + { NULL, NULL, NULL, NULL } }; const char * __wt_confdfl_connection_reconfigure = - "cache_pool=,cache_pool_chunk=,cache_pool_quota=,cache_pool_size=," - "cache_size=100MB,error_prefix=,eviction_target=80," - "eviction_trigger=95,verbose="; + "cache=,error_prefix=,eviction_target=80,eviction_trigger=95,verbose="; + +const char * +__wt_confdfl_cache_subconfigs = + "pool=,pool_chunk=,pool_min=,size=100MB"; + +WT_CONFIG_CHECK +__wt_confchk_cache_subconfigs[] = { + { "pool", "string", NULL, NULL }, + { "pool_chunk", "int", "min=1MB,max=10TB", NULL }, + { "pool_min", "int", "min=1MB,max=10TB", NULL }, + { "size", "int", "min=1MB,max=10TB", NULL }, + { NULL, NULL, NULL, NULL } +}; WT_CONFIG_CHECK __wt_confchk_connection_reconfigure[] = { - { "cache_pool", "string", NULL }, - { "cache_pool_chunk", "int", "min=1MB,max=10TB" }, - { "cache_pool_quota", "int", "min=1MB,max=10TB" }, - { "cache_pool_size", "int", "min=1MB,max=10TB" }, - { "cache_size", "int", "min=1MB,max=10TB" }, - { "error_prefix", "string", NULL }, - { "eviction_target", "int", "min=10,max=99" }, - { "eviction_trigger", "int", "min=10,max=99" }, + { "cache", "category", NULL, __wt_confchk_cache_subconfigs }, + { "error_prefix", "string", NULL, NULL }, + { "eviction_target", "int", "min=10,max=99", NULL }, + { "eviction_trigger", "int", "min=10,max=99", NULL }, { "verbose", "list", "choices=[\"block\",\"cache_pool\",\"ckpt\"," "\"evict\",\"evictserver\",\"fileops\",\"hazard\",\"lsm\",\"mutex\"," "\"read\",\"readserver\",\"reconcile\",\"salvage\",\"verify\"," - "\"write\"]" }, - { NULL, NULL, NULL } + "\"write\"]", NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -110,7 +117,7 @@ __wt_confdfl_cursor_close = WT_CONFIG_CHECK __wt_confchk_cursor_close[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -126,37 +133,37 @@ __wt_confdfl_file_meta = WT_CONFIG_CHECK __wt_confchk_file_meta[] = { - { "allocation_size", "int", "min=512B,max=128MB" }, - { "block_compressor", "string", NULL }, - { "cache_resident", "boolean", NULL }, - { "checkpoint", "string", NULL }, - { "checksum", "boolean", NULL }, - { "collator", "string", NULL }, - { "columns", "list", NULL }, - { "dictionary", "int", "min=0" }, - { "format", "string", "choices=[\"btree\"]" }, - { "huffman_key", "string", NULL }, - { "huffman_value", "string", NULL }, - { "internal_item_max", "int", "min=0" }, - { "internal_key_truncate", "boolean", NULL }, - { "internal_page_max", "int", "min=512B,max=512MB" }, - { "key_format", "format", NULL }, - { "key_gap", "int", "min=0" }, - { "leaf_item_max", "int", "min=0" }, - { "leaf_page_max", "int", "min=512B,max=512MB" }, - { "lsm_bloom", "boolean", NULL }, - { "lsm_bloom_bit_count", "int", "min=2,max=1000" }, - { "lsm_bloom_config", "string", NULL }, - { "lsm_bloom_hash_count", "int", "min=2,max=100" }, - { "lsm_bloom_newest", "boolean", NULL }, - { "lsm_bloom_oldest", "boolean", NULL }, - { "lsm_chunk_size", "int", "min=512K,max=500MB" }, - { "lsm_merge_max", "int", "min=2,max=100" }, - { "prefix_compression", "boolean", NULL }, - { "split_pct", "int", "min=25,max=100" }, - { "value_format", "format", NULL }, - { "version", "string", NULL }, - { NULL, NULL, NULL } + { "allocation_size", "int", "min=512B,max=128MB", NULL }, + { "block_compressor", "string", NULL, NULL }, + { "cache_resident", "boolean", NULL, NULL }, + { "checkpoint", "string", NULL, NULL }, + { "checksum", "boolean", NULL, NULL }, + { "collator", "string", NULL, NULL }, + { "columns", "list", NULL, NULL }, + { "dictionary", "int", "min=0", NULL }, + { "format", "string", "choices=[\"btree\"]", NULL }, + { "huffman_key", "string", NULL, NULL }, + { "huffman_value", "string", NULL, NULL }, + { "internal_item_max", "int", "min=0", NULL }, + { "internal_key_truncate", "boolean", NULL, NULL }, + { "internal_page_max", "int", "min=512B,max=512MB", NULL }, + { "key_format", "format", NULL, NULL }, + { "key_gap", "int", "min=0", NULL }, + { "leaf_item_max", "int", "min=0", NULL }, + { "leaf_page_max", "int", "min=512B,max=512MB", NULL }, + { "lsm_bloom", "boolean", NULL, NULL }, + { "lsm_bloom_bit_count", "int", "min=2,max=1000", NULL }, + { "lsm_bloom_config", "string", NULL, NULL }, + { "lsm_bloom_hash_count", "int", "min=2,max=100", NULL }, + { "lsm_bloom_newest", "boolean", NULL, NULL }, + { "lsm_bloom_oldest", "boolean", NULL, NULL }, + { "lsm_chunk_size", "int", "min=512K,max=500MB", NULL }, + { "lsm_merge_max", "int", "min=2,max=100", NULL }, + { "prefix_compression", "boolean", NULL, NULL }, + { "split_pct", "int", "min=25,max=100", NULL }, + { "value_format", "format", NULL, NULL }, + { "version", "string", NULL, NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -165,13 +172,13 @@ __wt_confdfl_index_meta = WT_CONFIG_CHECK __wt_confchk_index_meta[] = { - { "columns", "list", NULL }, - { "columns", "list", NULL }, - { "key_format", "format", NULL }, - { "source", "string", NULL }, - { "type", "string", "choices=[\"file\",\"lsm\"]" }, - { "value_format", "format", NULL }, - { NULL, NULL, NULL } + { "columns", "list", NULL, NULL }, + { "columns", "list", NULL, NULL }, + { "key_format", "format", NULL, NULL }, + { "source", "string", NULL, NULL }, + { "type", "string", "choices=[\"file\",\"lsm\"]", NULL }, + { "value_format", "format", NULL, NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -181,12 +188,12 @@ __wt_confdfl_session_begin_transaction = WT_CONFIG_CHECK __wt_confchk_session_begin_transaction[] = { { "isolation", "string", "choices=[\"read-uncommitted\"," - "\"read-committed\",\"snapshot\"]" }, - { "name", "string", NULL }, - { "priority", "int", "min=-100,max=100" }, + "\"read-committed\",\"snapshot\"]", NULL }, + { "name", "string", NULL, NULL }, + { "priority", "int", "min=-100,max=100", NULL }, { "sync", "string", "choices=[\"full\",\"flush\",\"write\"," - "\"none\"]" }, - { NULL, NULL, NULL } + "\"none\"]", NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -195,11 +202,11 @@ __wt_confdfl_session_checkpoint = WT_CONFIG_CHECK __wt_confchk_session_checkpoint[] = { - { "drop", "list", NULL }, - { "force", "boolean", NULL }, - { "name", "string", NULL }, - { "target", "list", NULL }, - { NULL, NULL, NULL } + { "drop", "list", NULL, NULL }, + { "force", "boolean", NULL, NULL }, + { "name", "string", NULL, NULL }, + { "target", "list", NULL, NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -208,7 +215,7 @@ __wt_confdfl_session_close = WT_CONFIG_CHECK __wt_confchk_session_close[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -217,7 +224,7 @@ __wt_confdfl_session_commit_transaction = WT_CONFIG_CHECK __wt_confchk_session_commit_transaction[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -226,7 +233,7 @@ __wt_confdfl_session_compact = WT_CONFIG_CHECK __wt_confchk_session_compact[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -243,42 +250,42 @@ __wt_confdfl_session_create = WT_CONFIG_CHECK __wt_confchk_session_create[] = { - { "allocation_size", "int", "min=512B,max=128MB" }, - { "block_compressor", "string", NULL }, - { "cache_resident", "boolean", NULL }, - { "checksum", "boolean", NULL }, - { "colgroups", "list", NULL }, - { "collator", "string", NULL }, - { "columns", "list", NULL }, - { "columns", "list", NULL }, - { "dictionary", "int", "min=0" }, - { "exclusive", "boolean", NULL }, - { "format", "string", "choices=[\"btree\"]" }, - { "huffman_key", "string", NULL }, - { "huffman_value", "string", NULL }, - { "internal_item_max", "int", "min=0" }, - { "internal_key_truncate", "boolean", NULL }, - { "internal_page_max", "int", "min=512B,max=512MB" }, - { "key_format", "format", NULL }, - { "key_format", "format", NULL }, - { "key_gap", "int", "min=0" }, - { "leaf_item_max", "int", "min=0" }, - { "leaf_page_max", "int", "min=512B,max=512MB" }, - { "lsm_bloom", "boolean", NULL }, - { "lsm_bloom_bit_count", "int", "min=2,max=1000" }, - { "lsm_bloom_config", "string", NULL }, - { "lsm_bloom_hash_count", "int", "min=2,max=100" }, - { "lsm_bloom_newest", "boolean", NULL }, - { "lsm_bloom_oldest", "boolean", NULL }, - { "lsm_chunk_size", "int", "min=512K,max=500MB" }, - { "lsm_merge_max", "int", "min=2,max=100" }, - { "prefix_compression", "boolean", NULL }, - { "source", "string", NULL }, - { "split_pct", "int", "min=25,max=100" }, - { "type", "string", "choices=[\"file\",\"lsm\"]" }, - { "value_format", "format", NULL }, - { "value_format", "format", NULL }, - { NULL, NULL, NULL } + { "allocation_size", "int", "min=512B,max=128MB", NULL }, + { "block_compressor", "string", NULL, NULL }, + { "cache_resident", "boolean", NULL, NULL }, + { "checksum", "boolean", NULL, NULL }, + { "colgroups", "list", NULL, NULL }, + { "collator", "string", NULL, NULL }, + { "columns", "list", NULL, NULL }, + { "columns", "list", NULL, NULL }, + { "dictionary", "int", "min=0", NULL }, + { "exclusive", "boolean", NULL, NULL }, + { "format", "string", "choices=[\"btree\"]", NULL }, + { "huffman_key", "string", NULL, NULL }, + { "huffman_value", "string", NULL, NULL }, + { "internal_item_max", "int", "min=0", NULL }, + { "internal_key_truncate", "boolean", NULL, NULL }, + { "internal_page_max", "int", "min=512B,max=512MB", NULL }, + { "key_format", "format", NULL, NULL }, + { "key_format", "format", NULL, NULL }, + { "key_gap", "int", "min=0", NULL }, + { "leaf_item_max", "int", "min=0", NULL }, + { "leaf_page_max", "int", "min=512B,max=512MB", NULL }, + { "lsm_bloom", "boolean", NULL, NULL }, + { "lsm_bloom_bit_count", "int", "min=2,max=1000", NULL }, + { "lsm_bloom_config", "string", NULL, NULL }, + { "lsm_bloom_hash_count", "int", "min=2,max=100", NULL }, + { "lsm_bloom_newest", "boolean", NULL, NULL }, + { "lsm_bloom_oldest", "boolean", NULL, NULL }, + { "lsm_chunk_size", "int", "min=512K,max=500MB", NULL }, + { "lsm_merge_max", "int", "min=2,max=100", NULL }, + { "prefix_compression", "boolean", NULL, NULL }, + { "source", "string", NULL, NULL }, + { "split_pct", "int", "min=25,max=100", NULL }, + { "type", "string", "choices=[\"file\",\"lsm\"]", NULL }, + { "value_format", "format", NULL, NULL }, + { "value_format", "format", NULL, NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -287,8 +294,8 @@ __wt_confdfl_session_drop = WT_CONFIG_CHECK __wt_confchk_session_drop[] = { - { "force", "boolean", NULL }, - { NULL, NULL, NULL } + { "force", "boolean", NULL, NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -297,7 +304,7 @@ __wt_confdfl_session_log_printf = WT_CONFIG_CHECK __wt_confchk_session_log_printf[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -308,19 +315,19 @@ __wt_confdfl_session_open_cursor = WT_CONFIG_CHECK __wt_confchk_session_open_cursor[] = { - { "append", "boolean", NULL }, - { "bulk", "string", NULL }, - { "checkpoint", "string", NULL }, - { "dump", "string", "choices=[\"hex\",\"print\"]" }, - { "next_random", "boolean", NULL }, - { "no_cache", "boolean", NULL }, - { "overwrite", "boolean", NULL }, - { "raw", "boolean", NULL }, - { "statistics", "boolean", NULL }, - { "statistics_clear", "boolean", NULL }, - { "statistics_fast", "boolean", NULL }, - { "target", "list", NULL }, - { NULL, NULL, NULL } + { "append", "boolean", NULL, NULL }, + { "bulk", "string", NULL, NULL }, + { "checkpoint", "string", NULL, NULL }, + { "dump", "string", "choices=[\"hex\",\"print\"]", NULL }, + { "next_random", "boolean", NULL, NULL }, + { "no_cache", "boolean", NULL, NULL }, + { "overwrite", "boolean", NULL, NULL }, + { "raw", "boolean", NULL, NULL }, + { "statistics", "boolean", NULL, NULL }, + { "statistics_clear", "boolean", NULL, NULL }, + { "statistics_fast", "boolean", NULL, NULL }, + { "target", "list", NULL, NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -330,8 +337,8 @@ __wt_confdfl_session_reconfigure = WT_CONFIG_CHECK __wt_confchk_session_reconfigure[] = { { "isolation", "string", "choices=[\"read-uncommitted\"," - "\"read-committed\",\"snapshot\"]" }, - { NULL, NULL, NULL } + "\"read-committed\",\"snapshot\"]", NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -340,7 +347,7 @@ __wt_confdfl_session_rename = WT_CONFIG_CHECK __wt_confchk_session_rename[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -349,7 +356,7 @@ __wt_confdfl_session_rollback_transaction = WT_CONFIG_CHECK __wt_confchk_session_rollback_transaction[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -358,8 +365,8 @@ __wt_confdfl_session_salvage = WT_CONFIG_CHECK __wt_confchk_session_salvage[] = { - { "force", "boolean", NULL }, - { NULL, NULL, NULL } + { "force", "boolean", NULL, NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -368,7 +375,7 @@ __wt_confdfl_session_truncate = WT_CONFIG_CHECK __wt_confchk_session_truncate[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -377,7 +384,7 @@ __wt_confdfl_session_upgrade = WT_CONFIG_CHECK __wt_confchk_session_upgrade[] = { - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; const char * @@ -386,10 +393,10 @@ __wt_confdfl_session_verify = WT_CONFIG_CHECK __wt_confchk_session_verify[] = { - { "dump_address", "boolean", NULL }, - { "dump_blocks", "boolean", NULL }, - { "dump_pages", "boolean", NULL }, - { NULL, NULL, NULL } + { "dump_address", "boolean", NULL, NULL }, + { "dump_blocks", "boolean", NULL, NULL }, + { "dump_pages", "boolean", NULL, NULL }, + { NULL, NULL, NULL, NULL } }; const char * @@ -398,46 +405,41 @@ __wt_confdfl_table_meta = WT_CONFIG_CHECK __wt_confchk_table_meta[] = { - { "colgroups", "list", NULL }, - { "columns", "list", NULL }, - { "key_format", "format", NULL }, - { "value_format", "format", NULL }, - { NULL, NULL, NULL } + { "colgroups", "list", NULL, NULL }, + { "columns", "list", NULL, NULL }, + { "key_format", "format", NULL, NULL }, + { "value_format", "format", NULL, NULL }, + { NULL, NULL, NULL, NULL } }; const char * __wt_confdfl_wiredtiger_open = - "buffer_alignment=-1,cache_pool=,cache_pool_chunk=,cache_pool_quota=," - "cache_pool_size=,cache_size=100MB,create=0,direct_io=,error_prefix=," + "buffer_alignment=-1,cache=,create=0,direct_io=,error_prefix=," "eviction_target=80,eviction_trigger=95,extensions=,hazard_max=1000," "logging=0,lsm_merge=,multiprocess=0,session_max=50,sync=," "transactional=,use_environment_priv=0,verbose="; WT_CONFIG_CHECK __wt_confchk_wiredtiger_open[] = { - { "buffer_alignment", "int", "min=-1,max=1MB" }, - { "cache_pool", "string", NULL }, - { "cache_pool_chunk", "int", "min=1MB,max=10TB" }, - { "cache_pool_quota", "int", "min=1MB,max=10TB" }, - { "cache_pool_size", "int", "min=1MB,max=10TB" }, - { "cache_size", "int", "min=1MB,max=10TB" }, - { "create", "boolean", NULL }, - { "direct_io", "list", "choices=[\"data\",\"log\"]" }, - { "error_prefix", "string", NULL }, - { "eviction_target", "int", "min=10,max=99" }, - { "eviction_trigger", "int", "min=10,max=99" }, - { "extensions", "list", NULL }, - { "hazard_max", "int", "min=15" }, - { "logging", "boolean", NULL }, - { "lsm_merge", "boolean", NULL }, - { "multiprocess", "boolean", NULL }, - { "session_max", "int", "min=1" }, - { "sync", "boolean", NULL }, - { "transactional", "boolean", NULL }, - { "use_environment_priv", "boolean", NULL }, + { "buffer_alignment", "int", "min=-1,max=1MB", NULL }, + { "cache", "category", NULL, __wt_confchk_cache_subconfigs }, + { "create", "boolean", NULL, NULL }, + { "direct_io", "list", "choices=[\"data\",\"log\"]", NULL }, + { "error_prefix", "string", NULL, NULL }, + { "eviction_target", "int", "min=10,max=99", NULL }, + { "eviction_trigger", "int", "min=10,max=99", NULL }, + { "extensions", "list", NULL, NULL }, + { "hazard_max", "int", "min=15", NULL }, + { "logging", "boolean", NULL, NULL }, + { "lsm_merge", "boolean", NULL, NULL }, + { "multiprocess", "boolean", NULL, NULL }, + { "session_max", "int", "min=1", NULL }, + { "sync", "boolean", NULL, NULL }, + { "transactional", "boolean", NULL, NULL }, + { "use_environment_priv", "boolean", NULL, NULL }, { "verbose", "list", "choices=[\"block\",\"cache_pool\",\"ckpt\"," "\"evict\",\"evictserver\",\"fileops\",\"hazard\",\"lsm\",\"mutex\"," "\"read\",\"readserver\",\"reconcile\",\"salvage\",\"verify\"," - "\"write\"]" }, - { NULL, NULL, NULL } + "\"write\"]", NULL }, + { NULL, NULL, NULL, NULL } }; diff --git a/src/include/config.h b/src/include/config.h index 2ce280fbba1..0bd6232c576 100644 --- a/src/include/config.h +++ b/src/include/config.h @@ -26,4 +26,5 @@ struct __wt_config_check { const char *name; const char *type; const char *checks; + WT_CONFIG_CHECK *subconfigs; }; diff --git a/src/include/extern.h b/src/include/extern.h index 56f27374c7b..0e3908277e2 100644 --- a/src/include/extern.h +++ b/src/include/extern.h @@ -560,6 +560,8 @@ extern WT_CONFIG_CHECK __wt_confchk_connection_load_extension[]; extern const char *__wt_confdfl_connection_open_session; extern WT_CONFIG_CHECK __wt_confchk_connection_open_session[]; extern const char *__wt_confdfl_connection_reconfigure; +extern const char *__wt_confdfl_cache_subconfigs; +extern WT_CONFIG_CHECK __wt_confchk_cache_subconfigs[]; extern WT_CONFIG_CHECK __wt_confchk_connection_reconfigure[]; extern const char *__wt_confdfl_cursor_close; extern WT_CONFIG_CHECK __wt_confchk_cursor_close[]; diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index 02636ff7c88..61e5965d35c 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -992,20 +992,35 @@ struct __wt_connection { * * @param connection the connection handle * @configstart{connection.reconfigure, see dist/api_data.py} - * @config{cache_pool, name of a cache pool that is shared between - * databases.,a string; default empty.} - * @config{cache_pool_chunk, the granularity that a cache pool is shared - * out. Only valid if the cache_pool option is also specified..,an - * integer between 1MB and 10TB; default \c .} - * @config{cache_pool_quota, the maximum amount of the cache pool a - * single database can use. Only valid if the cache_pool option is also - * specified..,an integer between 1MB and 10TB; default \c .} - * @config{cache_pool_size, size of a cache pool that is shared between - * databases. Only valid if the cache_pool option is also specified. - * Must be specified if this connection may create the cache pool.,an - * integer between 1MB and 10TB; default \c .} - * @config{cache_size, maximum heap memory to allocate for the cache.,an - * integer between 1MB and 10TB; default \c 100MB.} + * @config{cache, cache configuration setup.,a list of configuration + * settings @subconfigstart{cache, see dist/api_data.py} + * @subconfig{size, maximum heap memory to allocate for the cache.,an + * integer between 1MB and 10TB; default \c 100MB.} @subconfig{pool, + * name of a cache pool that is shared between databases.,a string; + * default empty.} @subconfig{pool_min, minimum amount of cache a + * connection in a cache pool can have.,an integer between 1MB and 10TB; + * default \c .} @subconfig{pool_chunk, the granularity that a cache + * pool is shared out. Only valid if the cache_pool option is also + * specified.,an integer between 1MB and 10TB; default \c .} + * @subconfigend; } + * @config{error_prefix, prefix string for error messages.,a string; + * default empty.} + * @config{eviction_target, continue evicting until the cache becomes + * less full than this (as a percentage). Must be less than \c + * eviction_trigger.,an integer between 10 and 99; default \c 80.} + * @config{eviction_trigger, trigger eviction when the cache becomes + * this full (as a percentage).,an integer between 10 and 99; default \c + * 95.} + * @config{verbose, enable messages for various events. Options are + * given as a list\, such as + * "verbose=[evictserver\,read]".,a list\, with values + * chosen from the following options: \c "block"\, \c "cache_pool"\, \c + * "ckpt"\, \c "evict"\, \c "evictserver"\, \c "fileops"\, \c "hazard"\, + * \c "lsm"\, \c "mutex"\, \c "read"\, \c "readserver"\, \c + * "reconcile"\, \c "salvage"\, \c "verify"\, \c "write"; default + * empty.} + * @configend + * empty.} * @config{error_prefix, prefix string for error messages.,a string; * default empty.} * @config{eviction_target, continue evicting until the cache becomes @@ -1176,20 +1191,58 @@ struct __wt_connection { * I/O. By default\, a platform-specific alignment value is used (512 bytes on * Linux systems\, zero elsewhere).,an integer between -1 and 1MB; default \c * -1.} - * @config{cache_pool, name of a cache pool that is shared between databases.,a - * string; default empty.} - * @config{cache_pool_chunk, the granularity that a cache pool is shared out. - * Only valid if the cache_pool option is also specified..,an integer between - * 1MB and 10TB; default \c .} - * @config{cache_pool_quota, the maximum amount of the cache pool a single - * database can use. Only valid if the cache_pool option is also specified..,an - * integer between 1MB and 10TB; default \c .} - * @config{cache_pool_size, size of a cache pool that is shared between - * databases. Only valid if the cache_pool option is also specified. Must be - * specified if this connection may create the cache pool.,an integer between - * 1MB and 10TB; default \c .} - * @config{cache_size, maximum heap memory to allocate for the cache.,an integer - * between 1MB and 10TB; default \c 100MB.} + * @config{cache, cache configuration setup.,a list of configuration settings + * @subconfigstart{cache, see dist/api_data.py} @subconfig{size, maximum heap + * memory to allocate for the cache.,an integer between 1MB and 10TB; default \c + * 100MB.} @subconfig{pool, name of a cache pool that is shared between + * databases.,a string; default empty.} @subconfig{pool_min, minimum amount of + * cache a connection in a cache pool can have.,an integer between 1MB and 10TB; + * default \c .} @subconfig{pool_chunk, the granularity that a cache pool is + * shared out. Only valid if the cache_pool option is also specified.,an integer + * between 1MB and 10TB; default \c .} @subconfigend; } + * @config{create, create the database if it does not exist.,a boolean flag; + * default \c false.} + * @config{direct_io, Use \c O_DIRECT to access files. Options are given as a + * list\, such as "direct_io=[data]".,a list\, with values chosen + * from the following options: \c "data"\, \c "log"; default empty.} + * @config{error_prefix, prefix string for error messages.,a string; default + * empty.} + * @config{eviction_target, continue evicting until the cache becomes less full + * than this (as a percentage). Must be less than \c eviction_trigger.,an + * integer between 10 and 99; default \c 80.} + * @config{eviction_trigger, trigger eviction when the cache becomes this full + * (as a percentage).,an integer between 10 and 99; default \c 95.} + * @config{extensions, list of shared library extensions to load (using dlopen). + * Optional values are passed as the \c config parameter to + * WT_CONNECTION::load_extension. Complex paths may require quoting\, for + * example\, extensions=("/path/ext.so"="entry=my_entry").,a list + * of strings; default empty.} + * @config{hazard_max, maximum number of simultaneous hazard references per + * session handle.,an integer greater than or equal to 15; default \c 1000.} + * @config{logging, enable logging.,a boolean flag; default \c false.} + * @config{lsm_merge, merge LSM chunks where possible.,a boolean flag; default + * \c true.} + * @config{multiprocess, permit sharing between processes (will automatically + * start an RPC server for primary processes and use RPC for secondary + * processes). Not yet supported in WiredTiger.,a boolean flag; default + * \c false.} + * @config{session_max, maximum expected number of sessions (including server + * threads).,an integer greater than or equal to 1; default \c 50.} + * @config{sync, flush files to stable storage when closing or writing + * checkpoints.,a boolean flag; default \c true.} + * @config{transactional, support transactional semantics.,a boolean flag; + * default \c true.} + * @config{use_environment_priv, use the \c WIREDTIGER_CONFIG and \c + * WIREDTIGER_HOME environment variables regardless of whether or not the + * process is running with special privileges. See @ref home for more + * information.,a boolean flag; default \c false.} + * @config{verbose, enable messages for various events. Options are given as a + * list\, such as "verbose=[evictserver\,read]".,a list\, with + * values chosen from the following options: \c "block"\, \c "cache_pool"\, \c + * "ckpt"\, \c "evict"\, \c "evictserver"\, \c "fileops"\, \c "hazard"\, \c + * "lsm"\, \c "mutex"\, \c "read"\, \c "readserver"\, \c "reconcile"\, \c + * "salvage"\, \c "verify"\, \c "write"; default empty.} + * @configend * @config{create, create the database if it does not exist.,a boolean flag; * default \c false.} * @config{direct_io, Use \c O_DIRECT to access files. Options are given as a -- cgit v1.2.1 From a828010c3aa72c20b3122a8d39d1ac51f8169807 Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Wed, 7 Nov 2012 11:06:50 +1100 Subject: Add support for getting config values with "X.Y" keys, update auto-generated defaults to match. --- dist/config.py | 41 +++++++++++++++-------------------------- src/btree/bt_cache.c | 2 +- src/config/config.c | 18 +++++++++++++++--- src/config/config_def.c | 16 +++++++--------- src/conn/conn_cache_pool.c | 8 ++++---- src/include/extern.h | 1 - 6 files changed, 42 insertions(+), 44 deletions(-) diff --git a/dist/config.py b/dist/config.py index 251b9b3aaeb..f235cdfbb50 100644 --- a/dist/config.py +++ b/dist/config.py @@ -23,15 +23,6 @@ def gettype(c): ctype = 'int' return ctype or 'string' -def getsubconfigstr(c): - '''Return a string indicating if an item has sub configuration''' - ctype = gettype(c) - if ctype == 'category': - return '__wt_confchk_' + c.name + '_subconfigs' - else: - return 'NULL' - - def typedesc(c): '''Descripe what type of value is expected for the given config item''' checks = c.flags @@ -179,26 +170,19 @@ def get_default(c): t = gettype(c) if c.default == 'false': return '0' + elif t == 'category': + return '(%s)' % (','.join('%s=%s' % (subc.name, get_default(subc)) + for subc in sorted(c.subconfig))) elif (c.default or t == 'int') and c.default != 'true': return str(c.default) else: return '' created_subconfigs=set() - -def add_subconfig(c, tfile): +def add_subconfig(c): + if c.name in created_subconfigs: + return created_subconfigs.add(c.name) - subname = c.name.replace('.', '_') - tfile.write(''' -const char * -__wt_confdfl_%(name)s_subconfigs = -%(config)s; -''' % { - 'name' : subname, - 'config' : '\n'.join('\t"%s"' % line - for line in w.wrap(','.join('%s=%s' % (subc.name, get_default(subc)) - for subc in sorted(c.subconfig))) or [""]), -}) tfile.write(''' WT_CONFIG_CHECK __wt_confchk_%(name)s_subconfigs[] = { @@ -211,6 +195,15 @@ __wt_confchk_%(name)s_subconfigs[] = { (subc.name, gettype(subc), checkstr(subc)))) for subc in sorted(c.subconfig)), }) +def getsubconfigstr(c): + '''Return a string indicating if an item has sub configuration''' + ctype = gettype(c) + if ctype == 'category': + add_subconfig(c) + return '__wt_confchk_' + c.name + '_subconfigs' + else: + return 'NULL' + for name in sorted(api_data.methods.keys()): ctype = api_data.methods[name].config name = name.replace('.', '_') @@ -224,10 +217,6 @@ __wt_confdfl_%(name)s = for line in w.wrap(','.join('%s=%s' % (c.name, get_default(c)) for c in sorted(ctype))) or [""]), }) - # Deal with subsets of configuration settings. - for c in sorted(ctype): - if gettype(c) == 'category' and c.name not in created_subconfigs: - add_subconfig(c, tfile) # Construct an array of allowable configuration options. Always append an empty # string as a terminator for iteration diff --git a/src/btree/bt_cache.c b/src/btree/bt_cache.c index 6134c3f64a5..fa50b9e52cc 100644 --- a/src/btree/bt_cache.c +++ b/src/btree/bt_cache.c @@ -24,7 +24,7 @@ __wt_cache_config(WT_CONNECTION_IMPL *conn, const char *cfg[]) /* Ignore the cache size if a shared cache is configured. */ if (!F_ISSET(conn, WT_CONN_CACHE_POOL) && - (ret = __wt_config_gets(session, cfg, "cache_size", &cval)) == 0) + (ret = __wt_config_gets(session, cfg, "cache.size", &cval)) == 0) conn->cache_size = (uint64_t)cval.val; WT_RET_NOTFOUND_OK(ret); diff --git a/src/config/config.c b/src/config/config.c index bde794eee17..e351a7bf946 100644 --- a/src/config/config.c +++ b/src/config/config.c @@ -568,17 +568,29 @@ int __wt_config_getraw( WT_CONFIG *cparser, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value) { - WT_CONFIG_ITEM k, v; + WT_CONFIG sparser; + WT_CONFIG_ITEM k, v, subk; WT_DECL_RET; int found; found = 0; while ((ret = __config_next(cparser, &k, &v)) == 0) { - if ((k.type == ITEM_STRING || k.type == ITEM_ID) && - key->len == k.len && + if (k.type != ITEM_STRING && k.type != ITEM_ID) + continue; + if (k.len == key->len && strncasecmp(key->str, k.str, k.len) == 0) { *value = v; found = 1; + } else if (k.len < key->len && key->str[k.len] == '.' && + strncasecmp(key->str, k.str, k.len) == 0) { + subk.str = key->str + k.len + 1; + subk.len = key->len - k.len - 1; + WT_RET(__wt_config_initn( + cparser->session, &sparser, v.str, v.len)); + if ((ret = + __wt_config_getraw(&sparser, &subk, value)) == 0) + found = 1; + WT_RET_NOTFOUND_OK(ret); } } diff --git a/src/config/config_def.c b/src/config/config_def.c index cbed4f729c0..6ab7530b7fd 100644 --- a/src/config/config_def.c +++ b/src/config/config_def.c @@ -83,11 +83,8 @@ __wt_confchk_connection_open_session[] = { const char * __wt_confdfl_connection_reconfigure = - "cache=,error_prefix=,eviction_target=80,eviction_trigger=95,verbose="; - -const char * -__wt_confdfl_cache_subconfigs = - "pool=,pool_chunk=,pool_min=,size=100MB"; + "cache=(pool=,pool_chunk=,pool_min=,size=100MB),error_prefix=," + "eviction_target=80,eviction_trigger=95,verbose="; WT_CONFIG_CHECK __wt_confchk_cache_subconfigs[] = { @@ -414,10 +411,11 @@ __wt_confchk_table_meta[] = { const char * __wt_confdfl_wiredtiger_open = - "buffer_alignment=-1,cache=,create=0,direct_io=,error_prefix=," - "eviction_target=80,eviction_trigger=95,extensions=,hazard_max=1000," - "logging=0,lsm_merge=,multiprocess=0,session_max=50,sync=," - "transactional=,use_environment_priv=0,verbose="; + "buffer_alignment=-1,cache=(pool=,pool_chunk=,pool_min=,size=100MB)," + "create=0,direct_io=,error_prefix=,eviction_target=80," + "eviction_trigger=95,extensions=,hazard_max=1000,logging=0,lsm_merge=" + ",multiprocess=0,session_max=50,sync=,transactional=," + "use_environment_priv=0,verbose="; WT_CONFIG_CHECK __wt_confchk_wiredtiger_open[] = { diff --git a/src/conn/conn_cache_pool.c b/src/conn/conn_cache_pool.c index deab10f5425..4ad9b8d178c 100644 --- a/src/conn/conn_cache_pool.c +++ b/src/conn/conn_cache_pool.c @@ -40,7 +40,7 @@ __wt_conn_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg) pool_name = NULL; cp = NULL; - WT_RET(__wt_config_gets(session, cfg, "cache_pool", &cval)); + WT_RET(__wt_config_gets(session, cfg, "cache.pool", &cval)); if (cval.len <= 0) return (0); @@ -50,7 +50,7 @@ __wt_conn_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg) if (__wt_process.cache_pool == NULL) { /* Create a cache pool. */ WT_ERR(__wt_config_gets( - session, cfg, "cache_pool_size", &cval)); + session, cfg, "cache.pool_size", &cval)); if (cval.len <= 0) { WT_ERR_MSG(session, WT_ERROR, "Attempting to join a cache pool that does not " @@ -68,14 +68,14 @@ __wt_conn_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg) "cache pool server", 0, &cp->cache_pool_cond)); WT_ERR(__wt_config_gets( - session, cfg, "cache_pool_chunk", &cval)); + session, cfg, "cache.pool_chunk", &cval)); if (cval.len > 0) cp->chunk = cval.val; else cp->chunk = WT_MAX( 50 * WT_MEGABYTE, cp->size / 20); WT_ERR(__wt_config_gets( - session, cfg, "cache_pool_quota", &cval)); + session, cfg, "cache.pool_quota", &cval)); if (cval.len > 0) cp->quota = cval.val; else diff --git a/src/include/extern.h b/src/include/extern.h index 0e3908277e2..022aa8908be 100644 --- a/src/include/extern.h +++ b/src/include/extern.h @@ -560,7 +560,6 @@ extern WT_CONFIG_CHECK __wt_confchk_connection_load_extension[]; extern const char *__wt_confdfl_connection_open_session; extern WT_CONFIG_CHECK __wt_confchk_connection_open_session[]; extern const char *__wt_confdfl_connection_reconfigure; -extern const char *__wt_confdfl_cache_subconfigs; extern WT_CONFIG_CHECK __wt_confchk_cache_subconfigs[]; extern WT_CONFIG_CHECK __wt_confchk_connection_reconfigure[]; extern const char *__wt_confdfl_cursor_close; -- cgit v1.2.1 From 67c4f92cb1cfef2f69ca1611067618524e0c8fe9 Mon Sep 17 00:00:00 2001 From: Alex Gorrod Date: Wed, 7 Nov 2012 19:17:56 +1100 Subject: Add configuration string checking to subconfig options. Update all uses of cache_size in our tree to be cache.size Update cache pool implementation to no longer have a quota option. Update cache pool implementation to have a minimum/initial size. Update subconfig documentation tags, so the doc looks OK. --- dist/config.py | 42 +++++++++++++++++++++--------------------- examples/c/ex_config.c | 2 +- examples/c/ex_test_perf.c | 8 ++++---- src/config/config_check.c | 42 ++++++++++++++++++++++++++++++++++++------ src/conn/conn_api.c | 8 ++++---- src/conn/conn_cache_pool.c | 24 ++++++++++++------------ src/include/api.h | 2 +- src/include/cache.h | 2 +- src/include/extern.h | 3 ++- src/include/wiredtiger.in | 35 +++++++++++++++++------------------ test/bloom/test_bloom.c | 2 +- test/fops/t.c | 2 +- test/format/wts.c | 2 +- test/suite/test_cache_pool.py | 6 +++--- test/suite/test_config01.py | 2 +- test/suite/test_config04.py | 6 +++--- test/suite/test_cursor03.py | 2 +- test/suite/test_schema03.py | 2 +- test/thread/t.c | 2 +- 19 files changed, 112 insertions(+), 82 deletions(-) diff --git a/dist/config.py b/dist/config.py index f235cdfbb50..962bd247cf2 100644 --- a/dist/config.py +++ b/dist/config.py @@ -35,6 +35,7 @@ def typedesc(c): 'format' : 'a format string', 'int' : 'an integer', 'list' : 'a list', + 'category': 'a set of related configuration options defined below', 'string' : 'a string'}[ctype] if cmin and cmax: desc += ' between ' + cmin + ' and ' + cmax @@ -52,27 +53,26 @@ def typedesc(c): desc += ' of strings' return desc -def categorydesc(c): - desc = 'a list of configuration settings' - desc += ' @subconfigstart{' + c.name + ', see dist/api_data.py}' - for subc in c.subconfig: - desc += ' ' + parseconfig(subc) - desc = desc.replace('@config', '@subconfig') - desc += ' @subconfigend' - return desc - -def parseconfig(c): - desc = textwrap.dedent(c.desc) + '.' - desc = desc.replace(',', '\\,') - default = '\\c ' + str(c.default) if c.default or gettype(c) == 'int' \ - else 'empty' - if gettype(c) == 'category': - tdesc = categorydesc(c) + ';\n' - else: - tdesc = typedesc(c) + '; default ' + default + '.' - tdesc = tdesc.replace(',', '\\,') - output = '@config{' + ','.join((c.name, desc, tdesc)) + '}' - return output +def parseconfig(c, parent_name=None): + ctype = gettype(c) + desc = textwrap.dedent(c.desc) + '.' + desc = desc.replace(',', '\\,') + default = '\\c ' + str(c.default) if c.default or ctype == 'int' \ + else 'empty' + name = c.name + if parent_name: + name = parent_name + '.' + name + + tdesc = typedesc(c) + if ctype != 'category': + tdesc += '; default ' + default + tdesc += '.' + tdesc = tdesc.replace(',', '\\,') + output = '@config{' + ','.join((name, desc, tdesc)) + '}' + if ctype == 'category': + for subc in c.subconfig: + output += parseconfig(subc, c.name) + return output skip = False for line in open(f, 'r'): diff --git a/examples/c/ex_config.c b/examples/c/ex_config.c index a38c16b0e86..88178380f8e 100644 --- a/examples/c/ex_config.c +++ b/examples/c/ex_config.c @@ -46,7 +46,7 @@ int main(void) /*! [configure cache size] */ if ((ret = wiredtiger_open(home, NULL, - "create,cache_size=500M", &conn)) != 0) + "create,cache.size=500M", &conn)) != 0) fprintf(stderr, "Error connecting to %s: %s\n", home, wiredtiger_strerror(ret)); /*! [configure cache size] */ diff --git a/examples/c/ex_test_perf.c b/examples/c/ex_test_perf.c index 6c8dc776b91..32cccaf8a35 100644 --- a/examples/c/ex_test_perf.c +++ b/examples/c/ex_test_perf.c @@ -77,7 +77,7 @@ void usage(void); CONFIG default_cfg = { "WT_TEST", /* home */ "lsm:test", /* uri */ - "create,cache_size=200MB", /* conn_config */ + "create,cache.size=200MB", /* conn_config */ "key_format=S,value_format=S", /* table_config */ 1, /* create */ 14023954, /* rand_seed */ @@ -99,7 +99,7 @@ CONFIG default_cfg = { CONFIG small_cfg = { "WT_TEST", /* home */ "lsm:test", /* uri */ - "create,cache_size=500MB", /* conn_config */ + "create,cache.size=500MB", /* conn_config */ "key_format=S,value_format=S,lsm_chunk_size=5MB," "leaf_page_max=16k,internal_page_max=16kb", /* table_config */ 1, /* create */ @@ -122,7 +122,7 @@ CONFIG small_cfg = { CONFIG med_cfg = { "WT_TEST", /* home */ "lsm:test", /* uri */ - "create,cache_size=1GB", /* conn_config */ + "create,cache.size=1GB", /* conn_config */ "key_format=S,value_format=S,lsm_chunk_size=20MB," "leaf_page_max=16k,internal_page_max=16kb", /* table_config */ 1, /* create */ @@ -145,7 +145,7 @@ CONFIG med_cfg = { CONFIG large_cfg = { "WT_TEST", /* home */ "lsm:test", /* uri */ - "create,cache_size=2GB", /* conn_config */ + "create,cache.size=2GB", /* conn_config */ "key_format=S,value_format=S,lsm_chunk_size=50MB," "leaf_page_max=16k,internal_page_max=16kb", /* table_config */ 1, /* create */ diff --git a/src/config/config_check.c b/src/config/config_check.c index 5d4a758fb3e..5585a5d02c6 100644 --- a/src/config/config_check.c +++ b/src/config/config_check.c @@ -11,24 +11,32 @@ * __wt_config_check-- * Check that all keys in an application-supplied config string match * what is specified in the check string. + * The final parameter is optional, and allows for passing in strings + * that are not NULL terminated. * * All check strings are generated by dist/config.py from the constraints given * in dist/api_data.py */ int __wt_config_check(WT_SESSION_IMPL *session, - WT_CONFIG_CHECK checks[], const char *config) + WT_CONFIG_CHECK checks[], const char *config, size_t config_len) { WT_CONFIG parser, cparser, sparser; WT_CONFIG_ITEM k, v, ck, cv, dummy; WT_DECL_RET; + const char *cn; int badtype, found, i; + size_t len; + uint64_t cl; /* It is always okay to pass NULL. */ if (config == NULL) return (0); - WT_RET(__wt_config_init(session, &parser, config)); + if (config_len == 0) + WT_RET(__wt_config_init(session, &parser, config)); + else + WT_RET(__wt_config_initn(session, &parser, config, config_len)); while ((ret = __wt_config_next(&parser, &k, &v)) == 0) { if (k.type != ITEM_STRING && k.type != ITEM_ID) WT_RET_MSG(session, EINVAL, @@ -36,12 +44,19 @@ __wt_config_check(WT_SESSION_IMPL *session, (int)k.len, k.str); /* The config check array is sorted, so exit on first found */ - for (i = 0, found = 0; checks[i].name != NULL; i++) - if (WT_STRING_CASE_MATCH( - checks[i].name, k.str, k.len)) { + for (i = 0, found = 0; checks[i].name != NULL; i++) { + cn = checks[i].name; + if (WT_STRING_CASE_MATCH(cn, k.str, k.len)) { found = 1; break; } + cl = strlen(cn); + if (k.len > cl && k.str[cl] == '.' && + WT_STRING_CASE_MATCH(cn, k.str, cl)) { + found = 2; + break; + } + } if (!found) WT_RET_MSG(session, EINVAL, @@ -55,7 +70,22 @@ __wt_config_check(WT_SESSION_IMPL *session, (v.val != 0 && v.val != 1)); else if (strcmp(checks[i].type, "list") == 0) badtype = (v.len > 0 && v.type != ITEM_STRUCT); - else + else if (strcmp(checks[i].type, "category") == 0) { + /* + * Deal with categories that could either be of the + * form: + * XXX.XXX=blah (found will be 2) OR + * XXX=(XXX=blah) (found will be 1) + */ + len = (found == 1) ? v.len : k.len + v.len - cl; + ret = __wt_config_check(session, + checks[i].subconfigs, + k.str + strlen(cn) + 1, len); + if (ret != EINVAL) + badtype = 0; + else + badtype = 1; + } else badtype = 0; if (badtype) diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c index 0c1b8895e37..159ebba1c14 100644 --- a/src/conn/conn_api.c +++ b/src/conn/conn_api.c @@ -526,7 +526,7 @@ __conn_config_file(WT_SESSION_IMPL *session, const char **cfg, WT_ITEM **cbufp) /* Check the configuration string. */ WT_ERR(__wt_config_check( - session, __wt_confchk_wiredtiger_open, cbuf->data)); + session, __wt_confchk_wiredtiger_open, cbuf->data, 0)); /* * The configuration file falls between the default configuration and @@ -577,7 +577,7 @@ __conn_config_env(WT_SESSION_IMPL *session, const char **cfg) /* Check the configuration string. */ WT_RET(__wt_config_check( - session, __wt_confchk_wiredtiger_open, env_config)); + session, __wt_confchk_wiredtiger_open, env_config, 0)); /* * The environment setting comes second-to-last: it overrides the @@ -830,8 +830,8 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, WT_ERR(__wt_connection_init(conn)); /* Check the configuration strings. */ - WT_ERR( - __wt_config_check(session, __wt_confchk_wiredtiger_open, config)); + WT_ERR(__wt_config_check( + session, __wt_confchk_wiredtiger_open, config, 0)); /* Get the database home. */ WT_ERR(__conn_home(session, home, cfg)); diff --git a/src/conn/conn_cache_pool.c b/src/conn/conn_cache_pool.c index 4ad9b8d178c..f73e605f01e 100644 --- a/src/conn/conn_cache_pool.c +++ b/src/conn/conn_cache_pool.c @@ -50,7 +50,7 @@ __wt_conn_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg) if (__wt_process.cache_pool == NULL) { /* Create a cache pool. */ WT_ERR(__wt_config_gets( - session, cfg, "cache.pool_size", &cval)); + session, cfg, "cache.size", &cval)); if (cval.len <= 0) { WT_ERR_MSG(session, WT_ERROR, "Attempting to join a cache pool that does not " @@ -75,17 +75,17 @@ __wt_conn_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg) cp->chunk = WT_MAX( 50 * WT_MEGABYTE, cp->size / 20); WT_ERR(__wt_config_gets( - session, cfg, "cache.pool_quota", &cval)); + session, cfg, "cache.pool_min", &cval)); if (cval.len > 0) - cp->quota = cval.val; + cp->min = cval.val; else - cp->quota = cp->size / 2; + cp->min = cp->size / 2; __wt_process.cache_pool = cp; WT_VERBOSE_VOID(session, cache_pool, "Created cache pool %s. Size: %" PRIu64 - ", chunk size: %" PRIu64 ", quota: %" PRIu64, - cp->name, cp->size, cp->chunk, cp->quota); + ", chunk size: %" PRIu64 ", min: %" PRIu64, + cp->name, cp->size, cp->chunk, cp->min); } else if (!WT_STRING_MATCH( __wt_process.cache_pool->name, pool_name, strlen(pool_name))) WT_ERR_MSG(session, WT_ERROR, @@ -279,12 +279,12 @@ __cache_pool_balance(void) * which doesn't do the right thing at the moment. */ if (entry->cache_size == 0) { - added = cp->chunk; - entry->cache_size = cp->chunk; - cp->currently_used += cp->chunk; + added = cp->min; + entry->cache_size = cp->min; + cp->currently_used += cp->min; cache->cp_skip_count = WT_CACHE_POOL_BUMP_SKIPS; } else if (highest > 1 && - entry->cache_size < cp->quota && + entry->cache_size < cp->size && cache->bytes_inmem >= (entry->cache_size * cache->eviction_target) / 100 && cp->currently_used < cp->size && @@ -296,14 +296,14 @@ __cache_pool_balance(void) cache->cp_skip_count = WT_CACHE_POOL_BUMP_SKIPS; } else if (read_pressure < WT_CACHE_POOL_REDUCE_THRESHOLD && highest > 1 && - entry->cache_size > cp->chunk && + entry->cache_size > cp->min && cp->currently_used >= cp->size) { /* * If a connection isn't actively using it's assigned * cache and is assigned a reasonable amount - reduce * it. */ - added = -cp->chunk; + added = -WT_MIN(cp->chunk, entry->cache_size - cp->min); entry->cache_size -= cp->chunk; cp->currently_used -= cp->chunk; cache->cp_skip_count = WT_CACHE_POOL_REDUCE_SKIPS; diff --git a/src/include/api.h b/src/include/api.h index 6bf52aabe2b..c976b444a7b 100644 --- a/src/include/api.h +++ b/src/include/api.h @@ -289,7 +289,7 @@ struct __wt_connection_impl { const char *cfgvar[] = API_CONF_DEFAULTS(h, n, cfg); \ API_SESSION_INIT(s, h, n, cur, bt); \ WT_ERR(((cfg) != NULL) ? \ - __wt_config_check((s), __wt_confchk_##h##_##n, (cfg)) : 0) + __wt_config_check((s), __wt_confchk_##h##_##n, (cfg), 0) : 0) #define API_END(s) \ if ((s) != NULL) { \ diff --git a/src/include/cache.h b/src/include/cache.h index dbdbf8021d3..33ff57e5956 100644 --- a/src/include/cache.h +++ b/src/include/cache.h @@ -78,7 +78,7 @@ struct __wt_cache_pool { WT_CONDVAR *cache_pool_cond; const char *name; uint64_t size; - uint64_t quota; + uint64_t min; /* The minimum size per connection. */ uint64_t chunk; uint64_t currently_used; uint32_t flags; diff --git a/src/include/extern.h b/src/include/extern.h index 022aa8908be..dba53b6c5a9 100644 --- a/src/include/extern.h +++ b/src/include/extern.h @@ -536,7 +536,8 @@ extern int __wt_config_subgets(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *value); extern int __wt_config_check(WT_SESSION_IMPL *session, WT_CONFIG_CHECK checks[], - const char *config); + const char *config, + size_t config_len); extern int __wt_config_collapse( WT_SESSION_IMPL *session, const char **cfg, const char **config_ret); diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index 61e5965d35c..e2284755302 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -992,17 +992,16 @@ struct __wt_connection { * * @param connection the connection handle * @configstart{connection.reconfigure, see dist/api_data.py} - * @config{cache, cache configuration setup.,a list of configuration - * settings @subconfigstart{cache, see dist/api_data.py} - * @subconfig{size, maximum heap memory to allocate for the cache.,an - * integer between 1MB and 10TB; default \c 100MB.} @subconfig{pool, - * name of a cache pool that is shared between databases.,a string; - * default empty.} @subconfig{pool_min, minimum amount of cache a - * connection in a cache pool can have.,an integer between 1MB and 10TB; - * default \c .} @subconfig{pool_chunk, the granularity that a cache - * pool is shared out. Only valid if the cache_pool option is also - * specified.,an integer between 1MB and 10TB; default \c .} - * @subconfigend; } + * @config{cache, cache configuration setup.,a set of related + * configuration options defined below.}@config{cache.size, maximum heap + * memory to allocate for the cache.,an integer between 1MB and 10TB; + * default \c 100MB.}@config{cache.pool, name of a cache pool that is + * shared between databases.,a string; default + * empty.}@config{cache.pool_min, minimum amount of cache a connection + * in a cache pool can have.,an integer between 1MB and 10TB; default \c + * .}@config{cache.pool_chunk, the granularity that a cache pool is + * shared out. Only valid if the cache_pool option is also specified.,an + * integer between 1MB and 10TB; default \c .} * @config{error_prefix, prefix string for error messages.,a string; * default empty.} * @config{eviction_target, continue evicting until the cache becomes @@ -1191,15 +1190,15 @@ struct __wt_connection { * I/O. By default\, a platform-specific alignment value is used (512 bytes on * Linux systems\, zero elsewhere).,an integer between -1 and 1MB; default \c * -1.} - * @config{cache, cache configuration setup.,a list of configuration settings - * @subconfigstart{cache, see dist/api_data.py} @subconfig{size, maximum heap - * memory to allocate for the cache.,an integer between 1MB and 10TB; default \c - * 100MB.} @subconfig{pool, name of a cache pool that is shared between - * databases.,a string; default empty.} @subconfig{pool_min, minimum amount of + * @config{cache, cache configuration setup.,a set of related configuration + * options defined below.}@config{cache.size, maximum heap memory to allocate + * for the cache.,an integer between 1MB and 10TB; default \c + * 100MB.}@config{cache.pool, name of a cache pool that is shared between + * databases.,a string; default empty.}@config{cache.pool_min, minimum amount of * cache a connection in a cache pool can have.,an integer between 1MB and 10TB; - * default \c .} @subconfig{pool_chunk, the granularity that a cache pool is + * default \c .}@config{cache.pool_chunk, the granularity that a cache pool is * shared out. Only valid if the cache_pool option is also specified.,an integer - * between 1MB and 10TB; default \c .} @subconfigend; } + * between 1MB and 10TB; default \c .} * @config{create, create the database if it does not exist.,a boolean flag; * default \c false.} * @config{direct_io, Use \c O_DIRECT to access files. Options are given as a diff --git a/test/bloom/test_bloom.c b/test/bloom/test_bloom.c index aa6100e542c..cba3fb474d4 100644 --- a/test/bloom/test_bloom.c +++ b/test/bloom/test_bloom.c @@ -138,7 +138,7 @@ int setup(void) * end so they can override "standard" configuration. */ snprintf(config, sizeof(config), - "create,error_prefix=\"%s\",cache_size=%" PRIu32 "MB,%s", + "create,error_prefix=\"%s\",cache.size=%" PRIu32 "MB,%s", g.progname, g.c_cache, g.config_open == NULL ? "" : g.config_open); if ((ret = wiredtiger_open(NULL, &event_handler, config, &conn)) != 0) diff --git a/test/fops/t.c b/test/fops/t.c index 538436da652..3691a7d7c29 100644 --- a/test/fops/t.c +++ b/test/fops/t.c @@ -144,7 +144,7 @@ wt_startup(char *config_open) char config_buf[128]; snprintf(config_buf, sizeof(config_buf), - "create,error_prefix=\"%s\",cache_size=5MB%s%s", + "create,error_prefix=\"%s\",cache.size=5MB%s%s", progname, config_open == NULL ? "" : ",", config_open == NULL ? "" : config_open); diff --git a/test/format/wts.c b/test/format/wts.c index 24532db56ff..d68c0a93c7d 100644 --- a/test/format/wts.c +++ b/test/format/wts.c @@ -74,7 +74,7 @@ wts_open(void) * the standard configuration. */ snprintf(config, sizeof(config), - "create,error_prefix=\"%s\",cache_size=%" PRIu32 "MB,sync=false," + "create,error_prefix=\"%s\",cache.size=%" PRIu32 "MB,sync=false," "extensions=[\"%s\",\"%s\", \"%s\"],%s", g.progname, g.c_cache, access(BZIP_PATH, R_OK) == 0 ? BZIP_PATH : "", diff --git a/test/suite/test_cache_pool.py b/test/suite/test_cache_pool.py index f402afb2b6b..68a0aff5a94 100644 --- a/test/suite/test_cache_pool.py +++ b/test/suite/test_cache_pool.py @@ -66,7 +66,7 @@ class test_cache_pool(wttest.WiredTigerTestCase): def openConnections( self, connections, - pool_opts = ',cache_pool=pool,cache_pool_size=200M,cache_pool_chunk=20M,cache_pool_quota=100M,', + pool_opts = ',cache=(pool=pool,size=200M,pool_chunk=20M,pool_min=60M),', extra_opts = '', add=0): if add == 0: @@ -180,7 +180,7 @@ class test_cache_pool(wttest.WiredTigerTestCase): nops = 1000 self.openConnections(['WT_TEST1', 'WT_TEST2']) - self.openConnections(['WT_TEST3'], add=1, pool_opts=',cache_size=50M') + self.openConnections(['WT_TEST3'], add=1, pool_opts=',cache=(size=50M)') for sess in self.sessions: sess.create(self.uri, "key_format=S,value_format=S") self.add_records(sess, 0, nops) @@ -189,7 +189,7 @@ class test_cache_pool(wttest.WiredTigerTestCase): # Test default config values def test_cache_pool9(self): nops = 1000 - self.openConnections(['WT_TEST1', 'WT_TEST2'], pool_opts=',cache_pool=pool,cache_pool_size=200M') + self.openConnections(['WT_TEST1', 'WT_TEST2'], pool_opts=',cache=(pool=pool,size=200M)') for sess in self.sessions: sess.create(self.uri, "key_format=S,value_format=S") diff --git a/test/suite/test_config01.py b/test/suite/test_config01.py index 7a47ec962c0..7cd6212c0e1 100644 --- a/test/suite/test_config01.py +++ b/test/suite/test_config01.py @@ -39,7 +39,7 @@ class test_config01(test_base03.test_base03): def setUpConnectionOpen(self, dir): wtopen_args = 'create' if hasattr(self, 'cache_size'): - wtopen_args += ',cache_size=' + str(self.cache_size) + wtopen_args += ',cache.size=' + str(self.cache_size) conn = wiredtiger.wiredtiger_open(dir, wtopen_args) self.pr(`conn`) return conn diff --git a/test/suite/test_config04.py b/test/suite/test_config04.py index fdda95e74dc..d5334d153da 100644 --- a/test/suite/test_config04.py +++ b/test/suite/test_config04.py @@ -80,7 +80,7 @@ class test_config04(wttest.WiredTigerTestCase): self.populate_and_check() def common_cache_size_test(self, sizestr, size): - self.common_test('cache_size=' + sizestr) + self.common_test('cache.size=' + sizestr) cursor = self.session.open_cursor('statistics:', None, None) cursor.set_key(wiredtiger.stat.cache_bytes_max) self.assertEqual(cursor.search(), 0) @@ -124,12 +124,12 @@ class test_config04(wttest.WiredTigerTestCase): def test_cache_too_small(self): self.assertRaisesWithMessage(wiredtiger.WiredTigerError, - lambda: wiredtiger.wiredtiger_open('.', 'create,cache_size=900000'), + lambda: wiredtiger.wiredtiger_open('.', 'create,cache.size=900000'), "/Value too small for key 'cache_size' the minimum is/") def test_cache_too_large(self): T11 = 11 * self.T # 11 Terabytes - configstr = 'create,cache_size=' + str(T11) + configstr = 'create,cache.size=' + str(T11) self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: wiredtiger.wiredtiger_open('.', configstr), "/Value too large for key 'cache_size' the maximum is/") diff --git a/test/suite/test_cursor03.py b/test/suite/test_cursor03.py index b163188837e..1be62f5c79c 100644 --- a/test/suite/test_cursor03.py +++ b/test/suite/test_cursor03.py @@ -69,7 +69,7 @@ class test_cursor03(TestCursorTracker): return self.session.open_cursor(tablearg, None, 'append') def setUpConnectionOpen(self, dir): - wtopen_args = 'create,cache_size=' + str(self.cache_size); + wtopen_args = 'create,cache.size=' + str(self.cache_size) conn = wiredtiger.wiredtiger_open(dir, wtopen_args) self.pr(`conn`) return conn diff --git a/test/suite/test_schema03.py b/test/suite/test_schema03.py index dd66e3f4e0d..8d2b6f4cb7e 100644 --- a/test/suite/test_schema03.py +++ b/test/suite/test_schema03.py @@ -286,7 +286,7 @@ class test_schema03(wttest.WiredTigerTestCase): def setUpConnectionOpen(self, dir): conn = wiredtiger.wiredtiger_open(dir, - 'create,cache_size=100m,session_max=1000') + 'create,cache.size=100m,session_max=1000') self.pr(`conn`) return conn diff --git a/test/thread/t.c b/test/thread/t.c index 313f63d7420..138b883a67b 100644 --- a/test/thread/t.c +++ b/test/thread/t.c @@ -158,7 +158,7 @@ wt_connect(char *config_open) char config[128]; snprintf(config, sizeof(config), - "create,error_prefix=\"%s\",cache_size=5MB%s%s", + "create,error_prefix=\"%s\",cache.size=5MB%s%s", progname, config_open == NULL ? "" : ",", config_open == NULL ? "" : config_open); -- cgit v1.2.1 From f6bf0fbe3b66d58c2787d1bd1edf4a6dd12c27fc Mon Sep 17 00:00:00 2001 From: Alex Gorrod Date: Wed, 7 Nov 2012 19:27:58 +1100 Subject: Fix occurrences of cache_size in the test suite. --- test/suite/test_config03.py | 1 + test/suite/test_config04.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/suite/test_config03.py b/test/suite/test_config03.py index 8e1a2007a4b..57e636e4983 100644 --- a/test/suite/test_config03.py +++ b/test/suite/test_config03.py @@ -97,6 +97,7 @@ class test_config03(test_base03.test_base03): if value == False: value = 'false' args += ',' + var + '=' + str(value) + args = args.replace('cache_size', 'cache.size') args += ',' self.pr('wiredtiger_open with args: ' + args) diff --git a/test/suite/test_config04.py b/test/suite/test_config04.py index d5334d153da..8b01482ce9c 100644 --- a/test/suite/test_config04.py +++ b/test/suite/test_config04.py @@ -125,14 +125,14 @@ class test_config04(wttest.WiredTigerTestCase): def test_cache_too_small(self): self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: wiredtiger.wiredtiger_open('.', 'create,cache.size=900000'), - "/Value too small for key 'cache_size' the minimum is/") + "/Value too small for key 'size' the minimum is/") def test_cache_too_large(self): T11 = 11 * self.T # 11 Terabytes - configstr = 'create,cache.size=' + str(T11) + configstr = 'create,cache.size=' + str(T11) self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: wiredtiger.wiredtiger_open('.', configstr), - "/Value too large for key 'cache_size' the maximum is/") + "/Value too large for key 'size' the maximum is/") def test_eviction(self): self.common_test('eviction_target=84,eviction_trigger=94') -- cgit v1.2.1