diff options
author | Keith Bostic <keith@wiredtiger.com> | 2015-03-14 11:02:48 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2015-03-14 11:02:48 -0400 |
commit | 048642bec015d33d165510ef918c60adad26cc1c (patch) | |
tree | 084c2057a5c94ff99bc049f910235d977e5a4991 /src | |
parent | e7ef6d0c3d107f374de9924d981d731fe36fb4ec (diff) | |
parent | dc19643859063a03b985d97e2f24b1262ec4b15d (diff) | |
download | mongo-048642bec015d33d165510ef918c60adad26cc1c.tar.gz |
Merge branch 'develop' into page-alloc-accounting
Diffstat (limited to 'src')
-rw-r--r-- | src/async/async_api.c | 8 | ||||
-rw-r--r-- | src/async/async_op.c | 10 | ||||
-rw-r--r-- | src/config/config_def.c | 2 | ||||
-rw-r--r-- | src/include/wiredtiger.in | 12 | ||||
-rw-r--r-- | src/log/log.c | 2 | ||||
-rw-r--r-- | src/txn/txn_recover.c | 7 |
6 files changed, 26 insertions, 15 deletions
diff --git a/src/async/async_api.c b/src/async/async_api.c index e211f2352a4..44e492cb0e5 100644 --- a/src/async/async_api.c +++ b/src/async/async_api.c @@ -181,11 +181,13 @@ __async_config(WT_SESSION_IMPL *session, *runp = cval.val != 0; /* - * Even if async is turned off, we want to parse and store the - * default values so that reconfigure can just enable them. + * Even if async is turned off, we want to parse and store the default + * values so that reconfigure can just enable them. + * + * Bound the minimum maximum operations at 10. */ WT_RET(__wt_config_gets(session, cfg, "async.ops_max", &cval)); - conn->async_size = (uint32_t)cval.val; + conn->async_size = (uint32_t)WT_MAX(cval.val, 10); WT_RET(__wt_config_gets(session, cfg, "async.threads", &cval)); conn->async_workers = (uint32_t)cval.val; diff --git a/src/async/async_op.c b/src/async/async_op.c index 86797af635b..d0c58f584cc 100644 --- a/src/async/async_op.c +++ b/src/async/async_op.c @@ -267,11 +267,17 @@ __wt_async_op_enqueue(WT_SESSION_IMPL *session, WT_ASYNC_OP_IMPL *op) conn = S2C(session); async = conn->async; + /* - * Enqueue op at the tail of the work queue. + * If an application re-uses a WT_ASYNC_OP, we end up here with an + * invalid object. */ - WT_ASSERT(session, op->state == WT_ASYNCOP_READY); + if (op->state != WT_ASYNCOP_READY) + WT_RET_MSG(session, EINVAL, + "application error: WT_ASYNC_OP already in use"); + /* + * Enqueue op at the tail of the work queue. * We get our slot in the ring buffer to use. */ my_alloc = WT_ATOMIC_ADD8(async->alloc_head, 1); diff --git a/src/config/config_def.c b/src/config/config_def.c index 43d87c518e4..c5c68e5d320 100644 --- a/src/config/config_def.c +++ b/src/config/config_def.c @@ -39,7 +39,7 @@ static const WT_CONFIG_CHECK confchk_connection_open_session[] = { static const WT_CONFIG_CHECK confchk_async_subconfigs[] = { { "enabled", "boolean", NULL, NULL }, - { "ops_max", "int", "min=10,max=4096", NULL }, + { "ops_max", "int", "min=1,max=4096", NULL }, { "threads", "int", "min=1,max=20", NULL }, { NULL, NULL, NULL, NULL } }; diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index 66d3eea0861..32ffdc4cbdb 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -1552,11 +1552,11 @@ struct __wt_connection { * @config{ enabled, enable asynchronous * operation., a boolean flag; default \c false.} * @config{ ops_max, maximum number of expected - * simultaneous asynchronous operations., an integer between 10 and - * 4096; default \c 1024.} - * @config{ threads, the - * number of worker threads to service asynchronous requests., an - * integer between 1 and 20; default \c 2.} + * simultaneous asynchronous operations., an integer between 1 and 4096; + * default \c 1024.} + * @config{ threads, the number + * of worker threads to service asynchronous requests., an integer + * between 1 and 20; default \c 2.} * @config{ ),,} * @config{cache_overhead, assume the heap allocator overhead is the * specified percentage\, and adjust the cache usage by that amount (for @@ -1886,7 +1886,7 @@ struct __wt_connection { * boolean flag; default \c false.} * @config{ ops_max, * maximum number of expected simultaneous asynchronous operations., an integer - * between 10 and 4096; default \c 1024.} + * between 1 and 4096; default \c 1024.} * @config{ threads, the number of worker threads to * service asynchronous requests., an integer between 1 and 20; default \c 2.} * @config{ ),,} diff --git a/src/log/log.c b/src/log/log.c index f485f0a09e5..12ec8d2e17d 100644 --- a/src/log/log.c +++ b/src/log/log.c @@ -221,7 +221,7 @@ __wt_log_extract_lognum( if (id == NULL || name == NULL) return (WT_ERROR); if ((p = strrchr(name, '.')) == NULL || - sscanf(++p, "%" PRIu32, id) != 1) + sscanf(++p, "%" SCNu32, id) != 1) WT_RET_MSG(session, WT_ERROR, "Bad log file name '%s'", name); return (0); } diff --git a/src/txn/txn_recover.c b/src/txn/txn_recover.c index 2c834083691..bc098875abf 100644 --- a/src/txn/txn_recover.c +++ b/src/txn/txn_recover.c @@ -304,6 +304,7 @@ __recovery_setup_file(WT_RECOVERY *r, const char *uri, const char *config) { WT_CONFIG_ITEM cval; WT_LSN lsn; + intmax_t offset; uint32_t fileid; WT_RET(__wt_config_getones(r->session, config, "id", &cval)); @@ -325,8 +326,10 @@ __recovery_setup_file(WT_RECOVERY *r, const char *uri, const char *config) /* If there is checkpoint logged for the file, apply everything. */ if (cval.type != WT_CONFIG_ITEM_STRUCT) WT_INIT_LSN(&lsn); - else if (sscanf(cval.str, "(%" PRIu32 ",%" PRIdMAX ")", - &lsn.file, (intmax_t*)&lsn.offset) != 2) + else if (sscanf(cval.str, + "(%" SCNu32 ",%" SCNdMAX ")", &lsn.file, &offset) == 2) + lsn.offset = offset; + else WT_RET_MSG(r->session, EINVAL, "Failed to parse checkpoint LSN '%.*s'", (int)cval.len, cval.str); |