From f46350b57fbef56e291a02eb137f93b3dd9ffaa4 Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Fri, 9 Nov 2012 11:50:30 +1100 Subject: ex_test_perf.c:456:11: error: 'elapsed' may be used uninitialized in this function --- src/include/wiredtiger.in | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index b9691676801..9115f92cf5a 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -994,8 +994,16 @@ struct __wt_connection { * * @param connection the connection handle * @configstart{connection.reconfigure, see dist/api_data.py} - * @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 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 @@ -1007,10 +1015,11 @@ struct __wt_connection { * @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 "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.} + * 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 * @errors */ @@ -1165,8 +1174,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_size, maximum heap memory to allocate for the cache.,an integer - * between 1MB and 10TB; default \c 100MB.} + * @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{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 @@ -1205,10 +1221,10 @@ struct __wt_connection { * 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 "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.} + * 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 * Additionally, if a file named \c WiredTiger.config appears in the WiredTiger * home directory, it is read for configuration values (see @ref config_file -- cgit v1.2.1 From e040d5a3d9d48c0706d1860956f52bfb25a66d6f Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Fri, 9 Nov 2012 12:00:57 +1100 Subject: ex_test_perf.c:456:11: error: 'elapsed' may be used uninitialized in this function --- examples/c/ex_test_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/c/ex_test_perf.c b/examples/c/ex_test_perf.c index 32b820b5fa4..43627e58a85 100644 --- a/examples/c/ex_test_perf.c +++ b/examples/c/ex_test_perf.c @@ -446,7 +446,7 @@ int execute_populate(CONFIG *cfg) return (ret); gettimeofday(&cfg->phase_start_time, NULL); - for (cfg->elapsed_time = 0, last_ops = 0; + for (cfg->elapsed_time = 0, elapsed = last_ops = 0; g_nops < cfg->icount && g_threads_quit < cfg->populate_threads;) { /* * Sleep for 100th of a second, report_interval is in second -- cgit v1.2.1 From d3aab45b9609d4cde97fe1574daa7a2f557a87e4 Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Fri, 9 Nov 2012 14:50:56 +1100 Subject: Clarify the docs for the default buffer_alignment setting. --- dist/api_data.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/api_data.py b/dist/api_data.py index 33c0a02a66b..d4c62b6cb74 100644 --- a/dist/api_data.py +++ b/dist/api_data.py @@ -453,9 +453,9 @@ methods = { 'wiredtiger_open' : Method(connection_runtime_config + [ Config('buffer_alignment', '-1', r''' - in-memory alignment (in bytes) for buffers used for I/O. By - default, a platform-specific alignment value is used (512 bytes - on Linux systems, zero elsewhere)''', + in-memory alignment (in bytes) for buffers used for I/O. The default + value of -1 indicates that a platform-specific alignment value should + be used (512 bytes on Linux systems, zero elsewhere)''', min='-1', max='1MB'), Config('create', 'false', r''' create the database if it does not exist''', -- cgit v1.2.1 From 366ef0f2876ca32c17afd4702eca3d8c3c3856c8 Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Fri, 9 Nov 2012 15:08:23 +1100 Subject: Update auto-generated files. --- src/include/wiredtiger.in | 46 +++++++++++++++------------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index 9115f92cf5a..6a6541a957e 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -994,16 +994,8 @@ struct __wt_connection { * * @param connection the connection handle * @configstart{connection.reconfigure, see dist/api_data.py} - * @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{cache_size, maximum heap memory to allocate for the cache.,an + * integer between 1MB and 10TB; default \c 100MB.} * @config{error_prefix, prefix string for error messages.,a string; * default empty.} * @config{eviction_target, continue evicting until the cache becomes @@ -1015,11 +1007,10 @@ struct __wt_connection { * @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.} + * chosen from the following options: \c "block"\, \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 * @errors */ @@ -1171,18 +1162,11 @@ struct __wt_connection { * handler is installed that writes error messages to stderr * @configstart{wiredtiger_open, see dist/api_data.py} * @config{buffer_alignment, in-memory alignment (in bytes) for buffers used for - * 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 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 .} + * I/O. The default value of -1 indicates that a platform-specific alignment + * value should be used (512 bytes on Linux systems\, zero elsewhere).,an + * integer between -1 and 1MB; default \c -1.} + * @config{cache_size, maximum heap memory to allocate for the cache.,an integer + * between 1MB and 10TB; default \c 100MB.} * @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 @@ -1221,10 +1205,10 @@ struct __wt_connection { * 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.} + * values chosen from the following options: \c "block"\, \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 * Additionally, if a file named \c WiredTiger.config appears in the WiredTiger * home directory, it is read for configuration values (see @ref config_file -- cgit v1.2.1 From 4166623d777656bfdf4e2c746661e447ef3d168d Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Fri, 9 Nov 2012 15:08:24 +1100 Subject: Clean up some complaints from s_all. --- dist/s_string.ok | 2 +- examples/c/ex_test_perf.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dist/s_string.ok b/dist/s_string.ok index 3cc9659a210..7e9825ef609 100644 --- a/dist/s_string.ok +++ b/dist/s_string.ok @@ -34,10 +34,10 @@ Bsearch Btree Bzip CAS -CDLMRSTdehikrsuv CELL's CELLs CKPT +CLMPRSTdehikrsuv CLR COL's CONCAT diff --git a/examples/c/ex_test_perf.c b/examples/c/ex_test_perf.c index 43627e58a85..6e686929418 100644 --- a/examples/c/ex_test_perf.c +++ b/examples/c/ex_test_perf.c @@ -350,7 +350,8 @@ stat_worker(void *arg) lsm_uri = calloc( strlen(cfg->uri) + strlen("statistics:") + 1, 1); if (lsm_uri == NULL) { - lprintf(cfg, ENOMEM, 0, "Statistics thread uri create."); + lprintf( + cfg, ENOMEM, 0, "Statistics thread uri create."); goto err; } sprintf(lsm_uri, "statistics:%s", cfg->uri); @@ -847,7 +848,7 @@ void print_config(CONFIG *cfg) void usage(void) { - printf("ex_perf_test [-CDLMPRSTdehikrsuv]\n"); + printf("ex_perf_test [-CLMPRSTdehikrsuv]\n"); printf("\t-S Use a small default configuration\n"); printf("\t-M Use a medium default configuration\n"); printf("\t-L Use a large default configuration\n"); -- cgit v1.2.1 From e2256d6888c70cb169744feb1711266d54069217 Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Fri, 9 Nov 2012 15:11:31 +1100 Subject: Drop any old Bloom filter before creating a new one -- we may have been interrupted in between creating it and updating the metadata. --- src/lsm/lsm_tree.c | 2 +- src/lsm/lsm_worker.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lsm/lsm_tree.c b/src/lsm/lsm_tree.c index efdadbee498..adde8794ec9 100644 --- a/src/lsm/lsm_tree.c +++ b/src/lsm/lsm_tree.c @@ -180,7 +180,7 @@ __wt_lsm_tree_setup_chunk(WT_SESSION_IMPL *session, /* * Drop the chunk first - there may be some content hanging over from - * an aborted merge. + * an aborted merge or checkpoint. * * Don't do this for the very first chunk: we are called during * WT_SESSION::create, and doing a drop inside there does interesting diff --git a/src/lsm/lsm_worker.c b/src/lsm/lsm_worker.c index 511b75a1346..5d66b155df8 100644 --- a/src/lsm/lsm_worker.c +++ b/src/lsm/lsm_worker.c @@ -193,6 +193,7 @@ __lsm_bloom_create(WT_SESSION_IMPL *session, WT_CURSOR *src; WT_DECL_RET; WT_ITEM buf, key; + WT_SESSION *wt_session; const char *cur_cfg[] = API_CONF_DEFAULTS(session, open_cursor, "raw"); uint64_t insert_count; @@ -212,6 +213,13 @@ __lsm_bloom_create(WT_SESSION_IMPL *session, chunk->bloom_uri = __wt_buf_steal(session, &buf, NULL); } + /* + * Drop the bloom filter first - there may be some content hanging over + * from an aborted merge or checkpoint. + */ + wt_session = &session->iface; + WT_RET(wt_session->drop(wt_session, chunk->bloom_uri, "force")); + bloom = NULL; WT_RET(__wt_bloom_create(session, chunk->bloom_uri, -- cgit v1.2.1 From 40a775d5bf94e4d3b84a120bc51e2c8808ab15fc Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Fri, 9 Nov 2012 15:11:33 +1100 Subject: Write the metadata after creating missing Bloom filters. --- src/lsm/lsm_worker.c | 63 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/src/lsm/lsm_worker.c b/src/lsm/lsm_worker.c index 5d66b155df8..36bfdf762c9 100644 --- a/src/lsm/lsm_worker.c +++ b/src/lsm/lsm_worker.c @@ -85,11 +85,14 @@ __wt_lsm_checkpoint_worker(void *arg) WT_CLEAR(cookie); - while (F_ISSET(lsm_tree, WT_LSM_TREE_WORKING)) { + for (;;) { WT_ERR(__wt_lsm_copy_chunks(session, lsm_tree, &cookie)); /* Write checkpoints in all completed files. */ for (i = 0, j = 0; i < cookie.nchunks; i++) { + if (!F_ISSET(lsm_tree, WT_LSM_TREE_WORKING)) + goto err; + chunk = cookie.chunk_array[i]; /* Stop if a thread is still active in the chunk. */ if (chunk->ncursor != 0 || @@ -97,7 +100,15 @@ __wt_lsm_checkpoint_worker(void *arg) !F_ISSET(chunk, WT_LSM_CHUNK_ONDISK))) break; - if (!F_ISSET(chunk, WT_LSM_CHUNK_BLOOM) && + if (F_ISSET(chunk, WT_LSM_CHUNK_ONDISK) && + (!FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_NEWEST) || + F_ISSET(chunk, WT_LSM_CHUNK_BLOOM) || + chunk->count == 0)) + continue; + + if (FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_NEWEST) && + !F_ISSET(chunk, WT_LSM_CHUNK_BLOOM) && + chunk->count != 0 && (ret = __lsm_bloom_create( session, lsm_tree, chunk)) != 0) { (void)__wt_err( @@ -105,35 +116,43 @@ __wt_lsm_checkpoint_worker(void *arg) break; } - if (F_ISSET(chunk, WT_LSM_CHUNK_ONDISK)) - continue; - /* * NOTE: we pass a non-NULL config, because otherwise * __wt_checkpoint thinks we're closing the file. */ - WT_WITH_SCHEMA_LOCK(session, - ret = __wt_schema_worker(session, chunk->uri, - __wt_checkpoint, cfg, 0)); - if (ret == 0) { - ++j; - __wt_spin_lock(session, &lsm_tree->lock); - F_SET(chunk, WT_LSM_CHUNK_ONDISK); - ++lsm_tree->dsk_gen; - __wt_spin_unlock(session, &lsm_tree->lock); - WT_VERBOSE_ERR(session, lsm, - "LSM worker checkpointed %d.", i); - } else { - (void)__wt_err( - session, ret, "LSM checkpoint failed"); + if (!F_ISSET(chunk, WT_LSM_CHUNK_ONDISK)) { + WT_WITH_SCHEMA_LOCK(session, + ret = __wt_schema_worker(session, + chunk->uri, __wt_checkpoint, cfg, 0)); + + if (ret != 0) { + (void)__wt_err(session, ret, + "LSM checkpoint failed"); + break; + } + } + + ++j; + __wt_spin_lock(session, &lsm_tree->lock); + F_SET(chunk, WT_LSM_CHUNK_ONDISK); + ++lsm_tree->dsk_gen; + ret = __wt_lsm_meta_write(session, lsm_tree); + __wt_spin_unlock(session, &lsm_tree->lock); + + if (ret != 0) { + (void)__wt_err(session, ret, + "LSM metadata write failed"); break; } + + WT_VERBOSE_ERR(session, lsm, + "LSM worker checkpointed %d.", i); } if (j == 0) __wt_sleep(0, 1000); } -err: __wt_free(session, cookie.chunk_array); +err: __wt_free(session, cookie.chunk_array); return (NULL); } @@ -197,10 +216,6 @@ __lsm_bloom_create(WT_SESSION_IMPL *session, const char *cur_cfg[] = API_CONF_DEFAULTS(session, open_cursor, "raw"); uint64_t insert_count; - if (!FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_NEWEST) || - chunk->count == 0) - return (0); - /* * Normally, the Bloom URI is populated when the chunk struct is * allocated. After an open, however, it may not have been. -- cgit v1.2.1