summaryrefslogtreecommitdiff
path: root/bench/wtperf/wtperf.c
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2016-01-21 17:07:55 +1100
committerAlex Gorrod <alexg@wiredtiger.com>2016-01-21 17:07:55 +1100
commitf403c1d0ec3e6384512a4eff6ac968d6a604c06a (patch)
tree8b058d2c78b7ee9b644f0a837166f4131e831430 /bench/wtperf/wtperf.c
parent8b0c0bd2822f3e453583e58e49719606ea3cf663 (diff)
downloadmongo-f403c1d0ec3e6384512a4eff6ac968d6a604c06a.tar.gz
WT-2342 Add background create/drop to wtperf.
Works on idle tables. Gives us a way to ensure that schema operations don't get blocked during high throughput workloads.
Diffstat (limited to 'bench/wtperf/wtperf.c')
-rw-r--r--bench/wtperf/wtperf.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c
index e5526880f2a..cef3138b865 100644
--- a/bench/wtperf/wtperf.c
+++ b/bench/wtperf/wtperf.c
@@ -57,6 +57,8 @@ static const CONFIG default_cfg = {
0, /* thread error */
0, /* notify threads to stop */
0, /* in warmup phase */
+ NULL, /* Thread ID of idle cycle thread */
+ 0, /* Signal idle cycle thread */
0, /* total seconds running */
0, /* has truncate */
{NULL, NULL}, /* the truncate queue */
@@ -1371,6 +1373,10 @@ execute_populate(CONFIG *cfg)
" populate thread(s) for %" PRIu32 " items",
cfg->populate_threads, cfg->icount);
+ /* Start cycling idle tables if configured. */
+ if ((ret = start_idle_table_cycle(cfg)) != 0)
+ return (ret);
+
cfg->insert_key = 0;
cfg->popthreads = dcalloc(cfg->populate_threads, sizeof(CONFIG_THREAD));
@@ -1498,6 +1504,11 @@ execute_populate(CONFIG *cfg)
(uint64_t)(WT_TIMEDIFF_SEC(stop, start)));
assert(tables == 0);
}
+
+ /* Stop cycling idle tables. */
+ if ((ret = stop_idle_table_cycle(cfg)) != 0)
+ return (ret);
+
return (0);
}
@@ -1562,6 +1573,10 @@ execute_workload(CONFIG *cfg)
last_updates = 0;
ret = 0;
+ /* Start cycling idle tables. */
+ if ((ret = start_idle_table_cycle(cfg)) != 0)
+ return (ret);
+
if (cfg->warmup != 0)
cfg->in_warmup = 1;
@@ -1657,6 +1672,10 @@ execute_workload(CONFIG *cfg)
/* Notify the worker threads they are done. */
err: cfg->stop = 1;
+ /* Stop cycling idle tables. */
+ if ((ret = stop_idle_table_cycle(cfg)) != 0)
+ return (ret);
+
if ((t_ret = stop_threads(
cfg, (u_int)cfg->workers_cnt, cfg->workers)) != 0 && ret == 0)
ret = t_ret;