Skip to content

Commit ff5b24c

Browse files
committed
Import wiredtiger-wiredtiger-2.7.0-858-g444981a.tar.gz from wiredtiger branch mongodb-3.4
ref: 4531b92..444981a SERVER-22773 Fix CRC32 implementation for ppc64le platform WT-2432 Understand eviction impact on LSM and readonly workload WT-2433 Allow read-only databases to log statistics WT-2434 Fix a race between force-drop and sweep WT-2437 Fix test suite failures on Windows WT-2438 Extend WiredTiger stat declarations to help timeseries tool WT-2440 vpmsum_crc32: Per the PPC64 ABI, v20-v31 are non-volatile register
1 parent 7e8566b commit ff5b24c

30 files changed

+390
-125
lines changed

src/third_party/wiredtiger/bench/wtperf/config.c

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,6 @@ config_threads(CONFIG *cfg, const char *config, size_t len)
241241
goto err;
242242
continue;
243243
}
244-
if (STRING_MATCH("throttle", k.str, k.len)) {
245-
workp->throttle = (uint64_t)v.val;
246-
continue;
247-
}
248244
if (STRING_MATCH("insert", k.str, k.len) ||
249245
STRING_MATCH("inserts", k.str, k.len)) {
250246
if ((workp->insert = v.val) < 0)
@@ -262,20 +258,17 @@ config_threads(CONFIG *cfg, const char *config, size_t len)
262258
goto err;
263259
continue;
264260
}
265-
if (STRING_MATCH("update", k.str, k.len) ||
266-
STRING_MATCH("updates", k.str, k.len)) {
267-
if ((workp->update = v.val) < 0)
268-
goto err;
261+
if (STRING_MATCH("throttle", k.str, k.len)) {
262+
workp->throttle = (uint64_t)v.val;
269263
continue;
270264
}
271265
if (STRING_MATCH("truncate", k.str, k.len)) {
272266
if ((workp->truncate = v.val) != 1)
273267
goto err;
274268
/* There can only be one Truncate thread. */
275-
if (cfg->has_truncate != 0) {
269+
if (F_ISSET(cfg, CFG_TRUNCATE))
276270
goto err;
277-
}
278-
cfg->has_truncate = 1;
271+
F_SET(cfg, CFG_TRUNCATE);
279272
continue;
280273
}
281274
if (STRING_MATCH("truncate_pct", k.str, k.len)) {
@@ -290,6 +283,29 @@ config_threads(CONFIG *cfg, const char *config, size_t len)
290283
workp->truncate_count = (uint64_t)v.val;
291284
continue;
292285
}
286+
if (STRING_MATCH("update", k.str, k.len) ||
287+
STRING_MATCH("updates", k.str, k.len)) {
288+
if ((workp->update = v.val) < 0)
289+
goto err;
290+
continue;
291+
}
292+
if (STRING_MATCH("update_delta", k.str, k.len)) {
293+
if (v.type == WT_CONFIG_ITEM_STRING ||
294+
v.type == WT_CONFIG_ITEM_ID) {
295+
if (strncmp(v.str, "rand", 4) != 0)
296+
goto err;
297+
/* Special random value */
298+
workp->update_delta = INT64_MAX;
299+
F_SET(cfg, CFG_GROW);
300+
} else {
301+
workp->update_delta = v.val;
302+
if (v.val > 0)
303+
F_SET(cfg, CFG_GROW);
304+
if (v.val < 0)
305+
F_SET(cfg, CFG_SHRINK);
306+
}
307+
continue;
308+
}
293309
goto err;
294310
}
295311
if (ret == WT_NOTFOUND)
@@ -409,7 +425,12 @@ config_opt(CONFIG *cfg, WT_CONFIG_ITEM *k, WT_CONFIG_ITEM *v)
409425
*(uint32_t *)valueloc = (uint32_t)v->val;
410426
break;
411427
case CONFIG_STRING_TYPE:
412-
if (v->type != WT_CONFIG_ITEM_STRING) {
428+
/*
429+
* Configuration parsing uses string/ID to distinguish
430+
* between quoted and unquoted values.
431+
*/
432+
if (v->type != WT_CONFIG_ITEM_STRING &&
433+
v->type != WT_CONFIG_ITEM_ID) {
413434
fprintf(stderr, "wtperf: Error: "
414435
"bad string value for \'%.*s=%.*s\'\n",
415436
(int)k->len, k->str, (int)v->len, v->str);
@@ -438,7 +459,8 @@ config_opt(CONFIG *cfg, WT_CONFIG_ITEM *k, WT_CONFIG_ITEM *v)
438459
STRING_MATCH("threads", k->str, k->len))
439460
return (config_threads(cfg, v->str, v->len));
440461

441-
if (v->type != WT_CONFIG_ITEM_STRING) {
462+
if (v->type != WT_CONFIG_ITEM_STRING &&
463+
v->type != WT_CONFIG_ITEM_ID) {
442464
fprintf(stderr, "wtperf: Error: "
443465
"bad string value for \'%.*s=%.*s\'\n",
444466
(int)k->len, k->str, (int)v->len, v->str);
@@ -672,6 +694,25 @@ config_sanity(CONFIG *cfg)
672694
return (EINVAL);
673695
}
674696

697+
if (cfg->value_sz_max < cfg->value_sz) {
698+
if (F_ISSET(cfg, CFG_GROW)) {
699+
fprintf(stderr, "value_sz_max %" PRIu32
700+
" must be greater than or equal to value_sz %"
701+
PRIu32 "\n", cfg->value_sz_max, cfg->value_sz);
702+
return (EINVAL);
703+
} else
704+
cfg->value_sz_max = cfg->value_sz;
705+
}
706+
if (cfg->value_sz_min > cfg->value_sz) {
707+
if (F_ISSET(cfg, CFG_SHRINK)) {
708+
fprintf(stderr, "value_sz_min %" PRIu32
709+
" must be less than or equal to value_sz %"
710+
PRIu32 "\n", cfg->value_sz_min, cfg->value_sz);
711+
return (EINVAL);
712+
} else
713+
cfg->value_sz_min = cfg->value_sz;
714+
}
715+
675716
if (cfg->readonly && cfg->workload != NULL)
676717
for (i = 0, workp = cfg->workload;
677718
i < cfg->workload_cnt; ++i, ++workp)

src/third_party/wiredtiger/bench/wtperf/runners/evict-btree-readonly.wtperf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# wtperf options file: evict btree configuration
2-
conn_config="cache_size=50M"
2+
conn_config="cache_size=50M,eviction=(threads_max=4),mmap=false"
33
table_config="type=file"
44
icount=10000000
55
report_interval=5

src/third_party/wiredtiger/bench/wtperf/runners/evict-btree.wtperf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# wtperf options file: evict btree configuration
2-
conn_config="cache_size=50M"
2+
conn_config="cache_size=50M,eviction=(threads_max=4)"
33
table_config="type=file"
44
icount=10000000
55
report_interval=5

src/third_party/wiredtiger/bench/wtperf/runners/evict-lsm-readonly.wtperf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# wtperf options file: evict lsm configuration
2-
conn_config="cache_size=50M,lsm_manager=(worker_thread_max=6)"
2+
conn_config="cache_size=50M,lsm_manager=(worker_thread_max=6),eviction=(threads_max=4)"
33
table_config="type=lsm,lsm=(chunk_size=2M),os_cache_dirty_max=16MB"
44
compact=true
55
icount=10000000

src/third_party/wiredtiger/bench/wtperf/runners/evict-lsm.wtperf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# wtperf options file: evict lsm configuration
2-
conn_config="cache_size=50M,lsm_manager=(worker_thread_max=6)"
2+
conn_config="cache_size=50M,lsm_manager=(worker_thread_max=6),eviction=(threads_max=4)"
33
table_config="type=lsm,lsm=(chunk_size=2M),os_cache_dirty_max=16MB"
44
compact=true
55
icount=10000000
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# wtperf options file: Mixed workload where we grow some values and shrink
2+
# others. Mixed load leaning toward growing the dataset.
3+
#
4+
conn_config="cache_size=2GB,checkpoint=(wait=30)"
5+
table_config="type=file,leaf_page_max=32k,leaf_value_max=128k,split_pct=90"
6+
# The values are starting small, insert a lot so our database grows larger than
7+
# cache quickly.
8+
icount=200000
9+
report_interval=5
10+
run_time=300
11+
populate_threads=1
12+
#
13+
# Run more grow workload threads than shrink threads.
14+
#
15+
threads=((count=4,update=1,update_delta=100),(count=2,update=1,update_delta=-150))
16+
value_sz=20000
17+
value_sz_min=1000
18+
value_sz_max=65536
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# wtperf options file: Mixed workload where we grow some values and shrink
2+
# others. Mixed load leaning toward shrinking the dataset.
3+
#
4+
conn_config="cache_size=2GB,checkpoint=(wait=30)"
5+
table_config="type=file,leaf_page_max=32k,leaf_value_max=128k,split_pct=90"
6+
# The values are starting small, insert a lot so our database grows larger than
7+
# cache quickly.
8+
icount=200000
9+
report_interval=5
10+
run_time=300
11+
populate_threads=1
12+
#
13+
# Run more shrink workload threads than grow threads.
14+
#
15+
threads=((count=2,update=1,update_delta=150),(count=4,update=1,update_delta=-100))
16+
value_sz=20000
17+
value_sz_min=1000
18+
value_sz_max=65536
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# wtperf options file: Mixed workload where we grow some values and shrink
2+
# others. Mixed load leaning toward mostly a balance.
3+
#
4+
conn_config="cache_size=2GB,checkpoint=(wait=30)"
5+
table_config="type=file,leaf_page_max=32k,leaf_value_max=128k,split_pct=90"
6+
# The values are starting small, insert a lot so our database grows larger than
7+
# cache quickly.
8+
icount=200000
9+
report_interval=5
10+
run_time=300
11+
populate_threads=1
12+
#
13+
# Run a balance of threads.
14+
#
15+
threads=((count=3,update=1,update_delta=100),(count=3,update=1,update_delta=-100))
16+
value_sz=20000
17+
value_sz_min=1000
18+
value_sz_max=65536
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# wtperf options file: Grow the size of documents while there is cache
2+
# pressure and appends are happening as well.
3+
conn_config="cache_size=2GB,checkpoint=(wait=30)"
4+
table_config="type=file,leaf_page_max=32k,leaf_value_max=128k,split_pct=90"
5+
# The values are starting small, insert a lot so our database grows larger than
6+
# cache quickly.
7+
icount=200000
8+
report_interval=5
9+
run_time=240
10+
populate_threads=1
11+
# Continue inserting new records.
12+
threads=((count=1,inserts=1,throttle=1000),(count=4,update=1,update_delta=100))
13+
# Start with small values and let them grow slowly to large values.
14+
value_sz=10000
15+
value_sz_max=65536
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# wtperf options file: Shrink the size of values. Checkpoint frequently
2+
# and insert new records too.
3+
#
4+
conn_config="cache_size=2GB,checkpoint=(wait=30)"
5+
table_config="type=file,leaf_page_max=32k,leaf_value_max=128k,split_pct=90"
6+
# Since we're continually inserting, start with a smaller number initially.
7+
icount=200000
8+
report_interval=5
9+
run_time=240
10+
populate_threads=1
11+
# Continue inserting new records.
12+
threads=((count=1,inserts=1,throttle=1000),(count=4,update=1,update_delta=-100))
13+
# Start with moderate values and let them shrink slowly.
14+
value_sz_min=1000
15+
value_sz=10000

0 commit comments

Comments
 (0)