diff options
author | Ramon Fernandez <ramon@mongodb.com> | 2016-08-26 18:28:48 -0400 |
---|---|---|
committer | Ramon Fernandez <ramon@mongodb.com> | 2016-08-26 18:28:48 -0400 |
commit | f2a613a41d6ad7b5a1b66087e386380d38e50599 (patch) | |
tree | 4843fb7b6a835e72046142046e9364f7d7dda992 | |
parent | 7614c0eb2449eb4ec22d21b677177124d61f1888 (diff) | |
download | mongo-f2a613a41d6ad7b5a1b66087e386380d38e50599.tar.gz |
Import wiredtiger: 2566118fc68b0124187e806bed52eb7cdbcb1be0 from branch mongodb-3.4
ref: 34182ad..2566118fc6
for: 3.3.12
WT-2631 nullptr is passed for parameters marked with attribute non-null
WT-2638 ftruncate may not be supported
WT-2645 wt dump: push the complexity of collecting metadata into a dump cursor
WT-2678 The metadata should not imply that an empty value is true
WT-2695 Integrate s390x accelerated crc32c support
WT-2719 add fuzz testing for WiredTiger options and reconfiguration.
WT-2734 Improve documentation of eviction behavior
WT-2766 Don't count eviction of lookaside file pages for the purpose of checking stuck cache
WT-2783 wtperf multi-btree.wtperf dumps core on Mac
WT-2787 Include src/include/wiredtiger_ext.h is problematic
WT-2795 Update documentation around read-only configuration
WT-2807 Switch Jenkins performance tests to tcmalloc
WT-2813 small cache usage stuck even with large cache
WT-2814 Enhance wtperf to support single-op truncate mode
WT-2816 Improve WiredTiger eviction performance
WT-2817 Investigate performance regression in develop, add workload to wtperf/runners
WT-2818 The page visibility check when queuing pages for eviction is overly restrictive
WT-2820 add gcc warn_unused_result attribute
WT-2822 panic mutex and other functions that cannot fail
WT-2823 support file handles without a truncate method
WT-2826 clang38 false positive on uninitialized variable.
WT-2827 checkpoint log_size configuration improvements
WT-2828 Make long wtperf tests reflect mongoDB usage
WT-2829 Switch automated testing to use enable-strict configure option
WT-2832 Python test uses hard-coded temporary directory
WT-2834 Join cursor: discrepancy with bloom filters
WT-2835 WT_CONNECTION.leak-memory can skip memory map and cache cleanup
WT-2838 Don't free session handles on close if leak memory is configured
WT-2839 lint: Ignoring return value of function
WT-2840 clang analysis: garbage values
WT-2841 Jenkins Valgrind runner is reporting errors in test wt2719_reconfig
WT-2843 Fix a bug in recovery if there is no filesystem truncate support
WT-2846 Several bugs related to reconfiguring eviction server at runtime
WT-2847 Merge fair locks into read/write locks.
WT-2850 clang 4.1 attribute warnings when building
WT-2853 Multi threaded reader writer example shows temporary slowdown or lockup
WT-2857 POSIX ftruncate calls should be #ifdef'd HAVE_FTRUNCATE
WT-2862 Fix lint error in test case for forced eviction with multiple cursors
WT-2863 Support UTF-8 paths on Windows
183 files changed, 9812 insertions, 3317 deletions
diff --git a/src/third_party/wiredtiger/SConstruct b/src/third_party/wiredtiger/SConstruct index b0ce771e9bd..55b3a2af4eb 100644 --- a/src/third_party/wiredtiger/SConstruct +++ b/src/third_party/wiredtiger/SConstruct @@ -248,6 +248,8 @@ condition_map = { 'POSIX_HOST' : env['PLATFORM'] == 'posix', 'POWERPC_HOST' : False, 'WINDOWS_HOST' : env['PLATFORM'] == 'win32', + 'X86_HOST' : True, + 'ZSERIES_HOST' : False, } def filtered_filelist(f): diff --git a/src/third_party/wiredtiger/bench/wtperf/config.c b/src/third_party/wiredtiger/bench/wtperf/config.c index 0dc38287155..a2960902ec1 100644 --- a/src/third_party/wiredtiger/bench/wtperf/config.c +++ b/src/third_party/wiredtiger/bench/wtperf/config.c @@ -94,31 +94,42 @@ config_unescape(char *orig) } /* - * config_assign -- - * Assign the src config to the dest, any storage allocated in dest is - * freed as a result. + * config_copy -- + * CONFIG structure initialization, based on a source configuration. */ int -config_assign(CONFIG *dest, const CONFIG *src) +config_copy(CONFIG *dest, const CONFIG *src) { CONFIG_QUEUE_ENTRY *conf_line, *tmp_line; size_t i; char *newstr, **pstr; - config_free(dest); memcpy(dest, src, sizeof(CONFIG)); + if (src->home != NULL) + dest->home = dstrdup(src->home); + if (src->monitor_dir != NULL) + dest->monitor_dir = dstrdup(src->monitor_dir); + if (src->partial_config != NULL) + dest->partial_config = dstrdup(src->partial_config); + if (src->reopen_config != NULL) + dest->reopen_config = dstrdup(src->reopen_config); + if (src->base_uri != NULL) + dest->base_uri = dstrdup(src->base_uri); + if (src->uris != NULL) { dest->uris = dcalloc(src->table_count, sizeof(char *)); for (i = 0; i < src->table_count; i++) dest->uris[i] = dstrdup(src->uris[i]); } + + if (src->async_config != NULL) + dest->async_config = dstrdup(src->async_config); + dest->ckptthreads = NULL; dest->popthreads = NULL; dest->workers = NULL; - if (src->base_uri != NULL) - dest->base_uri = dstrdup(src->base_uri); if (src->workload != NULL) { dest->workload = dcalloc(WORKLOAD_MAX, sizeof(WORKLOAD)); memcpy(dest->workload, @@ -159,6 +170,28 @@ config_free(CONFIG *cfg) size_t i; char **pstr; + free(cfg->home); + free(cfg->monitor_dir); + free(cfg->partial_config); + free(cfg->reopen_config); + free(cfg->base_uri); + + if (cfg->uris != NULL) { + for (i = 0; i < cfg->table_count; i++) + free(cfg->uris[i]); + free(cfg->uris); + } + + free(cfg->async_config); + + free(cfg->ckptthreads); + free(cfg->popthreads); + + free(cfg->workers); + free(cfg->workload); + + cleanup_truncate_config(cfg); + while (!TAILQ_EMPTY(&cfg->config_head)) { config_line = TAILQ_FIRST(&cfg->config_head); TAILQ_REMOVE(&cfg->config_head, config_line, c); @@ -174,20 +207,6 @@ config_free(CONFIG *cfg) free(*pstr); *pstr = NULL; } - if (cfg->uris != NULL) { - for (i = 0; i < cfg->table_count; i++) - free(cfg->uris[i]); - free(cfg->uris); - } - - cleanup_truncate_config(cfg); - free(cfg->base_uri); - free(cfg->ckptthreads); - free(cfg->partial_config); - free(cfg->popthreads); - free(cfg->reopen_config); - free(cfg->workers); - free(cfg->workload); } /* @@ -390,9 +409,9 @@ config_threads(CONFIG *cfg, const char *config, size_t len) return (0); err: if (group != NULL) - (void)group->close(group); + testutil_check(group->close(group)); if (scan != NULL) - (void)scan->close(scan); + testutil_check(scan->close(scan)); fprintf(stderr, "invalid thread configuration or scan error: %.*s\n", diff --git a/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-50r50u.wtperf b/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-50r50u.wtperf index 4ca956d2afe..06745bf7cca 100644 --- a/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-50r50u.wtperf +++ b/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-50r50u.wtperf @@ -1,19 +1,22 @@ -# wtperf options file: simulate riak and its test3 configuration -# The configuration for the connection and table are from riak and the -# specification of the data (count, size, threads) is from basho_bench. +# wtperf options file: simulate MongoDB. +# The configuration for the connection and table are from mongoDB. +# We use multiple tables to simulate collections and indexes. # This test assumes that its correlating populate already completed and exists. # -#conn_config="cache_size=21G,checkpoint_sync=false,mmap=false,session_max=1024,statistics=(fast,clear),statistics_log=(wait=60)" -conn_config="cache_size=21G,checkpoint_sync=false,mmap=false,session_max=1024,log=(enabled),statistics=(fast),statistics_log=(wait=30)" -checkpoint_interval=60 +# Set cache to half of memory of AWS perf instance. Enable logging and +# checkpoints. Collect wiredtiger stats for ftdc. +conn_config="cache_size=16G,checkpoint=(wait=60,log_size=2GB),session_max=20000,log=(enabled),statistics=(fast),statistics_log=(wait=30,json),eviction=(threads_max=4)" create=false compression="snappy" sess_config="isolation=snapshot" +table_count=2 key_sz=40 -value_sz=1000 +value_sz=120 max_latency=2000 pareto=20 report_interval=10 run_time=7200 sample_interval=10 +sample_rate=1 threads=((count=10,reads=1),(count=10,updates=1)) +warmup=120 diff --git a/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-80r20u.wtperf b/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-80r20u.wtperf index 50488f72ead..77edbfb4941 100644 --- a/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-80r20u.wtperf +++ b/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-80r20u.wtperf @@ -1,18 +1,21 @@ -# wtperf options file: simulate riak and its test2 configuration -# The configuration for the connection and table are from riak and the -# specification of the data (count, size, threads) is from basho_bench. +# wtperf options file: simulate MongoDB. +# The configuration for the connection and table are from mongoDB. +# We use multiple tables to simulate collections and indexes. # This test assumes that its correlating populate already completed and exists. # -#conn_config="cache_size=21G,checkpoint_sync=false,mmap=false,session_max=1024,statistics=(fast,clear),statistics_log=(wait=60)" -conn_config="cache_size=21G,checkpoint_sync=false,mmap=false,session_max=1024,log=(enabled),statistics=(fast),statistics_log=(wait=30)" -checkpoint_interval=60 +# Set cache to half of memory of AWS perf instance. Enable logging and +# checkpoints. Collect wiredtiger stats for ftdc. +conn_config="cache_size=16G,checkpoint=(wait=60,log_size=2GB),session_max=20000,log=(enabled),statistics=(fast),statistics_log=(wait=30,json),eviction=(threads_max=4)" create=false compression="snappy" sess_config="isolation=snapshot +table_count=2 key_sz=40 -value_sz=1000 +value_sz=120 max_latency=2000 report_interval=10 run_time=7200 sample_interval=10 +sample_rate=1 threads=((count=20,reads=4,updates=1)) +warmup=120 diff --git a/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-populate.wtperf b/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-populate.wtperf index 9f34b8a8b1f..f9aed094aa1 100644 --- a/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-populate.wtperf +++ b/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-populate.wtperf @@ -1,20 +1,26 @@ -# wtperf options file: simulate riak and its test1 configuration -# The configuration for the connection and table are from riak and the -# specification of the data (count, size, threads) is from basho_bench. -# This task is the populate phase for its family of tests. +# wtperf options file: simulate MongoDB. +# The configuration for the connection and table are from mongoDB. +# We use multiple tables to simulate collections and indexes. +# This test assumes that its correlating populate already completed and exists. # -#conn_config="cache_size=21G,checkpoint_sync=false,mmap=false,session_max=1024,statistics=(fast,clear),statistics_log=(wait=60)" -conn_config="cache_size=21G,checkpoint_sync=false,mmap=false,session_max=1024,log=(enabled),statistics=(fast),statistics_log=(wait=30)" -checkpoint_interval=60 +# Set cache to half of memory. This value is computed from the AWS instance +# where Jenkins perf runs which has 32G. Enable logging and checkpoints. +# Collect wiredtiger stats for ftdc. +# +# This generates about 80 Gb of uncompressed data. But it should compress +# well and be small on disk. +conn_config="cache_size=16G,checkpoint=(wait=60,log_size=2GB),session_max=20000,log=(enabled),statistics=(fast),statistics_log=(wait=30,json),eviction=(threads_max=4)" compact=true compression="snappy" sess_config="isolation=snapshot" -table_config="internal_page_max=128K,type=file,leaf_page_max=16K" +table_config="internal_page_max=16K,type=file,leaf_page_max=16K,memory_page_max=10M,split_pct=90" +table_count=2 icount=500000000 key_sz=40 -value_sz=1000 +value_sz=120 max_latency=2000 populate_threads=20 report_interval=10 random_value=true sample_interval=10 +sample_rate=1 diff --git a/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-rdonly.wtperf b/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-rdonly.wtperf index 965306262a3..2c9540ff589 100644 --- a/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-rdonly.wtperf +++ b/src/third_party/wiredtiger/bench/wtperf/runners/500m-btree-rdonly.wtperf @@ -1,18 +1,21 @@ -# wtperf options file: simulate riak and its test4 configuration -# The configuration for the connection and table are from riak and the -# specification of the data (count, size, threads) is from basho_bench. +# wtperf options file: simulate MongoDB. +# The configuration for the connection and table are from mongoDB. +# We use multiple tables to simulate collections and indexes. # This test assumes that its correlating populate already completed and exists. # -#conn_config="cache_size=21G,checkpoint_sync=false,mmap=false,session_max=1024,statistics=(fast,clear),statistics_log=(wait=60)" -conn_config="cache_size=21G,checkpoint_sync=false,mmap=false,session_max=1024,log=(enabled),statistics=(fast),statistics_log=(wait=30)" -checkpoint_interval=60 +# Set cache to half of memory of AWS perf instance. Enable logging and +# checkpoints. Collect wiredtiger stats for ftdc. +conn_config="cache_size=16G,checkpoint=(wait=60,log_size=2GB),session_max=20000,log=(enabled),statistics=(fast),statistics_log=(wait=30,json),eviction=(threads_max=4)" create=false compression="snappy" sess_config="isolation=snapshot" +table_count=2 key_sz=40 -value_sz=1000 +value_sz=120 max_latency=2000 report_interval=10 run_time=7200 sample_interval=10 +sample_rate=1 threads=((count=20,reads=1)) +warmup=120 diff --git a/src/third_party/wiredtiger/bench/wtperf/runners/checkpoint-stress.wtperf b/src/third_party/wiredtiger/bench/wtperf/runners/checkpoint-stress.wtperf new file mode 100644 index 00000000000..6c517c6ddae --- /dev/null +++ b/src/third_party/wiredtiger/bench/wtperf/runners/checkpoint-stress.wtperf @@ -0,0 +1,20 @@ +# A stress configuration to create long running checkpoints while doing a lot +# of updates. +conn_config="cache_size=10GB,log=(enabled=false)" +table_config="leaf_page_max=32k,internal_page_max=16k,allocation_size=4k,split_pct=90,type=file" +# Enough data to fill the cache. 100 million 1k records results in two ~6GB +# tables +icount=100000000 +create=true +compression="snappy" +populate_threads=1 +checkpoint_interval=60 +checkpoint_threads=1 +report_interval=5 +# Run for a longer duration to ensure checkpoints are completing. +run_time=600 +# MongoDB always has multiple tables, and checkpoints behave differently when +# there is more than a single table. +table_count=2 +threads=((count=6,updates=1)) +value_sz=1000 diff --git a/src/third_party/wiredtiger/bench/wtperf/runners/wtperf_run.sh b/src/third_party/wiredtiger/bench/wtperf/runners/wtperf_run.sh index 7a1ad44f39c..9968edc468a 100755 --- a/src/third_party/wiredtiger/bench/wtperf/runners/wtperf_run.sh +++ b/src/third_party/wiredtiger/bench/wtperf/runners/wtperf_run.sh @@ -22,11 +22,16 @@ runmax=$2 # have 3 or 4 args. wtarg="" wtarg2="" +create=1 if test "$#" -gt "2"; then wtarg=$3 if test "$#" -eq "4"; then wtarg2=$4 fi + if test "$wtarg" == "NOCREATE"; then + create=0 + wtarg=$wtarg2 + fi fi home=./WT_TEST @@ -86,9 +91,11 @@ getmin=0 getmax=1 run=1 while test "$run" -le "$runmax"; do - rm -rf $home - mkdir $home - LD_PRELOAD=/usr/lib64/libjemalloc.so.1 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ./wtperf -O $wttest $wtarg $wtarg2 + if test "$create" -eq "1"; then + rm -rf $home + mkdir $home + fi + LD_PRELOAD=/usr/local/lib/libtcmalloc.so LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ./wtperf -O $wttest $wtarg $wtarg2 if test "$?" -ne "0"; then exit 1 fi diff --git a/src/third_party/wiredtiger/bench/wtperf/wtperf.c b/src/third_party/wiredtiger/bench/wtperf/wtperf.c index 58271106d61..d3d54fff6e3 100644 --- a/src/third_party/wiredtiger/bench/wtperf/wtperf.c +++ b/src/third_party/wiredtiger/bench/wtperf/wtperf.c @@ -29,9 +29,11 @@ #include "wtperf.h" /* Default values. */ +#define DEFAULT_HOME "WT_TEST" +#define DEFAULT_MONITOR_DIR "WT_TEST" static const CONFIG default_cfg = { - "WT_TEST", /* home */ - "WT_TEST", /* monitor dir */ + NULL, /* home */ + NULL, /* monitor dir */ NULL, /* partial logging */ NULL, /* reopen config */ NULL, /* base_uri */ @@ -1538,8 +1540,7 @@ execute_populate(CONFIG *cfg) print_ops_sec = 0; } else { print_secs = (double)msecs / (double)MSEC_PER_SEC; - print_ops_sec = - (uint64_t)((cfg->icount / msecs) / MSEC_PER_SEC); + print_ops_sec = (uint64_t)(cfg->icount / print_secs); } lprintf(cfg, 0, 1, "Load time: %.2f\n" "load ops/sec: %" PRIu64, @@ -1944,13 +1945,12 @@ start_all_runs(CONFIG *cfg) { CONFIG *next_cfg, **configs; pthread_t *threads; - size_t cmd_len, home_len, i; + size_t home_len, i; int ret, t_ret; - char *cmd_buf, *new_home; + char *new_home; ret = 0; configs = NULL; - cmd_buf = NULL; if (cfg->database_count == 1) return (start_run(cfg)); @@ -1962,24 +1962,25 @@ start_all_runs(CONFIG *cfg) threads = dcalloc(cfg->database_count, sizeof(pthread_t)); home_len = strlen(cfg->home); - cmd_len = (home_len * 2) + 30; /* Add some slop. */ - cmd_buf = dcalloc(cmd_len, 1); for (i = 0; i < cfg->database_count; i++) { next_cfg = dcalloc(1, sizeof(CONFIG)); configs[i] = next_cfg; - if ((ret = config_assign(next_cfg, cfg)) != 0) + if ((ret = config_copy(next_cfg, cfg)) != 0) goto err; /* Setup a unique home directory for each database. */ new_home = dmalloc(home_len + 5); snprintf(new_home, home_len + 5, "%s/D%02d", cfg->home, (int)i); + free(next_cfg->home); next_cfg->home = new_home; /* If the monitor dir is default, update it too. */ - if (strcmp(cfg->monitor_dir, cfg->home) == 0) - next_cfg->monitor_dir = new_home; + if (strcmp(cfg->monitor_dir, cfg->home) == 0) { + free(next_cfg->monitor_dir); + next_cfg->monitor_dir = dstrdup(new_home); + } - /* If creating the sub-database, recreate it's home */ + /* If creating the sub-database, recreate its home */ if (cfg->create != 0) recreate_dir(next_cfg->home); @@ -1991,22 +1992,19 @@ start_all_runs(CONFIG *cfg) } /* Wait for threads to finish. */ - for (i = 0; i < cfg->database_count; i++) { + for (i = 0; i < cfg->database_count; i++) if ((t_ret = pthread_join(threads[i], NULL)) != 0) { lprintf(cfg, ret, 0, "Error joining thread"); if (ret == 0) ret = t_ret; } - } err: for (i = 0; i < cfg->database_count && configs[i] != NULL; i++) { - free((char *)configs[i]->home); config_free(configs[i]); free(configs[i]); } free(configs); free(threads); - free(cmd_buf); return (ret); } @@ -2199,10 +2197,10 @@ main(int argc, char *argv[]) /* Setup the default configuration values. */ cfg = &_cfg; memset(cfg, 0, sizeof(*cfg)); - if (config_assign(cfg, &default_cfg)) + if (config_copy(cfg, &default_cfg)) goto err; - - TAILQ_INIT(&cfg->config_head); + cfg->home = dstrdup(DEFAULT_HOME); + cfg->monitor_dir = dstrdup(DEFAULT_MONITOR_DIR); /* Do a basic validation of options, and home is needed before open. */ while ((ch = __wt_getopt("wtperf", argc, argv, opts)) != EOF) @@ -2219,10 +2217,12 @@ main(int argc, char *argv[]) } break; case 'h': - cfg->home = __wt_optarg; + free(cfg->home); + cfg->home = dstrdup(__wt_optarg); break; case 'm': - cfg->monitor_dir = __wt_optarg; + free(cfg->monitor_dir); + cfg->monitor_dir = dstrdup(__wt_optarg); monitor_set = true; break; case 'O': @@ -2248,8 +2248,10 @@ main(int argc, char *argv[]) * If the user did not specify a monitor directory then set the * monitor directory to the home dir. */ - if (!monitor_set) - cfg->monitor_dir = cfg->home; + if (!monitor_set) { + free(cfg->monitor_dir); + cfg->monitor_dir = dstrdup(cfg->home); + } /* Parse configuration settings from configuration file. */ if (config_opts != NULL && config_opt_file(cfg, config_opts) != 0) @@ -2558,7 +2560,7 @@ drop_all_tables(CONFIG *cfg) "Error opening a session on %s", cfg->home); return (ret); } - (void)__wt_epoch(NULL, &start); + testutil_check(__wt_epoch(NULL, &start)); for (i = 0; i < cfg->table_count; i++) { if ((ret = session->drop( session, cfg->uris[i], NULL)) != 0) { @@ -2567,7 +2569,7 @@ drop_all_tables(CONFIG *cfg) goto err; } } - (void)__wt_epoch(NULL, &stop); + testutil_check(__wt_epoch(NULL, &stop)); msecs = WT_TIMEDIFF_MS(stop, start); lprintf(cfg, 0, 1, "Executed %" PRIu32 " drop operations average time %" PRIu64 "ms", diff --git a/src/third_party/wiredtiger/bench/wtperf/wtperf.h b/src/third_party/wiredtiger/bench/wtperf/wtperf.h index 27c3832d316..e0467f4f3a1 100644 --- a/src/third_party/wiredtiger/bench/wtperf/wtperf.h +++ b/src/third_party/wiredtiger/bench/wtperf/wtperf.h @@ -116,8 +116,8 @@ typedef struct { * an initialization in wtperf.c in the default_cfg. */ struct __config { /* Configuration structure */ - const char *home; /* WiredTiger home */ - const char *monitor_dir; /* Monitor output dir */ + char *home; /* WiredTiger home */ + char *monitor_dir; /* Monitor output dir */ char *partial_config; /* Config string for partial logging */ char *reopen_config; /* Config string for conn reopen */ char *base_uri; /* Object URI */ @@ -259,9 +259,9 @@ struct __config_thread { /* Per-thread structure */ }; void cleanup_truncate_config(CONFIG *); -int config_assign(CONFIG *, const CONFIG *); int config_compress(CONFIG *); void config_free(CONFIG *); +int config_copy(CONFIG *, const CONFIG *); int config_opt_file(CONFIG *, const char *); int config_opt_line(CONFIG *, const char *); int config_opt_str(CONFIG *, const char *, const char *); diff --git a/src/third_party/wiredtiger/bench/wtperf/wtperf_opt.i b/src/third_party/wiredtiger/bench/wtperf/wtperf_opt.i index f6c96febc85..f1f26bd0d01 100644 --- a/src/third_party/wiredtiger/bench/wtperf/wtperf_opt.i +++ b/src/third_party/wiredtiger/bench/wtperf/wtperf_opt.i @@ -194,6 +194,8 @@ DEF_OPT_AS_CONFIG_STRING(transaction_config, "", "transaction configuration string, relevant when populate_opts_per_txn " "is nonzero") DEF_OPT_AS_STRING(table_name, "test", "table name") +DEF_OPT_AS_BOOL(truncate_single_ops, 0, + "Implement truncate via cursor remove instead of session API") DEF_OPT_AS_UINT32(value_sz_max, 1000, "maximum value size when delta updates are present. Default disabled") DEF_OPT_AS_UINT32(value_sz_min, 1, diff --git a/src/third_party/wiredtiger/bench/wtperf/wtperf_truncate.c b/src/third_party/wiredtiger/bench/wtperf/wtperf_truncate.c index 11b09c60d5d..e6ebc83c681 100644 --- a/src/third_party/wiredtiger/bench/wtperf/wtperf_truncate.c +++ b/src/third_party/wiredtiger/bench/wtperf/wtperf_truncate.c @@ -128,6 +128,7 @@ run_truncate(CONFIG *cfg, CONFIG_THREAD *thread, TRUNCATE_CONFIG *trunc_cfg; TRUNCATE_QUEUE_ENTRY *truncate_item; + char *next_key; int ret, t_ret; uint64_t used_stone_gap; @@ -184,15 +185,33 @@ run_truncate(CONFIG *cfg, CONFIG_THREAD *thread, truncate_item = TAILQ_FIRST(&cfg->stone_head); trunc_cfg->num_stones--; TAILQ_REMOVE(&cfg->stone_head, truncate_item, q); - cursor->set_key(cursor,truncate_item->key); - if ((ret = cursor->search(cursor)) != 0) { - lprintf(cfg, ret, 0, "Truncate search: failed"); - goto err; - } - if ((ret = session->truncate(session, NULL, NULL, cursor, NULL)) != 0) { - lprintf(cfg, ret, 0, "Truncate: failed"); - goto err; + /* + * Truncate the content via a single truncate call or a cursor walk + * depending on the configuration. + */ + if (cfg->truncate_single_ops) { + while ((ret = cursor->next(cursor)) == 0) { + testutil_check(cursor->get_key(cursor, &next_key)); + if (strcmp(next_key, truncate_item->key) == 0) + break; + if ((ret = cursor->remove(cursor)) != 0) { + lprintf(cfg, ret, 0, "Truncate remove: failed"); + goto err; + } + } + } else { + cursor->set_key(cursor,truncate_item->key); + if ((ret = cursor->search(cursor)) != 0) { + lprintf(cfg, ret, 0, "Truncate search: failed"); + goto err; + } + + if ((ret = session->truncate( + session, NULL, NULL, cursor, NULL)) != 0) { + lprintf(cfg, ret, 0, "Truncate: failed"); + goto err; + } } *truncatedp = 1; diff --git a/src/third_party/wiredtiger/build_posix/aclocal/strict.m4 b/src/third_party/wiredtiger/build_posix/aclocal/strict.m4 index b59f09fe584..0dbd5dbee16 100644 --- a/src/third_party/wiredtiger/build_posix/aclocal/strict.m4 +++ b/src/third_party/wiredtiger/build_posix/aclocal/strict.m4 @@ -64,6 +64,7 @@ AC_DEFUN([AM_CLANG_WARNINGS], [ # removed in the not-too-distant future. # Apple clang version 4.1 # (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn) + w="$w -Wno-attributes" w="$w -Wno-pedantic" w="$w -Wno-unused-command-line-argument" diff --git a/src/third_party/wiredtiger/build_posix/configure.ac.in b/src/third_party/wiredtiger/build_posix/configure.ac.in index aa5dfac4005..00aa0bc9f95 100644 --- a/src/third_party/wiredtiger/build_posix/configure.ac.in +++ b/src/third_party/wiredtiger/build_posix/configure.ac.in @@ -58,6 +58,13 @@ AS_CASE([$host_cpu], [powerpc*], [wt_cv_powerpc="yes"], [wt_cv_powerpc="no"]) AM_CONDITIONAL([POWERPC_HOST], [test "$wt_cv_powerpc" = "yes"]) +AS_CASE([$host_cpu], + [amd*|i[[3456]]86*|pentium|x86*], [wt_cv_x86="yes"], [wt_cv_x86="no"]) +AM_CONDITIONAL([X86_HOST], [test "$wt_cv_x86" = "yes"]) +AS_CASE([$host_cpu], + [s390x*], [wt_cv_zseries="yes"], + [wt_cv_zseries="no"]) +AM_CONDITIONAL([ZSERIES_HOST], [test "$wt_cv_zseries" = "yes"]) # This is a workaround as part of WT-2459. Currently, clang (v3.7) does not # support compiling the ASM code we have to perform the CRC checks on PowerPC. @@ -121,9 +128,8 @@ AC_CHECK_LIB(dl, dlopen) AC_CHECK_LIB(rt, sched_yield) AC_CHECK_FUNCS([\ - clock_gettime fallocate fcntl fread_unlocked ftruncate gettimeofday\ - posix_fadvise posix_fallocate posix_madvise\ - strtouq sync_file_range]) + clock_gettime fallocate ftruncate gettimeofday posix_fadvise\ + posix_fallocate posix_madvise strtouq sync_file_range]) # OS X wrongly reports that it has fdatasync AS_CASE([$host_os], [darwin*], [], [AC_CHECK_FUNCS([fdatasync])]) @@ -227,6 +233,7 @@ AM_COND_IF([LEVELDB], AC_CONFIG_FILES([ Makefile wiredtiger.h:src/include/wiredtiger.in + wiredtiger_ext.h:src/include/wiredtiger_ext.h wiredtiger.pc:build_posix/wiredtiger.pc.in ]) AC_OUTPUT diff --git a/src/third_party/wiredtiger/build_win/wiredtiger_config.h b/src/third_party/wiredtiger/build_win/wiredtiger_config.h index 33dbc9b724d..ad82b13f8a8 100644 --- a/src/third_party/wiredtiger/build_win/wiredtiger_config.h +++ b/src/third_party/wiredtiger/build_win/wiredtiger_config.h @@ -31,15 +31,9 @@ /* Define to 1 if you have the `fallocate' function. */ /* #undef HAVE_FALLOCATE */ -/* Define to 1 if you have the `fcntl' function. */ -/* #undef HAVE_FCNTL 1 */ - /* Define to 1 if you have the `fdatasync' function. */ /* #undef HAVE_FDATASYNC */ -/* Define to 1 if you have the `fread_unlocked' function. */ -/* #undef HAVE_FREAD_UNLOCKED */ - /* Define to 1 if you have the `ftruncate' function. */ /* #undef HAVE_FTRUNCATE */ diff --git a/src/third_party/wiredtiger/dist/api_config.py b/src/third_party/wiredtiger/dist/api_config.py index b451e939ef3..5ccd8247b76 100644 --- a/src/third_party/wiredtiger/dist/api_config.py +++ b/src/third_party/wiredtiger/dist/api_config.py @@ -195,13 +195,15 @@ def checkstr(c): def get_default(c): t = gettype(c) if c.default == 'false': - return '0' + return 'false' + elif c.default == 'true': + return 'true' elif t == 'string' and c.default == 'none': return '' 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': + elif c.default or t == 'int': return str(c.default).replace('"', '\\"') else: return '' diff --git a/src/third_party/wiredtiger/dist/api_data.py b/src/third_party/wiredtiger/dist/api_data.py index 1302247e88e..e732e42d36d 100644 --- a/src/third_party/wiredtiger/dist/api_data.py +++ b/src/third_party/wiredtiger/dist/api_data.py @@ -375,7 +375,8 @@ connection_runtime_config = [ type='category', subconfig=[ Config('log_size', '0', r''' wait for this amount of log record bytes to be written to - the log between each checkpoint. A database can configure + the log between each checkpoint. If non-zero, this value will + use a minimum of the log file size. A database can configure both log_size and wait to set an upper bound for checkpoints; setting this value above 0 configures periodic checkpoints''', min='0', max='2GB'), @@ -402,23 +403,25 @@ connection_runtime_config = [ min=1, max=20), ]), Config('eviction_dirty_target', '5', r''' - continue evicting until the cache has less dirty memory than the - value, as a percentage of the total cache size. Dirty pages will - only be evicted if the cache is full enough to trigger eviction''', + perform eviction in worker threads when the cache contains at least + this much dirty content, expressed as a percentage of the total cache + size.''', min=1, max=99), Config('eviction_dirty_trigger', '20', r''' - trigger eviction when the cache is using this much memory for dirty - content, as a percentage of the total cache size. This setting only - alters behavior if it is lower than eviction_trigger''', + trigger application threads to perform eviction when the cache contains + at least this much dirty content, expressed as a percentage of the + total cache size. This setting only alters behavior if it is lower than + eviction_trigger''', min=1, max=99), Config('eviction_target', '80', r''' - continue evicting until the cache has less total memory than the - value, as a percentage of the total cache size. Must be less than - \c eviction_trigger''', + perform eviction in worker threads when the cache contains at least + this much content, expressed as a percentage of the total cache size. + Must be less than \c eviction_trigger''', min=10, max=99), Config('eviction_trigger', '95', r''' - trigger eviction when the cache is using this much memory, as a - percentage of the total cache size''', min=10, max=99), + trigger application threads to perform eviction when the cache contains + at least this much content, expressed as a percentage of the + total cache size.''', min=10, max=99), Config('file_manager', '', r''' control how file handles are managed''', type='category', subconfig=[ @@ -516,6 +519,7 @@ connection_runtime_config = [ 'shared_cache', 'split', 'temporary', + 'thread_group', 'transaction', 'verify', 'version', diff --git a/src/third_party/wiredtiger/dist/filelist b/src/third_party/wiredtiger/dist/filelist index 59624508cf0..e16ae879a33 100644 --- a/src/third_party/wiredtiger/dist/filelist +++ b/src/third_party/wiredtiger/dist/filelist @@ -47,9 +47,11 @@ src/btree/row_key.c src/btree/row_modify.c src/btree/row_srch.c src/cache/cache_las.c -src/checksum/checksum.c src/checksum/power8/crc32.S POWERPC_HOST src/checksum/power8/crc32_wrapper.c POWERPC_HOST +src/checksum/x86/checksum.c X86_HOST +src/checksum/zseries/crc32-s390x.c ZSERIES_HOST +src/checksum/zseries/crc32le-vx.S ZSERIES_HOST src/config/config.c src/config/config_api.c src/config/config_check.c @@ -145,6 +147,7 @@ src/os_win/os_sleep.c WINDOWS_HOST src/os_win/os_snprintf.c WINDOWS_HOST src/os_win/os_thread.c WINDOWS_HOST src/os_win/os_time.c WINDOWS_HOST +src/os_win/os_utf8.c WINDOWS_HOST src/os_win/os_vsnprintf.c WINDOWS_HOST src/os_win/os_winerr.c WINDOWS_HOST src/os_win/os_yield.c WINDOWS_HOST @@ -182,6 +185,7 @@ src/support/pow.c src/support/rand.c src/support/scratch.c src/support/stat.c +src/support/thread_group.c src/txn/txn.c src/txn/txn_ckpt.c src/txn/txn_ext.c diff --git a/src/third_party/wiredtiger/dist/flags.py b/src/third_party/wiredtiger/dist/flags.py index 8091283a8c0..93b6e0cbbf4 100644 --- a/src/third_party/wiredtiger/dist/flags.py +++ b/src/third_party/wiredtiger/dist/flags.py @@ -80,6 +80,7 @@ flags = { 'VERB_SHARED_CACHE', 'VERB_SPLIT', 'VERB_TEMPORARY', + 'VERB_THREAD_GROUP', 'VERB_TRANSACTION', 'VERB_VERIFY', 'VERB_VERSION', diff --git a/src/third_party/wiredtiger/dist/s_funcs.list b/src/third_party/wiredtiger/dist/s_funcs.list index c0d9f2e688f..01835390997 100644 --- a/src/third_party/wiredtiger/dist/s_funcs.list +++ b/src/third_party/wiredtiger/dist/s_funcs.list @@ -1,6 +1,7 @@ # List of functions that aren't found by s_funcs, but that's OK. FUNC_END FUNC_START +WT_CRC32_ENTRY WT_CURDUMP_PASS __bit_ffs __bit_nclr diff --git a/src/third_party/wiredtiger/dist/s_longlines b/src/third_party/wiredtiger/dist/s_longlines index 91dada361f4..43e350022dd 100755 --- a/src/third_party/wiredtiger/dist/s_longlines +++ b/src/third_party/wiredtiger/dist/s_longlines @@ -9,6 +9,7 @@ l=`(cd .. && find dist -name '*.py' && find src -name '*.in') | sed -e '/checksum\/power8/d' \ + -e '/checksum\/zseries/d' \ -e '/dist\/stat_data\.py/d' \ -e '/include\/extern\.h/d' \ -e '/include\/extern_posix\.h/d' \ diff --git a/src/third_party/wiredtiger/dist/s_prototypes b/src/third_party/wiredtiger/dist/s_prototypes index 73f7be371ea..89fa750d106 100755 --- a/src/third_party/wiredtiger/dist/s_prototypes +++ b/src/third_party/wiredtiger/dist/s_prototypes @@ -28,7 +28,7 @@ proto() -e 's/\* /\*/g' \ -e 's/ */ /g' \ -e 's/^/extern /' \ - -e 's/WT_GCC_FUNC_/WT_GCC_FUNC_DECL_/g' \ + -e 's/WT_GCC_FUNC_ATTRIBUTE/WT_GCC_FUNC_DECL_ATTRIBUTE/g' \ -e '# If a line ends in #endif, appending a semicolon will result' \ -e '# in an illegal expression, force an appended newline using' \ -e '# the H command because substitute may not allow newline in' \ @@ -39,6 +39,9 @@ proto() -e H \ -e x \ -e '}' \ + -e '# Add the gcc warn_unused_result attribute to any external' \ + -e '# functions that return an int.' \ + -e '/^extern int /s/$/ WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result))/' \ -e 's/$/;/' \ -e p < $1 } @@ -73,6 +76,8 @@ externs f=../src/include/extern.h l=`sed \ -e '/^[a-z]/!d' \ + -e '/\/checksum\/power8/d' \ + -e '/\/checksum\/zseries/d' \ -e '/os_posix/d' \ -e '/os_win/d' \ -e 's/[ ].*$//' filelist` diff --git a/src/third_party/wiredtiger/dist/s_string.ok b/src/third_party/wiredtiger/dist/s_string.ok index 8c5f1e99bff..30a2f1b77e9 100644 --- a/src/third_party/wiredtiger/dist/s_string.ok +++ b/src/third_party/wiredtiger/dist/s_string.ok @@ -5,6 +5,7 @@ AAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAA ABCDEFGHIJKLMNOPQRSTUVWXYZ +ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ADDR ADDRs AJ @@ -12,6 +13,7 @@ API APIs ARG ARGS +ASM ASYNC Addr Ailamaki @@ -37,6 +39,7 @@ BZ Barack Bitfield Bitwise +Brueckner Bsearch Btree Buf @@ -59,6 +62,7 @@ CSV CURSORs CURSTD CallsCustDate +Castagnoli Checkpointing Checksum Checksums @@ -67,9 +71,9 @@ CloseHandle Comparator Config Coverity -CreateFileA CreateFileMapping -CreateFileMappingA +CreateFileMappingW +CreateFileW Crummey CustomersPhone DECL @@ -85,7 +89,7 @@ DbCursor DbEnv Decrement Decrypt -DeleteFileA +DeleteFileW EACCES EAGAIN EB @@ -135,17 +139,18 @@ GIDs Gcc Geoff GetEnvironmentVariableA -GetFileAttributesA GetFileAttributesEx +GetFileAttributesW GetFileSizeEx GetLastError -GetModuleHandleEx +GetModuleHandleExW GetProcAddress Google HFS HHHH HHHHLL HHHLL +Hendrik HyperLevelDB IEC IEEE @@ -156,9 +161,11 @@ INCR INIT INITIALIZER INMEM +INSN INTL ISA ITEMs +InitializeCriticalSectionAndSpinCount Inline Intra Ippokratis @@ -205,6 +212,8 @@ MEMALIGN MERCHANTABILITY METADATA MONGODB +MRXB +MRXBOPC MSVC MULTI MULTIBLOCK @@ -219,8 +228,9 @@ Mewhort Mitzenmacher MongoDB MoveFile -MoveFileA +MoveFileW Multi +MultiByteToWideChar Multithreaded Mutex MySecret @@ -233,6 +243,7 @@ NOTFOUND NOTREACHED NOVALUE NUL +NUM NetBSD NoAddr Noll @@ -243,6 +254,7 @@ OUTBUFF OVFL ObWgfvgw Obama +Opcode Outfmt PARAM POSIX @@ -276,6 +288,7 @@ RMW RNG RPC RUNDIR +RXB Radu ReadFile Readonly @@ -345,6 +358,8 @@ Uryyb VARCHAR VLDB VMSG +VR +VX Vc Vfprintf Vigenere @@ -362,6 +377,7 @@ Wconditional WeakHashLen Werror Wformat +WideCharToMultiByte WinNT WiredTiger WiredTiger's @@ -407,12 +423,14 @@ autocommit autoconf automake bInheritHandle +bal basecfg basho bcr bdb beginthreadex bigram +binutils bitcnt bitfield bitfields @@ -500,6 +518,7 @@ conn connectionp const constantp +consts cookiep copydoc copyin @@ -629,6 +648,7 @@ fcntl fd fdatasync fdopen +fextend ffc fflush ffs @@ -706,7 +726,10 @@ iSh ibackup icount idx +ifdef ifdef's +iiSii +iiii iiu ikey im @@ -897,6 +920,7 @@ onint online onpage oo +opcode opendir openfile optimizations @@ -904,6 +928,7 @@ optype ori os osfhandle +other's ovfl ownp pR @@ -961,6 +986,7 @@ qrrSS qsort quartile qup +rN rS rb rbrace @@ -1146,6 +1172,7 @@ usr utf util uu +vN vW va valgrind @@ -1165,6 +1192,7 @@ vsnprintf vtype vunpack vw +vxr waitpid walk's warmup diff --git a/src/third_party/wiredtiger/dist/s_style b/src/third_party/wiredtiger/dist/s_style index e33db5a5fab..47f18ef1f18 100755 --- a/src/third_party/wiredtiger/dist/s_style +++ b/src/third_party/wiredtiger/dist/s_style @@ -20,7 +20,8 @@ if [ $# -ne 1 ]; then -name '*.[chisy]' -o -name '*.in' -o -name '*.dox' | sed -e '/Makefile.in/d' \ -e '/build_win\/wiredtiger_config.h/d' \ - -e '/checksum\/power8/d' | + -e '/checksum\/power8/d' \ + -e '/checksum\/zseries/d' | xargs $xp -n 1 -I{} sh ./dist/s_style {} else # General style correction and cleanup for a single file @@ -173,7 +174,7 @@ else -e 's/\([ ,]\)u_int64_t\([ ,]\)/\1uint64_t\2/g' \ -e 's/\([ ,]\)u_quad\([ ,]\)/\1uint64_t\2/g' \ -e 's/\([|&=+-]\) *\([^*]\)/\1 \2/' \ - -e 's/(void) \([a-zA-Z_]\)/(void)\1/' \ + -e 's/[ ](void) \([a-zA-Z_]\)/(void)\1/' \ -e '/for /!s/;;$/;/' \ -e 's/(EOPNOTSUPP)/(ENOTSUP)/' \ -e 's/(unsigned)/(u_int)/' \ diff --git a/src/third_party/wiredtiger/dist/s_win b/src/third_party/wiredtiger/dist/s_win index 49deb348bc3..5b45cacf0f4 100755 --- a/src/third_party/wiredtiger/dist/s_win +++ b/src/third_party/wiredtiger/dist/s_win @@ -19,7 +19,7 @@ win_config() test -s $t && { echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" - echo "Windows #defines missing from $f" + echo "$f: configuration #defines do not match POSIX" echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" cat $t exit 1 diff --git a/src/third_party/wiredtiger/dist/stat_data.py b/src/third_party/wiredtiger/dist/stat_data.py index 51cc487f04c..af410a341bd 100644 --- a/src/third_party/wiredtiger/dist/stat_data.py +++ b/src/third_party/wiredtiger/dist/stat_data.py @@ -201,12 +201,12 @@ connection_stats = [ CacheStat('cache_eviction_queue_empty', 'eviction server candidate queue empty when topping up'), CacheStat('cache_eviction_queue_not_empty', 'eviction server candidate queue not empty when topping up'), CacheStat('cache_eviction_server_evicting', 'eviction server evicting pages'), - CacheStat('cache_eviction_server_not_evicting', 'eviction server populating queue, but not evicting pages'), CacheStat('cache_eviction_server_slept', 'eviction server slept, because we did not make progress with eviction'), CacheStat('cache_eviction_server_toobig', 'eviction server skipped very large page'), CacheStat('cache_eviction_slow', 'eviction server unable to reach eviction goal'), CacheStat('cache_eviction_split_internal', 'internal pages split during eviction'), CacheStat('cache_eviction_split_leaf', 'leaf pages split during eviction'), + CacheStat('cache_eviction_state', 'eviction state', 'no_clear,no_scale'), CacheStat('cache_eviction_walk', 'pages walked for eviction'), CacheStat('cache_eviction_walks_active', 'files with active eviction walks', 'no_clear,no_scale,size'), CacheStat('cache_eviction_walks_started', 'files with new eviction walks started'), @@ -276,8 +276,8 @@ connection_stats = [ LogStat('log_slot_unbuffered', 'consolidated slot unbuffered writes'), LogStat('log_sync', 'log sync operations'), LogStat('log_sync_dir', 'log sync_dir operations'), - LogStat('log_sync_dir_duration', 'log sync_dir time duration (usecs)'), - LogStat('log_sync_duration', 'log sync time duration (usecs)'), + LogStat('log_sync_dir_duration', 'log sync_dir time duration (usecs)', 'no_clear,no_scale'), + LogStat('log_sync_duration', 'log sync time duration (usecs)', 'no_clear,no_scale'), LogStat('log_write_lsn', 'log server thread advances write LSN'), LogStat('log_write_lsn_skip', 'log server thread write LSN walk skipped'), LogStat('log_writes', 'log write operations'), diff --git a/src/third_party/wiredtiger/examples/c/ex_all.c b/src/third_party/wiredtiger/examples/c/ex_all.c index e8727df3f60..a2042c22bbb 100644 --- a/src/third_party/wiredtiger/examples/c/ex_all.c +++ b/src/third_party/wiredtiger/examples/c/ex_all.c @@ -1126,7 +1126,7 @@ main(void) home, NULL, "create,file_extend=(data=16MB)", &conn); /*! [Configure file_extend] */ if (ret == 0) - (void)conn->close(conn, NULL); + ret = conn->close(conn, NULL); /*! [Eviction configuration] */ /* @@ -1137,7 +1137,7 @@ main(void) "create,eviction_trigger=90,eviction_dirty_target=75", &conn); /*! [Eviction configuration] */ if (ret == 0) - (void)conn->close(conn, NULL); + ret = conn->close(conn, NULL); /*! [Eviction worker configuration] */ /* Configure up to four eviction threads */ @@ -1145,20 +1145,20 @@ main(void) "create,eviction_trigger=90,eviction=(threads_max=4)", &conn); /*! [Eviction worker configuration] */ if (ret == 0) - (void)conn->close(conn, NULL); + ret = conn->close(conn, NULL); /*! [Statistics configuration] */ ret = wiredtiger_open(home, NULL, "create,statistics=(all)", &conn); /*! [Statistics configuration] */ if (ret == 0) - (void)conn->close(conn, NULL); + ret = conn->close(conn, NULL); /*! [Statistics logging] */ ret = wiredtiger_open( home, NULL, "create,statistics_log=(wait=30)", &conn); /*! [Statistics logging] */ if (ret == 0) - (void)conn->close(conn, NULL); + ret = conn->close(conn, NULL); #ifdef MIGHT_NOT_RUN /* @@ -1171,7 +1171,7 @@ main(void) &conn); /*! [Statistics logging with a table] */ if (ret == 0) - (void)conn->close(conn, NULL); + ret = conn->close(conn, NULL); /* * Don't run this code, statistics logging doesn't yet support indexes. @@ -1182,7 +1182,7 @@ main(void) &conn); /*! [Statistics logging with a source type] */ if (ret == 0) - (void)conn->close(conn, NULL); + ret = conn->close(conn, NULL); /* * Don't run this code, because memory checkers get very upset when we diff --git a/src/third_party/wiredtiger/examples/c/ex_file_system.c b/src/third_party/wiredtiger/examples/c/ex_file_system.c index 55ee20e9331..524a5d03f89 100644 --- a/src/third_party/wiredtiger/examples/c/ex_file_system.c +++ b/src/third_party/wiredtiger/examples/c/ex_file_system.c @@ -352,8 +352,8 @@ demo_fs_open(WT_FILE_SYSTEM *file_system, WT_SESSION *session, */ file_handle->close = demo_file_close; file_handle->fh_advise = NULL; - file_handle->fh_allocate = NULL; - file_handle->fh_allocate_nolock = NULL; + file_handle->fh_extend = NULL; + file_handle->fh_extend_nolock = NULL; file_handle->fh_lock = demo_file_lock; file_handle->fh_map = NULL; file_handle->fh_map_discard = NULL; diff --git a/src/third_party/wiredtiger/ext/encryptors/rotn/rotn_encrypt.c b/src/third_party/wiredtiger/ext/encryptors/rotn/rotn_encrypt.c index 9a92ae7b642..3b5379ca410 100644 --- a/src/third_party/wiredtiger/ext/encryptors/rotn/rotn_encrypt.c +++ b/src/third_party/wiredtiger/ext/encryptors/rotn/rotn_encrypt.c @@ -448,9 +448,10 @@ rotn_configure(ROTN_ENCRYPTOR *rotn_encryptor, WT_CONFIG_ARG *config) strlen("rotn_force_error") == k.len) { rotn_encryptor->force_error = v.val == 0 ? 0 : 1; continue; - } - else { - (void)config_parser->close(config_parser); + } else { + if ((ret = config_parser->close(config_parser)) != 0) + return (rotn_error(rotn_encryptor, + NULL, ret, "WT_CONFIG_PARSER.close")); return (rotn_error(rotn_encryptor, NULL, EINVAL, "unknown config key")); } diff --git a/src/third_party/wiredtiger/ext/test/kvs_bdb/kvs_bdb.c b/src/third_party/wiredtiger/ext/test/kvs_bdb/kvs_bdb.c index 3d78bca1d1b..be63b1d7e7d 100644 --- a/src/third_party/wiredtiger/ext/test/kvs_bdb/kvs_bdb.c +++ b/src/third_party/wiredtiger/ext/test/kvs_bdb/kvs_bdb.c @@ -33,6 +33,13 @@ #include <stdlib.h> #include <string.h> +/* + * Berkeley DB has an #ifdef we need to provide a value for, we'll see an + * undefined error if it's unset during a strict compile. + */ +#ifndef DB_DBM_HSEARCH +#define DB_DBM_HSEARCH 0 +#endif #include <db.h> #include <wiredtiger.h> #include <wiredtiger_ext.h> diff --git a/src/third_party/wiredtiger/src/async/async_api.c b/src/third_party/wiredtiger/src/async/async_api.c index d53a6c65c1d..d55732abfb5 100644 --- a/src/third_party/wiredtiger/src/async/async_api.c +++ b/src/third_party/wiredtiger/src/async/async_api.c @@ -89,7 +89,7 @@ setup: op->format = af; err: if (c != NULL) - (void)c->close(c); + WT_TRET(c->close(c)); __wt_free(session, af->uri); __wt_free(session, af->config); __wt_free(session, af->key_format); @@ -489,7 +489,6 @@ __wt_async_flush(WT_SESSION_IMPL *session) { WT_ASYNC *async; WT_CONNECTION_IMPL *conn; - WT_DECL_RET; uint32_t i, workers; conn = S2C(session); @@ -540,16 +539,15 @@ retry: (void)__wt_atomic_add64(&async->flush_gen, 1); WT_ASSERT(session, async->flush_op.state == WT_ASYNCOP_FREE); async->flush_op.state = WT_ASYNCOP_READY; - WT_ERR(__wt_async_op_enqueue(session, &async->flush_op)); + WT_RET(__wt_async_op_enqueue(session, &async->flush_op)); while (async->flush_state != WT_ASYNC_FLUSH_COMPLETE) - WT_ERR(__wt_cond_wait(NULL, async->flush_cond, 100000)); + __wt_cond_wait(NULL, async->flush_cond, 100000); /* * Flush is done. Clear the flags. */ async->flush_op.state = WT_ASYNCOP_FREE; WT_PUBLISH(async->flush_state, WT_ASYNC_FLUSH_NONE); -err: - return (ret); + return (0); } /* diff --git a/src/third_party/wiredtiger/src/async/async_worker.c b/src/third_party/wiredtiger/src/async/async_worker.c index 90dac557e36..cf83d797738 100644 --- a/src/third_party/wiredtiger/src/async/async_worker.c +++ b/src/third_party/wiredtiger/src/async/async_worker.c @@ -102,13 +102,12 @@ retry: * __async_flush_wait -- * Wait for the final worker to finish flushing. */ -static int +static void __async_flush_wait(WT_SESSION_IMPL *session, WT_ASYNC *async, uint64_t my_gen) { while (async->flush_state == WT_ASYNC_FLUSHING && async->flush_gen == my_gen) - WT_RET(__wt_cond_wait(session, async->flush_cond, 10000)); - return (0); + __wt_cond_wait(session, async->flush_cond, 10000); } /* @@ -326,15 +325,13 @@ __wt_async_worker(void *arg) */ WT_PUBLISH(async->flush_state, WT_ASYNC_FLUSH_COMPLETE); - WT_ERR(__wt_cond_signal(session, - async->flush_cond)); + __wt_cond_signal(session, async->flush_cond); } else /* * We need to wait for the last worker to * signal the condition. */ - WT_ERR(__async_flush_wait( - session, async, flush_gen)); + __async_flush_wait(session, async, flush_gen); } } diff --git a/src/third_party/wiredtiger/src/block/block_ckpt.c b/src/third_party/wiredtiger/src/block/block_ckpt.c index 3584efc7671..1e7f4ff09ae 100644 --- a/src/third_party/wiredtiger/src/block/block_ckpt.c +++ b/src/third_party/wiredtiger/src/block/block_ckpt.c @@ -69,9 +69,9 @@ __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ERR(__wt_scr_alloc(session, 0, &tmp)); WT_ERR(__ckpt_string(session, block, addr, tmp)); } - WT_ERR(__wt_verbose(session, WT_VERB_CHECKPOINT, + __wt_verbose(session, WT_VERB_CHECKPOINT, "%s: load-checkpoint: %s", block->name, - addr == NULL ? "[Empty]" : (const char *)tmp->data)); + addr == NULL ? "[Empty]" : (const char *)tmp->data); } #endif @@ -137,18 +137,9 @@ __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block, * that was done when the checkpoint was first written (re-writing the * checkpoint might possibly make it relevant here, but it's unlikely * enough I don't bother). - * - * If in-memory, we don't read or write the object, and the truncate - * will unnecessarily allocate buffer space. */ - if (!checkpoint && !F_ISSET(S2C(session), WT_CONN_IN_MEMORY)) { - WT_ERR(__wt_verbose(session, WT_VERB_CHECKPOINT, - "truncate file to %" PRIuMAX, (uintmax_t)ci->file_size)); - - /* The truncate might fail, and that's OK. */ - WT_ERR_BUSY_OK( - __wt_block_truncate(session, block, ci->file_size)); - } + if (!checkpoint) + WT_ERR(__wt_block_truncate(session, block, ci->file_size)); if (0) { err: /* @@ -190,9 +181,7 @@ __wt_block_checkpoint_unload( * checkpoints. */ if (!checkpoint) { - /* The truncate might fail, and that's OK. */ - WT_TRET_BUSY_OK( - __wt_block_truncate(session, block, block->size)); + WT_TRET(__wt_block_truncate(session, block, block->size)); __wt_spin_lock(session, &block->live_lock); __wt_block_ckpt_destroy(session, &block->live); @@ -515,9 +504,9 @@ __ckpt_process(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_CKPT *ckptbase) WT_ERR(__wt_scr_alloc(session, 0, &tmp)); WT_ERR(__ckpt_string( session, block, ckpt->raw.data, tmp)); - WT_ERR(__wt_verbose(session, WT_VERB_CHECKPOINT, + __wt_verbose(session, WT_VERB_CHECKPOINT, "%s: delete-checkpoint: %s: %s", - block->name, ckpt->name, (const char *)tmp->data)); + block->name, ckpt->name, (const char *)tmp->data); } #endif /* @@ -753,9 +742,9 @@ __ckpt_update(WT_SESSION_IMPL *session, if (WT_VERBOSE_ISSET(session, WT_VERB_CHECKPOINT)) { WT_RET(__wt_scr_alloc(session, 0, &tmp)); WT_ERR(__ckpt_string(session, block, ckpt->raw.data, tmp)); - WT_ERR(__wt_verbose(session, WT_VERB_CHECKPOINT, + __wt_verbose(session, WT_VERB_CHECKPOINT, "%s: create-checkpoint: %s: %s", - block->name, ckpt->name, (const char *)tmp->data)); + block->name, ckpt->name, (const char *)tmp->data); } err: __wt_scr_free(session, &tmp); diff --git a/src/third_party/wiredtiger/src/block/block_compact.c b/src/third_party/wiredtiger/src/block/block_compact.c index 02862ea842f..a5e510445cc 100644 --- a/src/third_party/wiredtiger/src/block/block_compact.c +++ b/src/third_party/wiredtiger/src/block/block_compact.c @@ -8,7 +8,7 @@ #include "wt_internal.h" -static int __block_dump_avail(WT_SESSION_IMPL *, WT_BLOCK *, bool); +static void __block_dump_avail(WT_SESSION_IMPL *, WT_BLOCK *, bool); /* * __wt_block_compact_start -- @@ -32,8 +32,6 @@ __wt_block_compact_start(WT_SESSION_IMPL *session, WT_BLOCK *block) int __wt_block_compact_end(WT_SESSION_IMPL *session, WT_BLOCK *block) { - WT_DECL_RET; - WT_UNUSED(session); /* Restore the original allocation plan. */ @@ -43,12 +41,11 @@ __wt_block_compact_end(WT_SESSION_IMPL *session, WT_BLOCK *block) /* Dump the results of the compaction pass. */ if (WT_VERBOSE_ISSET(session, WT_VERB_COMPACT)) { __wt_spin_lock(session, &block->live_lock); - ret = __block_dump_avail(session, block, false); + __block_dump_avail(session, block, false); __wt_spin_unlock(session, &block->live_lock); } #endif - - return (ret); + return (0); } /* @@ -88,7 +85,7 @@ __wt_block_compact_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, bool *skipp) /* Dump the current state of the file. */ if (WT_VERBOSE_ISSET(session, WT_VERB_COMPACT)) - WT_ERR(__block_dump_avail(session, block, true)); + __block_dump_avail(session, block, true); /* Sum the available bytes in the initial 80% and 90% of the file. */ avail_eighty = avail_ninety = 0; @@ -125,25 +122,25 @@ __wt_block_compact_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, bool *skipp) block->compact_pct_tenths = 1; } - WT_ERR(__wt_verbose(session, WT_VERB_COMPACT, + __wt_verbose(session, WT_VERB_COMPACT, "%s: %" PRIuMAX "MB (%" PRIuMAX ") available space in the first " "80%% of the file", block->name, - (uintmax_t)avail_eighty / WT_MEGABYTE, (uintmax_t)avail_eighty)); - WT_ERR(__wt_verbose(session, WT_VERB_COMPACT, + (uintmax_t)avail_eighty / WT_MEGABYTE, (uintmax_t)avail_eighty); + __wt_verbose(session, WT_VERB_COMPACT, "%s: %" PRIuMAX "MB (%" PRIuMAX ") available space in the first " "90%% of the file", block->name, - (uintmax_t)avail_ninety / WT_MEGABYTE, (uintmax_t)avail_ninety)); - WT_ERR(__wt_verbose(session, WT_VERB_COMPACT, + (uintmax_t)avail_ninety / WT_MEGABYTE, (uintmax_t)avail_ninety); + __wt_verbose(session, WT_VERB_COMPACT, "%s: require 10%% or %" PRIuMAX "MB (%" PRIuMAX ") in the first " "90%% of the file to perform compaction, compaction %s", block->name, (uintmax_t)(block->size / 10) / WT_MEGABYTE, (uintmax_t)block->size / 10, - *skipp ? "skipped" : "proceeding")); + *skipp ? "skipped" : "proceeding"); -err: __wt_spin_unlock(session, &block->live_lock); + __wt_spin_unlock(session, &block->live_lock); return (ret); } @@ -207,7 +204,7 @@ __wt_block_compact_page_skip(WT_SESSION_IMPL *session, * __block_dump_avail -- * Dump out the avail list so we can see what compaction will look like. */ -static int +static void __block_dump_avail(WT_SESSION_IMPL *session, WT_BLOCK *block, bool start) { WT_EXTLIST *el; @@ -218,29 +215,28 @@ __block_dump_avail(WT_SESSION_IMPL *session, WT_BLOCK *block, bool start) el = &block->live.avail; size = block->size; - WT_RET(__wt_verbose(session, WT_VERB_COMPACT, + __wt_verbose(session, WT_VERB_COMPACT, "============ %s", - start ? "testing for compaction" : "ending compaction pass")); + start ? "testing for compaction" : "ending compaction pass"); if (!start) { - WT_RET(__wt_verbose(session, WT_VERB_COMPACT, - "pages reviewed: %" PRIuMAX, - block->compact_pages_reviewed)); - WT_RET(__wt_verbose(session, WT_VERB_COMPACT, - "pages skipped: %" PRIuMAX, block->compact_pages_skipped)); - WT_RET(__wt_verbose(session, WT_VERB_COMPACT, - "pages written: %" PRIuMAX, block->compact_pages_written)); + __wt_verbose(session, WT_VERB_COMPACT, + "pages reviewed: %" PRIuMAX, block->compact_pages_reviewed); + __wt_verbose(session, WT_VERB_COMPACT, + "pages skipped: %" PRIuMAX, block->compact_pages_skipped); + __wt_verbose(session, WT_VERB_COMPACT, + "pages written: %" PRIuMAX, block->compact_pages_written); } - WT_RET(__wt_verbose(session, WT_VERB_COMPACT, + __wt_verbose(session, WT_VERB_COMPACT, "file size %" PRIuMAX "MB (%" PRIuMAX ") with %" PRIuMAX "%% space available %" PRIuMAX "MB (%" PRIuMAX ")", (uintmax_t)size / WT_MEGABYTE, (uintmax_t)size, ((uintmax_t)el->bytes * 100) / (uintmax_t)size, - (uintmax_t)el->bytes / WT_MEGABYTE, (uintmax_t)el->bytes)); + (uintmax_t)el->bytes / WT_MEGABYTE, (uintmax_t)el->bytes); if (el->entries == 0) - return (0); + return; /* * Bucket the available memory into file deciles/percentiles. Large @@ -262,21 +258,19 @@ __block_dump_avail(WT_SESSION_IMPL *session, WT_BLOCK *block, bool start) */ for (i = 0; i < WT_ELEMENTS(percentile); ++i) { v = percentile[i] * 512; - WT_RET(__wt_verbose(session, WT_VERB_COMPACT, + __wt_verbose(session, WT_VERB_COMPACT, "%2u%%: %12" PRIuMAX "MB, (%" PRIuMAX "B, %" PRIuMAX "%%)", i, (uintmax_t)v / WT_MEGABYTE, (uintmax_t)v, - (uintmax_t)((v * 100) / (wt_off_t)el->bytes))); + (uintmax_t)((v * 100) / (wt_off_t)el->bytes)); } #endif for (i = 0; i < WT_ELEMENTS(decile); ++i) { v = decile[i] * 512; - WT_RET(__wt_verbose(session, WT_VERB_COMPACT, + __wt_verbose(session, WT_VERB_COMPACT, "%2u%%: %12" PRIuMAX "MB, (%" PRIuMAX "B, %" PRIuMAX "%%)", i * 10, (uintmax_t)v / WT_MEGABYTE, (uintmax_t)v, - (uintmax_t)((v * 100) / (wt_off_t)el->bytes))); + (uintmax_t)((v * 100) / (wt_off_t)el->bytes)); } - - return (0); } diff --git a/src/third_party/wiredtiger/src/block/block_ext.c b/src/third_party/wiredtiger/src/block/block_ext.c index bad4d8d7990..d618bf70010 100644 --- a/src/third_party/wiredtiger/src/block/block_ext.c +++ b/src/third_party/wiredtiger/src/block/block_ext.c @@ -486,9 +486,9 @@ __block_extend( block->size += size; WT_STAT_FAST_DATA_INCR(session, block_extension); - WT_RET(__wt_verbose(session, WT_VERB_BLOCK, + __wt_verbose(session, WT_VERB_BLOCK, "file extend %" PRIdMAX "B @ %" PRIdMAX, - (intmax_t)size, (intmax_t)*offp)); + (intmax_t)size, (intmax_t)*offp); return (0); } @@ -552,21 +552,21 @@ append: WT_RET(__block_extend(session, block, offp, size)); /* If doing a partial allocation, adjust the record and put it back. */ if (ext->size > size) { - WT_RET(__wt_verbose(session, WT_VERB_BLOCK, + __wt_verbose(session, WT_VERB_BLOCK, "allocate %" PRIdMAX " from range %" PRIdMAX "-%" PRIdMAX ", range shrinks to %" PRIdMAX "-%" PRIdMAX, (intmax_t)size, (intmax_t)ext->off, (intmax_t)(ext->off + ext->size), (intmax_t)(ext->off + size), - (intmax_t)(ext->off + size + ext->size - size))); + (intmax_t)(ext->off + size + ext->size - size)); ext->off += size; ext->size -= size; WT_RET(__block_ext_insert(session, &block->live.avail, ext)); } else { - WT_RET(__wt_verbose(session, WT_VERB_BLOCK, + __wt_verbose(session, WT_VERB_BLOCK, "allocate range %" PRIdMAX "-%" PRIdMAX, - (intmax_t)ext->off, (intmax_t)(ext->off + ext->size))); + (intmax_t)ext->off, (intmax_t)(ext->off + ext->size)); __wt_block_ext_free(session, ext); } @@ -595,8 +595,8 @@ __wt_block_free(WT_SESSION_IMPL *session, /* Crack the cookie. */ WT_RET(__wt_block_buffer_to_addr(block, addr, &offset, &size, &cksum)); - WT_RET(__wt_verbose(session, WT_VERB_BLOCK, - "free %" PRIdMAX "/%" PRIdMAX, (intmax_t)offset, (intmax_t)size)); + __wt_verbose(session, WT_VERB_BLOCK, + "free %" PRIdMAX "/%" PRIdMAX, (intmax_t)offset, (intmax_t)size); #ifdef HAVE_DIAGNOSTIC WT_RET( @@ -922,8 +922,8 @@ __wt_block_extlist_merge(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST tmp; u_int i; - WT_RET(__wt_verbose( - session, WT_VERB_BLOCK, "merging %s into %s", a->name, b->name)); + __wt_verbose( + session, WT_VERB_BLOCK, "merging %s into %s", a->name, b->name); /* * Sometimes the list we are merging is much bigger than the other: if @@ -1063,9 +1063,9 @@ __block_merge(WT_SESSION_IMPL *session, WT_BLOCK *block, after = NULL; } if (before == NULL && after == NULL) { - WT_RET(__wt_verbose(session, WT_VERB_BLOCK, + __wt_verbose(session, WT_VERB_BLOCK, "%s: insert range %" PRIdMAX "-%" PRIdMAX, - el->name, (intmax_t)off, (intmax_t)(off + size))); + el->name, (intmax_t)off, (intmax_t)(off + size)); return (__block_off_insert(session, el, off, size)); } @@ -1081,12 +1081,12 @@ __block_merge(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_RET(__block_off_remove( session, block, el, after->off, &ext)); - WT_RET(__wt_verbose(session, WT_VERB_BLOCK, + __wt_verbose(session, WT_VERB_BLOCK, "%s: range grows from %" PRIdMAX "-%" PRIdMAX ", to %" PRIdMAX "-%" PRIdMAX, el->name, (intmax_t)ext->off, (intmax_t)(ext->off + ext->size), - (intmax_t)off, (intmax_t)(off + ext->size + size))); + (intmax_t)off, (intmax_t)(off + ext->size + size)); ext->off = off; ext->size += size; @@ -1099,13 +1099,13 @@ __block_merge(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_RET(__block_off_remove( session, block, el, before->off, &ext)); - WT_RET(__wt_verbose(session, WT_VERB_BLOCK, + __wt_verbose(session, WT_VERB_BLOCK, "%s: range grows from %" PRIdMAX "-%" PRIdMAX ", to %" PRIdMAX "-%" PRIdMAX, el->name, (intmax_t)ext->off, (intmax_t)(ext->off + ext->size), (intmax_t)ext->off, - (intmax_t)(ext->off + ext->size + size))); + (intmax_t)(ext->off + ext->size + size)); ext->size += size; } @@ -1319,9 +1319,9 @@ __wt_block_extlist_write(WT_SESSION_IMPL *session, WT_TRET(__wt_block_off_remove_overlap( session, block, &block->live.alloc, el->offset, el->size)); - WT_ERR(__wt_verbose(session, WT_VERB_BLOCK, + __wt_verbose(session, WT_VERB_BLOCK, "%s written %" PRIdMAX "/%" PRIu32, - el->name, (intmax_t)el->offset, el->size)); + el->name, (intmax_t)el->offset, el->size); err: __wt_scr_free(session, &tmp); return (ret); @@ -1336,7 +1336,7 @@ __wt_block_extlist_truncate( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el) { WT_EXT *ext, **astack[WT_SKIP_MAXDEPTH]; - wt_off_t orig, size; + wt_off_t size; /* * Check if the last available extent is at the end of the file, and if @@ -1353,21 +1353,11 @@ __wt_block_extlist_truncate( * the cached file size, and that can't happen until after the extent * list removal succeeds.) */ - orig = block->size; size = ext->off; WT_RET(__block_off_remove(session, block, el, size, NULL)); - block->size = size; - /* - * Truncate the file. The truncate might fail, and that's OK, we simply - * ignore those blocks. - */ - WT_RET(__wt_verbose(session, WT_VERB_BLOCK, - "truncate file from %" PRIdMAX " to %" PRIdMAX, - (intmax_t)orig, (intmax_t)size)); - WT_RET_BUSY_OK(__wt_block_truncate(session, block, size)); - - return (0); + /* Truncate the file. */ + return (__wt_block_truncate(session, block, size)); } /* @@ -1444,10 +1434,10 @@ __block_extlist_dump( tag, el->name, el->entries, __wt_buf_set_size(session, el->bytes, true, t1))); else - WT_ERR(__wt_verbose(session, WT_VERB_BLOCK, + __wt_verbose(session, WT_VERB_BLOCK, "%s extent list %s, %" PRIu32 " entries, %s bytes", tag, el->name, el->entries, - __wt_buf_set_size(session, el->bytes, true, t1))); + __wt_buf_set_size(session, el->bytes, true, t1)); if (el->entries == 0) goto done; @@ -1475,8 +1465,7 @@ __block_extlist_dump( if (block->verify_layout) WT_ERR(__wt_msg(session, "%s", (char *)t1->data)); else - WT_ERR(__wt_verbose( - session, WT_VERB_BLOCK, "%s", (char *)t1->data)); + __wt_verbose(session, WT_VERB_BLOCK, "%s", (char *)t1->data); done: err: __wt_scr_free(session, &t1); diff --git a/src/third_party/wiredtiger/src/block/block_map.c b/src/third_party/wiredtiger/src/block/block_map.c index d2c70fb4c49..b7afa61cc55 100644 --- a/src/third_party/wiredtiger/src/block/block_map.c +++ b/src/third_party/wiredtiger/src/block/block_map.c @@ -56,7 +56,7 @@ __wt_block_map(WT_SESSION_IMPL *session, WT_BLOCK *block, */ ret = handle->fh_map(handle, (WT_SESSION *)session, mapped_regionp, lengthp, mapped_cookiep); - if (ret == ENOTSUP) { + if (ret == EBUSY || ret == ENOTSUP) { *(void **)mapped_regionp = NULL; ret = 0; } diff --git a/src/third_party/wiredtiger/src/block/block_open.c b/src/third_party/wiredtiger/src/block/block_open.c index 7cff7eab629..b975f1612cc 100644 --- a/src/third_party/wiredtiger/src/block/block_open.c +++ b/src/third_party/wiredtiger/src/block/block_open.c @@ -150,7 +150,7 @@ __wt_block_open(WT_SESSION_IMPL *session, uint64_t bucket, hash; uint32_t flags; - WT_RET(__wt_verbose(session, WT_VERB_BLOCK, "open: %s", filename)); + __wt_verbose(session, WT_VERB_BLOCK, "open: %s", filename); conn = S2C(session); *blockp = block = NULL; @@ -248,14 +248,14 @@ __wt_block_close(WT_SESSION_IMPL *session, WT_BLOCK *block) conn = S2C(session); - WT_TRET(__wt_verbose(session, WT_VERB_BLOCK, - "close: %s", block->name == NULL ? "" : block->name )); + __wt_verbose(session, WT_VERB_BLOCK, + "close: %s", block->name == NULL ? "" : block->name ); __wt_spin_lock(session, &conn->block_lock); /* Reference count is initialized to 1. */ if (block->ref == 0 || --block->ref == 0) - WT_TRET(__block_destroy(session, block)); + ret = __block_destroy(session, block); __wt_spin_unlock(session, &conn->block_lock); @@ -362,13 +362,13 @@ __desc_read(WT_SESSION_IMPL *session, WT_BLOCK *block) WT_BLOCK_MAJOR_VERSION, WT_BLOCK_MINOR_VERSION, desc->majorv, desc->minorv); - WT_ERR(__wt_verbose(session, WT_VERB_BLOCK, + __wt_verbose(session, WT_VERB_BLOCK, "%s: magic %" PRIu32 ", major/minor: %" PRIu32 "/%" PRIu32 ", checksum %#" PRIx32, block->name, desc->magic, desc->majorv, desc->minorv, - desc->cksum)); + desc->cksum); err: __wt_scr_free(session, &buf); return (ret); diff --git a/src/third_party/wiredtiger/src/block/block_read.c b/src/third_party/wiredtiger/src/block/block_read.c index 97157e4a0f1..6706800409c 100644 --- a/src/third_party/wiredtiger/src/block/block_read.c +++ b/src/third_party/wiredtiger/src/block/block_read.c @@ -156,9 +156,9 @@ __wt_block_read_off(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t bufsize; uint32_t page_cksum; - WT_RET(__wt_verbose(session, WT_VERB_READ, + __wt_verbose(session, WT_VERB_READ, "off %" PRIuMAX ", size %" PRIu32 ", cksum %" PRIu32, - (uintmax_t)offset, size, cksum)); + (uintmax_t)offset, size, cksum); WT_STAT_FAST_CONN_INCR(session, block_read); WT_STAT_FAST_CONN_INCRV(session, block_byte_read, size); diff --git a/src/third_party/wiredtiger/src/block/block_slvg.c b/src/third_party/wiredtiger/src/block/block_slvg.c index 6be3fa73f70..1bfc67f45e2 100644 --- a/src/third_party/wiredtiger/src/block/block_slvg.c +++ b/src/third_party/wiredtiger/src/block/block_slvg.c @@ -33,13 +33,10 @@ __wt_block_salvage_start(WT_SESSION_IMPL *session, WT_BLOCK *block) * Truncate the file to an allocation-size multiple of blocks (bytes * trailing the last block must be garbage, by definition). */ - if (block->size > allocsize) { + len = allocsize; + if (block->size > allocsize) len = (block->size / allocsize) * allocsize; - if (len != block->size) - WT_RET(__wt_block_truncate(session, block, len)); - } else - len = allocsize; - block->live.file_size = len; + WT_RET(__wt_block_truncate(session, block, len)); /* * The file's first allocation-sized block is description information, @@ -142,9 +139,9 @@ __wt_block_salvage_next(WT_SESSION_IMPL *session, break; /* Free the allocation-size block. */ - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "skipping %" PRIu32 "B at file offset %" PRIuMAX, - allocsize, (uintmax_t)offset)); + allocsize, (uintmax_t)offset); WT_ERR(__wt_block_off_free( session, block, offset, (wt_off_t)allocsize)); block->slvg_off += allocsize; diff --git a/src/third_party/wiredtiger/src/block/block_vrfy.c b/src/third_party/wiredtiger/src/block/block_vrfy.c index af58864b9dc..81b6059ab25 100644 --- a/src/third_party/wiredtiger/src/block/block_vrfy.c +++ b/src/third_party/wiredtiger/src/block/block_vrfy.c @@ -386,12 +386,12 @@ __verify_filefrag_add(WT_SESSION_IMPL *session, WT_BLOCK *block, { uint64_t f, frag, frags, i; - WT_RET(__wt_verbose(session, WT_VERB_VERIFY, + __wt_verbose(session, WT_VERB_VERIFY, "add file block%s%s%s at %" PRIuMAX "-%" PRIuMAX " (%" PRIuMAX ")", type == NULL ? "" : " (", type == NULL ? "" : type, type == NULL ? "" : ")", - (uintmax_t)offset, (uintmax_t)(offset + size), (uintmax_t)size)); + (uintmax_t)offset, (uintmax_t)(offset + size), (uintmax_t)size); /* Check each chunk against the total file size. */ if (offset + size > block->size) @@ -491,9 +491,9 @@ __verify_ckptfrag_add( { uint64_t f, frag, frags, i; - WT_RET(__wt_verbose(session, WT_VERB_VERIFY, + __wt_verbose(session, WT_VERB_VERIFY, "add checkpoint block at %" PRIuMAX "-%" PRIuMAX " (%" PRIuMAX ")", - (uintmax_t)offset, (uintmax_t)(offset + size), (uintmax_t)size)); + (uintmax_t)offset, (uintmax_t)(offset + size), (uintmax_t)size); /* * Check each chunk against the checkpoint's size, a checkpoint should diff --git a/src/third_party/wiredtiger/src/block/block_write.c b/src/third_party/wiredtiger/src/block/block_write.c index 30d06e6259a..d926a8b7c2d 100644 --- a/src/third_party/wiredtiger/src/block/block_write.c +++ b/src/third_party/wiredtiger/src/block/block_write.c @@ -15,6 +15,20 @@ int __wt_block_truncate(WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t len) { + WT_DECL_RET; + + __wt_verbose(session, + WT_VERB_BLOCK, "truncate file to %" PRIuMAX, (uintmax_t)len); + + /* + * Truncate requires serialization, we depend on our caller for that. + * + * Truncation isn't a requirement of the block manager, it's only used + * to conserve disk space. Regardless of the underlying file system + * call's result, the in-memory understanding of the file size changes. + */ + block->size = block->extend_size = len; + /* * Backups are done by copying files outside of WiredTiger, potentially * by system utilities. We cannot truncate the file during the backup @@ -26,18 +40,16 @@ __wt_block_truncate(WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t len) * targeted solution at some point. */ if (S2C(session)->hot_backup) - return (EBUSY); + return (0); /* - * Additionally, the truncate might fail if there's a file mapping (if - * there's an open checkpoint on the file), in which case the underlying - * function returns EBUSY. + * The truncate may fail temporarily or permanently (for example, there + * may be a file mapping if there's an open checkpoint on the file on a + * POSIX system, in which case the underlying function returns EBUSY). + * It's OK, we don't have to be able to truncate files. */ - WT_RET(__wt_ftruncate(session, block->fh, len)); - - block->size = block->extend_size = len; - - return (0); + ret = __wt_ftruncate(session, block->fh, len); + return (ret == EBUSY || ret == ENOTSUP ? 0 : ret); } /* @@ -82,22 +94,18 @@ __wt_block_extend(WT_SESSION_IMPL *session, WT_BLOCK *block, { WT_DECL_RET; WT_FILE_HANDLE *handle; - bool locked; /* * The locking in this function is messy: by definition, the live system * is locked when we're called, but that lock may have been acquired by * our caller or our caller's caller. If our caller's lock, release_lock - * comes in set, indicating this function can unlock it before returning - * (either before extending the file or afterward, depending on the call - * used). If it is our caller's caller, then release_lock comes in not - * set, indicating it cannot be released here. + * comes in set and this function can unlock it before returning (so it + * isn't held while extending the file). If it is our caller's caller, + * then release_lock comes in not set, indicating it cannot be released + * here. * - * If we unlock here, we clear release_lock. But if we then find out we - * need a lock after all, we re-acquire the lock and set release_lock so - * our caller knows to release it. + * If we unlock here, we clear release_lock. */ - locked = true; /* If not configured to extend the file, we're done. */ if (block->extend_len == 0) @@ -122,62 +130,39 @@ __wt_block_extend(WT_SESSION_IMPL *session, WT_BLOCK *block, * used to extend the file initialize the extended space. If a writing * thread races with the extending thread, the extending thread might * overwrite already written data, and that would be very, very bad. - * - * Some variants of the system call to extend the file fail at run-time - * based on the filesystem type, fall back to ftruncate in that case, - * and remember that ftruncate requires locking. */ handle = fh->handle; - if (handle->fh_allocate != NULL || - handle->fh_allocate_nolock != NULL) { - /* - * Release any locally acquired lock if not needed to extend the - * file, extending the file may require updating on-disk file's - * metadata, which can be slow. (It may be a bad idea to - * configure for file extension on systems that require locking - * over the extend call.) - */ - if (handle->fh_allocate_nolock != NULL && *release_lockp) { - *release_lockp = locked = false; - __wt_spin_unlock(session, &block->live_lock); - } - - /* - * Extend the file: there's a race between setting the value of - * extend_size and doing the extension, but it should err on the - * side of extend_size being smaller than the actual file size, - * and that's OK, we simply may do another extension sooner than - * otherwise. - */ - block->extend_size = block->size + block->extend_len * 2; - if ((ret = __wt_fallocate( - session, fh, block->size, block->extend_len * 2)) == 0) - return (0); - WT_RET_ERROR_OK(ret, ENOTSUP); - } + if (handle->fh_extend == NULL && handle->fh_extend_nolock == NULL) + return (0); /* - * We may have a caller lock or a locally acquired lock, but we need a - * lock to call ftruncate. + * Set the extend_size before releasing the lock, I don't want to read + * and manipulate multiple values without holding a lock. + * + * There's a race between the calculation and doing the extension, but + * it should err on the side of extend_size being smaller than the + * actual file size, and that's OK, we simply may do another extension + * sooner than otherwise. */ - if (!locked) { - __wt_spin_lock(session, &block->live_lock); - *release_lockp = true; - } + block->extend_size = block->size + block->extend_len * 2; /* - * The underlying truncate call initializes allocated space, reset the - * extend length after locking so we don't overwrite already-written - * blocks. + * Release any locally acquired lock if not needed to extend the file, + * extending the file may require updating on-disk file's metadata, + * which can be slow. (It may be a bad idea to configure for file + * extension on systems that require locking over the extend call.) */ - block->extend_size = block->size + block->extend_len * 2; + if (handle->fh_extend_nolock != NULL && *release_lockp) { + *release_lockp = false; + __wt_spin_unlock(session, &block->live_lock); + } /* - * The truncate might fail if there's a mapped file (in other words, if - * there's an open checkpoint on the file), that's OK. + * The extend might fail (for example, the file is mapped into memory), + * or discover file extension isn't supported; both are OK. */ - WT_RET_BUSY_OK(__wt_ftruncate(session, fh, block->extend_size)); - return (0); + ret = __wt_fextend(session, fh, block->extend_size); + return (ret == EBUSY || ret == ENOTSUP ? 0 : ret); } /* @@ -378,9 +363,9 @@ __block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_STAT_FAST_CONN_INCRV( session, block_byte_write_checkpoint, align_size); - WT_RET(__wt_verbose(session, WT_VERB_WRITE, + __wt_verbose(session, WT_VERB_WRITE, "off %" PRIuMAX ", size %" PRIuMAX ", cksum %" PRIu32, - (uintmax_t)offset, (uintmax_t)align_size, cksum)); + (uintmax_t)offset, (uintmax_t)align_size, cksum); *offsetp = offset; *sizep = WT_STORE_SIZE(align_size); diff --git a/src/third_party/wiredtiger/src/bloom/bloom.c b/src/third_party/wiredtiger/src/bloom/bloom.c index e32544d5521..76b1b5f68ad 100644 --- a/src/third_party/wiredtiger/src/bloom/bloom.c +++ b/src/third_party/wiredtiger/src/bloom/bloom.c @@ -105,7 +105,7 @@ __wt_bloom_create( *bloomp = bloom; return (0); -err: (void)__wt_bloom_close(bloom); +err: WT_TRET(__wt_bloom_close(bloom)); return (ret); } @@ -166,7 +166,7 @@ __wt_bloom_open(WT_SESSION_IMPL *session, *bloomp = bloom; return (0); -err: (void)__wt_bloom_close(bloom); +err: WT_TRET(__wt_bloom_close(bloom)); return (ret); } diff --git a/src/third_party/wiredtiger/src/btree/bt_compact.c b/src/third_party/wiredtiger/src/btree/bt_compact.c index 9cc56c56452..bb1261d94b0 100644 --- a/src/third_party/wiredtiger/src/btree/bt_compact.c +++ b/src/third_party/wiredtiger/src/btree/bt_compact.c @@ -60,7 +60,7 @@ __compact_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp) */ if (mod->rec_result == WT_PM_REC_REPLACE || mod->rec_result == WT_PM_REC_MULTIBLOCK) - WT_RET(__wt_fair_lock(session, &page->page_lock)); + __wt_writelock(session, &page->page_lock); if (mod->rec_result == WT_PM_REC_REPLACE) ret = bm->compact_page_skip(bm, session, @@ -80,7 +80,7 @@ __compact_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp) if (mod->rec_result == WT_PM_REC_REPLACE || mod->rec_result == WT_PM_REC_MULTIBLOCK) - WT_TRET(__wt_fair_unlock(session, &page->page_lock)); + __wt_writeunlock(session, &page->page_lock); return (ret); } diff --git a/src/third_party/wiredtiger/src/btree/bt_curnext.c b/src/third_party/wiredtiger/src/btree/bt_curnext.c index e1b097c22a5..c6955dd9ed6 100644 --- a/src/third_party/wiredtiger/src/btree/bt_curnext.c +++ b/src/third_party/wiredtiger/src/btree/bt_curnext.c @@ -665,7 +665,7 @@ __wt_btcur_next(WT_CURSOR_BTREE *cbt, bool truncating) if (page != NULL && (cbt->page_deleted_count > WT_BTREE_DELETE_THRESHOLD || (newpage && cbt->page_deleted_count > 0))) - WT_ERR(__wt_page_evict_soon(session, cbt->ref)); + __wt_page_evict_soon(session, cbt->ref); cbt->page_deleted_count = 0; WT_ERR(__wt_tree_walk(session, &cbt->ref, flags)); diff --git a/src/third_party/wiredtiger/src/btree/bt_curprev.c b/src/third_party/wiredtiger/src/btree/bt_curprev.c index e39dffa357f..79fd067ac7b 100644 --- a/src/third_party/wiredtiger/src/btree/bt_curprev.c +++ b/src/third_party/wiredtiger/src/btree/bt_curprev.c @@ -621,7 +621,7 @@ __wt_btcur_prev(WT_CURSOR_BTREE *cbt, bool truncating) if (page != NULL && (cbt->page_deleted_count > WT_BTREE_DELETE_THRESHOLD || (newpage && cbt->page_deleted_count > 0))) - WT_ERR(__wt_page_evict_soon(session, cbt->ref)); + __wt_page_evict_soon(session, cbt->ref); cbt->page_deleted_count = 0; WT_ERR(__wt_tree_walk(session, &cbt->ref, flags)); diff --git a/src/third_party/wiredtiger/src/btree/bt_debug.c b/src/third_party/wiredtiger/src/btree/bt_debug.c index b1579d25dc6..c1560150435 100644 --- a/src/third_party/wiredtiger/src/btree/bt_debug.c +++ b/src/third_party/wiredtiger/src/btree/bt_debug.c @@ -12,45 +12,47 @@ /* * We pass around a session handle and output information, group it together. */ -typedef struct { +typedef struct __wt_dbg WT_DBG; +struct __wt_dbg { WT_SESSION_IMPL *session; /* Enclosing session */ /* * When using the standard event handlers, the debugging output has to * do its own message handling because its output isn't line-oriented. */ - FILE *fp; + FILE *fp; /* Optional file handle */ WT_ITEM *msg; /* Buffered message */ + int (*f)(WT_DBG *, const char *, ...) /* Function to write */ + WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 2, 3))); + WT_ITEM *tmp; /* Temporary space */ -} WT_DBG; +}; static const /* Output separator */ char * const sep = "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; -static int __debug_cell(WT_DBG *, const WT_PAGE_HEADER *, WT_CELL_UNPACK *); -static int __debug_cell_data( +static int __debug_cell(WT_DBG *, const WT_PAGE_HEADER *, WT_CELL_UNPACK *); +static int __debug_cell_data( WT_DBG *, WT_PAGE *, int type, const char *, WT_CELL_UNPACK *); -static void __debug_col_skip(WT_DBG *, WT_INSERT_HEAD *, const char *, bool); -static int __debug_config(WT_SESSION_IMPL *, WT_DBG *, const char *); -static int __debug_dsk_cell(WT_DBG *, const WT_PAGE_HEADER *); -static void __debug_dsk_col_fix(WT_DBG *, const WT_PAGE_HEADER *); -static void __debug_item(WT_DBG *, const char *, const void *, size_t); -static int __debug_page(WT_DBG *, WT_REF *, uint32_t); -static void __debug_page_col_fix(WT_DBG *, WT_REF *); -static int __debug_page_col_int(WT_DBG *, WT_PAGE *, uint32_t); -static int __debug_page_col_var(WT_DBG *, WT_REF *); -static int __debug_page_metadata(WT_DBG *, WT_REF *); -static int __debug_page_row_int(WT_DBG *, WT_PAGE *, uint32_t); -static int __debug_page_row_leaf(WT_DBG *, WT_PAGE *); -static void __debug_ref(WT_DBG *, WT_REF *); -static void __debug_row_skip(WT_DBG *, WT_INSERT_HEAD *); -static int __debug_tree( +static int __debug_col_skip(WT_DBG *, WT_INSERT_HEAD *, const char *, bool); +static int __debug_config(WT_SESSION_IMPL *, WT_DBG *, const char *); +static int __debug_dsk_cell(WT_DBG *, const WT_PAGE_HEADER *); +static int __debug_dsk_col_fix(WT_DBG *, const WT_PAGE_HEADER *); +static int __debug_item(WT_DBG *, const char *, const void *, size_t); +static int __debug_page(WT_DBG *, WT_REF *, uint32_t); +static int __debug_page_col_fix(WT_DBG *, WT_REF *); +static int __debug_page_col_int(WT_DBG *, WT_PAGE *, uint32_t); +static int __debug_page_col_var(WT_DBG *, WT_REF *); +static int __debug_page_metadata(WT_DBG *, WT_REF *); +static int __debug_page_row_int(WT_DBG *, WT_PAGE *, uint32_t); +static int __debug_page_row_leaf(WT_DBG *, WT_PAGE *); +static int __debug_ref(WT_DBG *, WT_REF *); +static int __debug_row_skip(WT_DBG *, WT_INSERT_HEAD *); +static int __debug_tree( WT_SESSION_IMPL *, WT_BTREE *, WT_REF *, const char *, uint32_t); -static void __debug_update(WT_DBG *, WT_UPDATE *, bool); -static void __dmsg(WT_DBG *, const char *, ...) - WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 2, 3))); -static void __dmsg_wrapup(WT_DBG *); +static int __debug_update(WT_DBG *, WT_UPDATE *, bool); +static int __dmsg_wrapup(WT_DBG *); /* * __wt_debug_set_verbose -- @@ -71,10 +73,80 @@ __wt_debug_set_verbose(WT_SESSION_IMPL *session, const char *v) * __debug_hex_byte -- * Output a single byte in hex. */ -static inline void +static inline int __debug_hex_byte(WT_DBG *ds, uint8_t v) { - __dmsg(ds, "#%c%c", __wt_hex[(v & 0xf0) >> 4], __wt_hex[v & 0x0f]); + return (ds->f( + ds, "#%c%c", __wt_hex[(v & 0xf0) >> 4], __wt_hex[v & 0x0f])); +} + +/* + * __dmsg_event -- + * Send a debug message to the event handler. + */ +static int +__dmsg_event(WT_DBG *ds, const char *fmt, ...) +{ + WT_ITEM *msg; + WT_SESSION_IMPL *session; + size_t len, space; + va_list ap; + char *p; + + session = ds->session; + + /* + * Debug output chunks are not necessarily terminated with a newline + * character. It's easy if we're dumping to a stream, but if we're + * dumping to an event handler, which is line-oriented, we must buffer + * the output chunk, and pass it to the event handler once we see a + * terminating newline. + */ + msg = ds->msg; + for (;;) { + p = (char *)msg->mem + msg->size; + space = msg->memsize - msg->size; + va_start(ap, fmt); + len = (size_t)vsnprintf(p, space, fmt, ap); + va_end(ap); + + /* Check if there was enough space. */ + if (len < space) { + msg->size += len; + break; + } + + /* + * There's not much to do on error without checking for + * an error return on every single printf. Anyway, it's + * pretty unlikely and this is debugging output, I'm not + * going to worry about it. + */ + WT_RET(__wt_buf_grow(session, msg, msg->memsize + len + 128)); + } + if (((uint8_t *)msg->mem)[msg->size - 1] == '\n') { + ((uint8_t *)msg->mem)[msg->size - 1] = '\0'; + WT_RET(__wt_msg(session, "%s", (char *)msg->mem)); + msg->size = 0; + } + + return (0); +} + +/* + * __dmsg_file -- + * Send a debug message to a file. + */ +static int +__dmsg_file(WT_DBG *ds, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + (void)vfprintf(ds->fp, fmt, ap); + va_end(ap); + + return (0); } /* @@ -94,12 +166,15 @@ __debug_config(WT_SESSION_IMPL *session, WT_DBG *ds, const char *ofile) * If we weren't given a file, we use the default event handler, and * we'll have to buffer messages. */ - if (ofile == NULL) - return (__wt_scr_alloc(session, 512, &ds->msg)); - - if ((ds->fp = fopen(ofile, "w")) == NULL) - return (EIO); - __wt_stream_set_line_buffer(ds->fp); + if (ofile == NULL) { + WT_RET(__wt_scr_alloc(session, 512, &ds->msg)); + ds->f = __dmsg_event; + } else { + if ((ds->fp = fopen(ofile, "w")) == NULL) + return (EIO); + __wt_stream_set_line_buffer(ds->fp); + ds->f = __dmsg_file; + } return (0); } @@ -108,7 +183,7 @@ __debug_config(WT_SESSION_IMPL *session, WT_DBG *ds, const char *ofile) * __dmsg_wrapup -- * Flush any remaining output, release resources. */ -static void +static int __dmsg_wrapup(WT_DBG *ds) { WT_SESSION_IMPL *session; @@ -125,72 +200,15 @@ __dmsg_wrapup(WT_DBG *ds) */ if (msg != NULL) { if (msg->size != 0) - (void)__wt_msg(session, "%s", (char *)msg->mem); + WT_RET(__wt_msg(session, "%s", (char *)msg->mem)); __wt_scr_free(session, &ds->msg); } /* Close any file we opened. */ if (ds->fp != NULL) (void)fclose(ds->fp); -} -/* - * __dmsg -- - * Debug message. - */ -static void -__dmsg(WT_DBG *ds, const char *fmt, ...) -{ - va_list ap; - WT_ITEM *msg; - WT_SESSION_IMPL *session; - size_t len, space; - char *p; - - session = ds->session; - - /* - * Debug output chunks are not necessarily terminated with a newline - * character. It's easy if we're dumping to a stream, but if we're - * dumping to an event handler, which is line-oriented, we must buffer - * the output chunk, and pass it to the event handler once we see a - * terminating newline. - */ - if (ds->fp == NULL) { - msg = ds->msg; - for (;;) { - p = (char *)msg->mem + msg->size; - space = msg->memsize - msg->size; - va_start(ap, fmt); - len = (size_t)vsnprintf(p, space, fmt, ap); - va_end(ap); - - /* Check if there was enough space. */ - if (len < space) { - msg->size += len; - break; - } - - /* - * There's not much to do on error without checking for - * an error return on every single printf. Anyway, it's - * pretty unlikely and this is debugging output, I'm not - * going to worry about it. - */ - if (__wt_buf_grow( - session, msg, msg->memsize + len + 128) != 0) - return; - } - if (((uint8_t *)msg->mem)[msg->size - 1] == '\n') { - ((uint8_t *)msg->mem)[msg->size - 1] = '\0'; - (void)__wt_msg(session, "%s", (char *)msg->mem); - msg->size = 0; - } - } else { - va_start(ap, fmt); - (void)vfprintf(ds->fp, fmt, ap); - va_end(ap); - } + return (0); } /* @@ -314,69 +332,66 @@ __wt_debug_disk( WT_SESSION_IMPL *session, const WT_PAGE_HEADER *dsk, const char *ofile) { WT_DBG *ds, _ds; - WT_DECL_RET; ds = &_ds; WT_RET(__debug_config(session, ds, ofile)); - __dmsg(ds, "%s page", __wt_page_type_string(dsk->type)); + WT_RET(ds->f(ds, "%s page", __wt_page_type_string(dsk->type))); switch (dsk->type) { case WT_PAGE_BLOCK_MANAGER: break; case WT_PAGE_COL_FIX: case WT_PAGE_COL_INT: case WT_PAGE_COL_VAR: - __dmsg(ds, ", recno %" PRIu64, dsk->recno); + WT_RET(ds->f(ds, ", recno %" PRIu64, dsk->recno)); /* FALLTHROUGH */ case WT_PAGE_ROW_INT: case WT_PAGE_ROW_LEAF: - __dmsg(ds, ", entries %" PRIu32, dsk->u.entries); + WT_RET(ds->f(ds, ", entries %" PRIu32, dsk->u.entries)); break; case WT_PAGE_OVFL: - __dmsg(ds, ", datalen %" PRIu32, dsk->u.datalen); + WT_RET(ds->f(ds, ", datalen %" PRIu32, dsk->u.datalen)); break; WT_ILLEGAL_VALUE(session); } if (F_ISSET(dsk, WT_PAGE_COMPRESSED)) - __dmsg(ds, ", compressed"); + WT_RET(ds->f(ds, ", compressed")); if (F_ISSET(dsk, WT_PAGE_ENCRYPTED)) - __dmsg(ds, ", encrypted"); + WT_RET(ds->f(ds, ", encrypted")); if (F_ISSET(dsk, WT_PAGE_EMPTY_V_ALL)) - __dmsg(ds, ", empty-all"); + WT_RET(ds->f(ds, ", empty-all")); if (F_ISSET(dsk, WT_PAGE_EMPTY_V_NONE)) - __dmsg(ds, ", empty-none"); + WT_RET(ds->f(ds, ", empty-none")); if (F_ISSET(dsk, WT_PAGE_LAS_UPDATE)) - __dmsg(ds, ", LAS-update"); + WT_RET(ds->f(ds, ", LAS-update")); - __dmsg(ds, ", generation %" PRIu64 "\n", dsk->write_gen); + WT_RET(ds->f(ds, ", generation %" PRIu64 "\n", dsk->write_gen)); switch (dsk->type) { case WT_PAGE_BLOCK_MANAGER: break; case WT_PAGE_COL_FIX: - __debug_dsk_col_fix(ds, dsk); + WT_RET(__debug_dsk_col_fix(ds, dsk)); break; case WT_PAGE_COL_INT: case WT_PAGE_COL_VAR: case WT_PAGE_ROW_INT: case WT_PAGE_ROW_LEAF: - ret = __debug_dsk_cell(ds, dsk); + WT_RET(__debug_dsk_cell(ds, dsk)); break; default: break; } - __dmsg_wrapup(ds); - - return (ret); + return (__dmsg_wrapup(ds)); } /* * __debug_dsk_col_fix -- * Dump a WT_PAGE_COL_FIX page. */ -static void +static int __debug_dsk_col_fix(WT_DBG *ds, const WT_PAGE_HEADER *dsk) { WT_BTREE *btree; @@ -388,10 +403,11 @@ __debug_dsk_col_fix(WT_DBG *ds, const WT_PAGE_HEADER *dsk) btree = S2BT(ds->session); WT_FIX_FOREACH(btree, dsk, v, i) { - __dmsg(ds, "\t{"); - __debug_hex_byte(ds, v); - __dmsg(ds, "}\n"); + WT_RET(ds->f(ds, "\t{")); + WT_RET(__debug_hex_byte(ds, v)); + WT_RET(ds->f(ds, "}\n")); } + return (0); } /* @@ -444,7 +460,7 @@ __debug_tree_shape_info(WT_PAGE *page) * __debug_tree_shape_worker -- * Dump information about the current page and descend. */ -static void +static int __debug_tree_shape_worker(WT_DBG *ds, WT_PAGE *page, int level) { WT_REF *ref; @@ -453,16 +469,17 @@ __debug_tree_shape_worker(WT_DBG *ds, WT_PAGE *page, int level) session = ds->session; if (WT_PAGE_IS_INTERNAL(page)) { - __dmsg(ds, "%*s" "I" "%d %s\n", - level * 3, " ", level, __debug_tree_shape_info(page)); + WT_RET(ds->f(ds, "%*s" "I" "%d %s\n", + level * 3, " ", level, __debug_tree_shape_info(page))); WT_INTL_FOREACH_BEGIN(session, page, ref) { if (ref->state == WT_REF_MEM) - __debug_tree_shape_worker( - ds, ref->page, level + 1); + WT_RET(__debug_tree_shape_worker( + ds, ref->page, level + 1)); } WT_INTL_FOREACH_END; } else - __dmsg(ds, "%*s" "L" " %s\n", - level * 3, " ", __debug_tree_shape_info(page)); + WT_RET(ds->f(ds, "%*s" "L" " %s\n", + level * 3, " ", __debug_tree_shape_info(page))); + return (0); } /* @@ -474,6 +491,7 @@ __wt_debug_tree_shape( WT_SESSION_IMPL *session, WT_PAGE *page, const char *ofile) { WT_DBG *ds, _ds; + WT_DECL_RET; WT_ASSERT(session, S2BT_SAFE(session) != NULL); @@ -484,10 +502,11 @@ __wt_debug_tree_shape( if (page == NULL) page = S2BT(session)->root.page; - WT_WITH_PAGE_INDEX(session, __debug_tree_shape_worker(ds, page, 1)); + WT_WITH_PAGE_INDEX(session, + ret = __debug_tree_shape_worker(ds, page, 1)); + WT_RET(ret); - __dmsg_wrapup(ds); - return (0); + return (__dmsg_wrapup(ds)); } #define WT_DEBUG_TREE_LEAF 0x01 /* Debug leaf pages */ @@ -530,18 +549,15 @@ int __wt_debug_page(WT_SESSION_IMPL *session, WT_REF *ref, const char *ofile) { WT_DBG *ds, _ds; - WT_DECL_RET; WT_ASSERT(session, S2BT_SAFE(session) != NULL); ds = &_ds; WT_RET(__debug_config(session, ds, ofile)); - ret = __debug_page(ds, ref, WT_DEBUG_TREE_LEAF); - - __dmsg_wrapup(ds); + WT_RET(__debug_page(ds, ref, WT_DEBUG_TREE_LEAF)); - return (ret); + return (__dmsg_wrapup(ds)); } /* @@ -567,10 +583,9 @@ __debug_tree(WT_SESSION_IMPL *session, ref = &btree->root; WT_WITH_BTREE(session, btree, ret = __debug_page(ds, ref, flags)); + WT_RET(ret); - __dmsg_wrapup(ds); - - return (ret); + return (__dmsg_wrapup(ds)); } /* @@ -593,7 +608,7 @@ __debug_page(WT_DBG *ds, WT_REF *ref, uint32_t flags) switch (ref->page->type) { case WT_PAGE_COL_FIX: if (LF_ISSET(WT_DEBUG_TREE_LEAF)) - __debug_page_col_fix(ds, ref); + WT_RET(__debug_page_col_fix(ds, ref)); break; case WT_PAGE_COL_INT: WT_WITH_PAGE_INDEX(session, @@ -636,20 +651,20 @@ __debug_page_metadata(WT_DBG *ds, WT_REF *ref) page = ref->page; mod = page->modify; - __dmsg(ds, "%p", (void *)page); + WT_RET(ds->f(ds, "%p", (void *)page)); switch (page->type) { case WT_PAGE_COL_INT: - __dmsg(ds, " recno %" PRIu64, ref->ref_recno); + WT_RET(ds->f(ds, " recno %" PRIu64, ref->ref_recno)); WT_INTL_INDEX_GET(session, page, pindex); entries = pindex->entries; break; case WT_PAGE_COL_FIX: - __dmsg(ds, " recno %" PRIu64, ref->ref_recno); + WT_RET(ds->f(ds, " recno %" PRIu64, ref->ref_recno)); entries = page->pg_fix_entries; break; case WT_PAGE_COL_VAR: - __dmsg(ds, " recno %" PRIu64, ref->ref_recno); + WT_RET(ds->f(ds, " recno %" PRIu64, ref->ref_recno)); entries = page->pg_var_entries; break; case WT_PAGE_ROW_INT: @@ -662,48 +677,50 @@ __debug_page_metadata(WT_DBG *ds, WT_REF *ref) WT_ILLEGAL_VALUE(session); } - __dmsg(ds, ": %s\n", __wt_page_type_string(page->type)); - __dmsg(ds, - "\t" "disk %p, entries %" PRIu32, (void *)page->dsk, entries); - __dmsg(ds, ", %s", __wt_page_is_modified(page) ? "dirty" : "clean"); - __dmsg(ds, ", %s", __wt_fair_islocked( - session, &page->page_lock) ? "locked" : "unlocked"); + WT_RET(ds->f(ds, ": %s\n", __wt_page_type_string(page->type))); + WT_RET(ds->f(ds, + "\t" "disk %p, entries %" PRIu32, (void *)page->dsk, entries)); + WT_RET(ds->f(ds, + ", %s", __wt_page_is_modified(page) ? "dirty" : "clean")); + WT_RET(ds->f(ds, ", %s", __wt_rwlock_islocked( + session, &page->page_lock) ? "locked" : "unlocked")); if (F_ISSET_ATOMIC(page, WT_PAGE_BUILD_KEYS)) - __dmsg(ds, ", keys-built"); + WT_RET(ds->f(ds, ", keys-built")); if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_ALLOC)) - __dmsg(ds, ", disk-alloc"); + WT_RET(ds->f(ds, ", disk-alloc")); if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_MAPPED)) - __dmsg(ds, ", disk-mapped"); + WT_RET(ds->f(ds, ", disk-mapped")); if (F_ISSET_ATOMIC(page, WT_PAGE_EVICT_LRU)) - __dmsg(ds, ", evict-lru"); + WT_RET(ds->f(ds, ", evict-lru")); if (F_ISSET_ATOMIC(page, WT_PAGE_OVERFLOW_KEYS)) - __dmsg(ds, ", overflow-keys"); + WT_RET(ds->f(ds, ", overflow-keys")); if (F_ISSET_ATOMIC(page, WT_PAGE_SPLIT_BLOCK)) - __dmsg(ds, ", split-block"); + WT_RET(ds->f(ds, ", split-block")); if (F_ISSET_ATOMIC(page, WT_PAGE_SPLIT_INSERT)) - __dmsg(ds, ", split-insert"); + WT_RET(ds->f(ds, ", split-insert")); if (F_ISSET_ATOMIC(page, WT_PAGE_UPDATE_IGNORE)) - __dmsg(ds, ", update-ignore"); + WT_RET(ds->f(ds, ", update-ignore")); if (mod != NULL) switch (mod->rec_result) { case WT_PM_REC_EMPTY: - __dmsg(ds, ", empty"); + WT_RET(ds->f(ds, ", empty")); break; case WT_PM_REC_MULTIBLOCK: - __dmsg(ds, ", multiblock"); + WT_RET(ds->f(ds, ", multiblock")); break; case WT_PM_REC_REPLACE: - __dmsg(ds, ", replaced"); + WT_RET(ds->f(ds, ", replaced")); break; case 0: break; WT_ILLEGAL_VALUE(session); } if (mod != NULL) - __dmsg(ds, ", write generation=%" PRIu32, mod->write_gen); - __dmsg(ds, "\n"); + WT_RET( + ds->f(ds, ", write generation=%" PRIu32, mod->write_gen)); + WT_RET(ds->f(ds, "\n")); return (0); } @@ -712,7 +729,7 @@ __debug_page_metadata(WT_DBG *ds, WT_REF *ref) * __debug_page_col_fix -- * Dump an in-memory WT_PAGE_COL_FIX page. */ -static void +static int __debug_page_col_fix(WT_DBG *ds, WT_REF *ref) { WT_BTREE *btree; @@ -735,16 +752,15 @@ __debug_page_col_fix(WT_DBG *ds, WT_REF *ref) if (dsk != NULL) { ins = WT_SKIP_FIRST(WT_COL_UPDATE_SINGLE(page)); WT_FIX_FOREACH(btree, dsk, v, i) { - __dmsg(ds, "\t%" PRIu64 "\t{", recno); - __debug_hex_byte(ds, v); - __dmsg(ds, "}\n"); + WT_RET(ds->f(ds, "\t%" PRIu64 "\t{", recno)); + WT_RET(__debug_hex_byte(ds, v)); + WT_RET(ds->f(ds, "}\n")); /* Check for a match on the update list. */ if (ins != NULL && WT_INSERT_RECNO(ins) == recno) { - __dmsg(ds, - "\tupdate %" PRIu64 "\n", - WT_INSERT_RECNO(ins)); - __debug_update(ds, ins->upd, true); + WT_RET(ds->f(ds, "\tupdate %" PRIu64 "\n", + WT_INSERT_RECNO(ins))); + WT_RET(__debug_update(ds, ins->upd, true)); ins = WT_SKIP_NEXT(ins); } ++recno; @@ -752,14 +768,16 @@ __debug_page_col_fix(WT_DBG *ds, WT_REF *ref) } if (WT_COL_UPDATE_SINGLE(page) != NULL) { - __dmsg(ds, "%s", sep); - __debug_col_skip( - ds, WT_COL_UPDATE_SINGLE(page), "update", true); + WT_RET(ds->f(ds, "%s", sep)); + WT_RET(__debug_col_skip( + ds, WT_COL_UPDATE_SINGLE(page), "update", true)); } if (WT_COL_APPEND(page) != NULL) { - __dmsg(ds, "%s", sep); - __debug_col_skip(ds, WT_COL_APPEND(page), "append", true); + WT_RET(ds->f(ds, "%s", sep)); + WT_RET(__debug_col_skip(ds, + WT_COL_APPEND(page), "append", true)); } + return (0); } /* @@ -775,14 +793,14 @@ __debug_page_col_int(WT_DBG *ds, WT_PAGE *page, uint32_t flags) session = ds->session; WT_INTL_FOREACH_BEGIN(session, page, ref) { - __dmsg(ds, "\trecno %" PRIu64 "\n", ref->ref_recno); - __debug_ref(ds, ref); + WT_RET(ds->f(ds, "\trecno %" PRIu64 "\n", ref->ref_recno)); + WT_RET(__debug_ref(ds, ref)); } WT_INTL_FOREACH_END; if (LF_ISSET(WT_DEBUG_TREE_WALK)) WT_INTL_FOREACH_BEGIN(session, page, ref) { if (ref->state == WT_REF_MEM) { - __dmsg(ds, "\n"); + WT_RET(ds->f(ds, "\n")); WT_RET(__debug_page(ds, ref, flags)); } } WT_INTL_FOREACH_END; @@ -823,13 +841,14 @@ __debug_page_col_var(WT_DBG *ds, WT_REF *ref) __debug_cell_data(ds, page, WT_PAGE_COL_VAR, tag, unpack)); if ((update = WT_COL_UPDATE(page, cip)) != NULL) - __debug_col_skip(ds, update, "update", false); + WT_RET(__debug_col_skip(ds, update, "update", false)); recno += rle; } if (WT_COL_APPEND(page) != NULL) { - __dmsg(ds, "%s", sep); - __debug_col_skip(ds, WT_COL_APPEND(page), "append", false); + WT_RET(ds->f(ds, "%s", sep)); + WT_RET(__debug_col_skip(ds, + WT_COL_APPEND(page), "append", false)); } return (0); @@ -851,14 +870,14 @@ __debug_page_row_int(WT_DBG *ds, WT_PAGE *page, uint32_t flags) WT_INTL_FOREACH_BEGIN(session, page, ref) { __wt_ref_key(page, ref, &p, &len); - __debug_item(ds, "K", p, len); - __debug_ref(ds, ref); + WT_RET(__debug_item(ds, "K", p, len)); + WT_RET(__debug_ref(ds, ref)); } WT_INTL_FOREACH_END; if (LF_ISSET(WT_DEBUG_TREE_WALK)) WT_INTL_FOREACH_BEGIN(session, page, ref) { if (ref->state == WT_REF_MEM) { - __dmsg(ds, "\n"); + WT_RET(ds->f(ds, "\n")); WT_RET(__debug_page(ds, ref, flags)); } } WT_INTL_FOREACH_END; @@ -891,15 +910,15 @@ __debug_page_row_leaf(WT_DBG *ds, WT_PAGE *page) * key on the page. */ if ((insert = WT_ROW_INSERT_SMALLEST(page)) != NULL) - __debug_row_skip(ds, insert); + WT_ERR(__debug_row_skip(ds, insert)); /* Dump the page's K/V pairs. */ WT_ROW_FOREACH(page, rip, i) { WT_ERR(__wt_row_leaf_key(session, page, rip, key, false)); - __debug_item(ds, "K", key->data, key->size); + WT_ERR(__debug_item(ds, "K", key->data, key->size)); if ((cell = __wt_row_leaf_value_cell(page, rip, NULL)) == NULL) - __dmsg(ds, "\tV {}\n"); + WT_ERR(ds->f(ds, "\tV {}\n")); else { __wt_cell_unpack(cell, unpack); WT_ERR(__debug_cell_data( @@ -907,10 +926,10 @@ __debug_page_row_leaf(WT_DBG *ds, WT_PAGE *page) } if ((upd = WT_ROW_UPDATE(page, rip)) != NULL) - __debug_update(ds, upd, false); + WT_ERR(__debug_update(ds, upd, false)); if ((insert = WT_ROW_INSERT(page, rip)) != NULL) - __debug_row_skip(ds, insert); + WT_ERR(__debug_row_skip(ds, insert)); } err: __wt_scr_free(session, &key); @@ -921,59 +940,63 @@ err: __wt_scr_free(session, &key); * __debug_col_skip -- * Dump a column-store skiplist. */ -static void +static int __debug_col_skip( WT_DBG *ds, WT_INSERT_HEAD *head, const char *tag, bool hexbyte) { WT_INSERT *ins; WT_SKIP_FOREACH(ins, head) { - __dmsg(ds, - "\t%s %" PRIu64 "\n", tag, WT_INSERT_RECNO(ins)); - __debug_update(ds, ins->upd, hexbyte); + WT_RET(ds->f(ds, + "\t%s %" PRIu64 "\n", tag, WT_INSERT_RECNO(ins))); + WT_RET(__debug_update(ds, ins->upd, hexbyte)); } + return (0); } /* * __debug_row_skip -- * Dump an insert list. */ -static void +static int __debug_row_skip(WT_DBG *ds, WT_INSERT_HEAD *head) { WT_INSERT *ins; WT_SKIP_FOREACH(ins, head) { - __debug_item(ds, - "insert", WT_INSERT_KEY(ins), WT_INSERT_KEY_SIZE(ins)); - __debug_update(ds, ins->upd, false); + WT_RET(__debug_item(ds, + "insert", WT_INSERT_KEY(ins), WT_INSERT_KEY_SIZE(ins))); + WT_RET(__debug_update(ds, ins->upd, false)); } + return (0); } /* * __debug_update -- * Dump an update list. */ -static void +static int __debug_update(WT_DBG *ds, WT_UPDATE *upd, bool hexbyte) { for (; upd != NULL; upd = upd->next) if (WT_UPDATE_DELETED_ISSET(upd)) - __dmsg(ds, "\tvalue {deleted}\n"); + WT_RET(ds->f(ds, "\tvalue {deleted}\n")); else if (hexbyte) { - __dmsg(ds, "\t{"); - __debug_hex_byte(ds, *(uint8_t *)WT_UPDATE_DATA(upd)); - __dmsg(ds, "}\n"); + WT_RET(ds->f(ds, "\t{")); + WT_RET(__debug_hex_byte(ds, + *(uint8_t *)WT_UPDATE_DATA(upd))); + WT_RET(ds->f(ds, "}\n")); } else - __debug_item(ds, - "value", WT_UPDATE_DATA(upd), upd->size); + WT_RET(__debug_item(ds, + "value", WT_UPDATE_DATA(upd), upd->size)); + return (0); } /* * __debug_ref -- * Dump a WT_REF structure. */ -static void +static int __debug_ref(WT_DBG *ds, WT_REF *ref) { WT_SESSION_IMPL *session; @@ -982,34 +1005,34 @@ __debug_ref(WT_DBG *ds, WT_REF *ref) session = ds->session; - __dmsg(ds, "\t"); + WT_RET(ds->f(ds, "\t")); switch (ref->state) { case WT_REF_DISK: - __dmsg(ds, "disk"); + WT_RET(ds->f(ds, "disk")); break; case WT_REF_DELETED: - __dmsg(ds, "deleted"); + WT_RET(ds->f(ds, "deleted")); break; case WT_REF_LOCKED: - __dmsg(ds, "locked %p", (void *)ref->page); + WT_RET(ds->f(ds, "locked %p", (void *)ref->page)); break; case WT_REF_MEM: - __dmsg(ds, "memory %p", (void *)ref->page); + WT_RET(ds->f(ds, "memory %p", (void *)ref->page)); break; case WT_REF_READING: - __dmsg(ds, "reading"); + WT_RET(ds->f(ds, "reading")); break; case WT_REF_SPLIT: - __dmsg(ds, "split"); + WT_RET(ds->f(ds, "split")); break; default: - __dmsg(ds, "INVALID"); + WT_RET(ds->f(ds, "INVALID")); break; } __wt_ref_info(ref, &addr, &addr_size, NULL); - __dmsg(ds, " %s\n", - __wt_addr_string(session, addr, addr_size, ds->tmp)); + return (ds->f(ds, " %s\n", + __wt_addr_string(session, addr, addr_size, ds->tmp))); } /* @@ -1026,15 +1049,15 @@ __debug_cell(WT_DBG *ds, const WT_PAGE_HEADER *dsk, WT_CELL_UNPACK *unpack) session = ds->session; - __dmsg(ds, "\t%s: len %" PRIu32, - __wt_cell_type_string(unpack->raw), unpack->size); + WT_RET(ds->f(ds, "\t%s: len %" PRIu32, + __wt_cell_type_string(unpack->raw), unpack->size)); /* Dump cell's per-disk page type information. */ switch (dsk->type) { case WT_PAGE_COL_INT: switch (unpack->type) { case WT_CELL_VALUE: - __dmsg(ds, ", recno: %" PRIu64, unpack->v); + WT_RET(ds->f(ds, ", recno: %" PRIu64, unpack->v)); break; } break; @@ -1045,7 +1068,8 @@ __debug_cell(WT_DBG *ds, const WT_PAGE_HEADER *dsk, WT_CELL_UNPACK *unpack) case WT_CELL_VALUE: case WT_CELL_VALUE_OVFL: case WT_CELL_VALUE_OVFL_RM: - __dmsg(ds, ", rle: %" PRIu64, __wt_cell_rle(unpack)); + WT_RET(ds->f(ds, + ", rle: %" PRIu64, __wt_cell_rle(unpack))); break; } break; @@ -1053,7 +1077,7 @@ __debug_cell(WT_DBG *ds, const WT_PAGE_HEADER *dsk, WT_CELL_UNPACK *unpack) case WT_PAGE_ROW_LEAF: switch (unpack->type) { case WT_CELL_KEY: - __dmsg(ds, ", pfx: %" PRIu8, unpack->prefix); + WT_RET(ds->f(ds, ", pfx: %" PRIu8, unpack->prefix)); break; } break; @@ -1079,13 +1103,14 @@ __debug_cell(WT_DBG *ds, const WT_PAGE_HEADER *dsk, WT_CELL_UNPACK *unpack) case WT_CELL_VALUE_OVFL_RM: type = "ovfl"; addr: WT_RET(__wt_scr_alloc(session, 128, &buf)); - __dmsg(ds, ", %s %s", type, - __wt_addr_string(session, unpack->data, unpack->size, buf)); + WT_RET(ds->f(ds, ", %s %s", type, + __wt_addr_string( + session, unpack->data, unpack->size, buf))); __wt_scr_free(session, &buf); WT_RET(ret); break; } - __dmsg(ds, "\n"); + WT_RET(ds->f(ds, "\n")); return (__debug_cell_data(ds, NULL, dsk->type, NULL, unpack)); } @@ -1110,7 +1135,7 @@ __debug_cell_data(WT_DBG *ds, * reference. */ if (unpack == NULL) { - __debug_item(ds, tag, "deleted", strlen("deleted")); + WT_RET(__debug_item(ds, tag, "deleted", strlen("deleted"))); return (0); } @@ -1123,7 +1148,7 @@ __debug_cell_data(WT_DBG *ds, case WT_CELL_KEY_OVFL_RM: case WT_CELL_VALUE_OVFL_RM: p = __wt_cell_type_string(unpack->raw); - __debug_item(ds, tag, p, strlen(p)); + WT_RET(__debug_item(ds, tag, p, strlen(p))); break; case WT_CELL_KEY: case WT_CELL_KEY_OVFL: @@ -1139,7 +1164,7 @@ __debug_cell_data(WT_DBG *ds, __wt_dsk_cell_data_ref(session, page_type, unpack, buf) : __wt_page_cell_data_ref(session, page, unpack, buf); if (ret == 0) - __debug_item(ds, tag, buf->data, buf->size); + WT_RET(__debug_item(ds, tag, buf->data, buf->size)); __wt_scr_free(session, &buf); break; WT_ILLEGAL_VALUE(session); @@ -1152,21 +1177,23 @@ __debug_cell_data(WT_DBG *ds, * __debug_item -- * Dump a single data/size pair, with an optional tag. */ -static void +static int __debug_item(WT_DBG *ds, const char *tag, const void *data_arg, size_t size) { size_t i; u_char ch; const uint8_t *data; - __dmsg(ds, "\t%s%s{", tag == NULL ? "" : tag, tag == NULL ? "" : " "); + WT_RET(ds->f(ds, + "\t%s%s{", tag == NULL ? "" : tag, tag == NULL ? "" : " ")); for (data = data_arg, i = 0; i < size; ++i, ++data) { ch = data[0]; if (__wt_isprint(ch)) - __dmsg(ds, "%c", (int)ch); + WT_RET(ds->f(ds, "%c", (int)ch)); else - __debug_hex_byte(ds, data[0]); + WT_RET(__debug_hex_byte(ds, data[0])); } - __dmsg(ds, "}\n"); + WT_RET(ds->f(ds, "}\n")); + return (0); } #endif diff --git a/src/third_party/wiredtiger/src/btree/bt_discard.c b/src/third_party/wiredtiger/src/btree/bt_discard.c index 965aec16fc2..162bc07a1c2 100644 --- a/src/third_party/wiredtiger/src/btree/bt_discard.c +++ b/src/third_party/wiredtiger/src/btree/bt_discard.c @@ -61,7 +61,7 @@ __wt_page_out(WT_SESSION_IMPL *session, WT_PAGE **pagep) */ WT_ASSERT(session, !__wt_page_is_modified(page)); WT_ASSERT(session, !F_ISSET_ATOMIC(page, WT_PAGE_EVICT_LRU)); - WT_ASSERT(session, !__wt_fair_islocked(session, &page->page_lock)); + WT_ASSERT(session, !__wt_rwlock_islocked(session, &page->page_lock)); #ifdef HAVE_DIAGNOSTIC { @@ -103,6 +103,15 @@ __wt_page_out(WT_SESSION_IMPL *session, WT_PAGE **pagep) /* Update the cache's information. */ __wt_cache_page_evict(session, page); + dsk = (WT_PAGE_HEADER *)page->dsk; + if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_ALLOC)) + __wt_cache_page_image_decr(session, dsk->mem_size); + + /* Discard any mapped image. */ + if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_MAPPED)) + (void)S2BT(session)->bm->map_discard( + S2BT(session)->bm, session, dsk, (size_t)dsk->mem_size); + /* * If discarding the page as part of process exit, the application may * configure to leak the memory rather than do the work. @@ -129,17 +138,9 @@ __wt_page_out(WT_SESSION_IMPL *session, WT_PAGE **pagep) break; } - /* Discard any disk image. */ - dsk = (WT_PAGE_HEADER *)page->dsk; - if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_ALLOC)) { - __wt_cache_page_image_decr(session, dsk->mem_size); + /* Discard any allocated disk image. */ + if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_ALLOC)) __wt_overwrite_and_free_len(session, dsk, dsk->mem_size); - } - - /* Discard any mapped image. */ - if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_MAPPED)) - (void)S2BT(session)->bm->map_discard( - S2BT(session)->bm, session, dsk, (size_t)dsk->mem_size); __wt_overwrite_and_free(session, page); } diff --git a/src/third_party/wiredtiger/src/btree/bt_handle.c b/src/third_party/wiredtiger/src/btree/bt_handle.c index cacf1369430..02580bca4a8 100644 --- a/src/third_party/wiredtiger/src/btree/bt_handle.c +++ b/src/third_party/wiredtiger/src/btree/bt_handle.c @@ -163,7 +163,7 @@ __wt_btree_close(WT_SESSION_IMPL *session) __wt_btree_huffman_close(session); /* Destroy locks. */ - WT_TRET(__wt_rwlock_destroy(session, &btree->ovfl_lock)); + __wt_rwlock_destroy(session, &btree->ovfl_lock); __wt_spin_destroy(session, &btree->flush_lock); /* Free allocated memory. */ @@ -212,8 +212,8 @@ __btree_conf(WT_SESSION_IMPL *session, WT_CKPT *ckpt) maj_version = cval.val; WT_RET(__wt_config_gets(session, cfg, "version.minor", &cval)); min_version = cval.val; - WT_RET(__wt_verbose(session, WT_VERB_VERSION, - "%" PRIu64 ".%" PRIu64, maj_version, min_version)); + __wt_verbose(session, WT_VERB_VERSION, + "%" PRIu64 ".%" PRIu64, maj_version, min_version); } /* Get the file ID. */ diff --git a/src/third_party/wiredtiger/src/btree/bt_ovfl.c b/src/third_party/wiredtiger/src/btree/bt_ovfl.c index 1f080041a23..feb78df75e2 100644 --- a/src/third_party/wiredtiger/src/btree/bt_ovfl.c +++ b/src/third_party/wiredtiger/src/btree/bt_ovfl.c @@ -67,11 +67,11 @@ __wt_ovfl_read(WT_SESSION_IMPL *session, * Acquire the overflow lock, and retest the on-page cell's value inside * the lock. */ - WT_RET(__wt_readlock(session, S2BT(session)->ovfl_lock)); + __wt_readlock(session, S2BT(session)->ovfl_lock); ret = __wt_cell_type_raw(unpack->cell) == WT_CELL_VALUE_OVFL_RM ? __wt_ovfl_txnc_search(page, unpack->data, unpack->size, store) : __ovfl_read(session, unpack->data, unpack->size, store); - WT_TRET(__wt_readunlock(session, S2BT(session)->ovfl_lock)); + __wt_readunlock(session, S2BT(session)->ovfl_lock); return (ret); } @@ -231,7 +231,6 @@ __wt_ovfl_discard(WT_SESSION_IMPL *session, WT_CELL *cell) WT_BM *bm; WT_BTREE *btree; WT_CELL_UNPACK *unpack, _unpack; - WT_DECL_RET; btree = S2BT(session); bm = btree->bm; @@ -250,7 +249,7 @@ __wt_ovfl_discard(WT_SESSION_IMPL *session, WT_CELL *cell) * Acquire the overflow lock to avoid racing with a thread reading the * backing overflow blocks. */ - WT_RET(__wt_writelock(session, btree->ovfl_lock)); + __wt_writelock(session, btree->ovfl_lock); switch (unpack->raw) { case WT_CELL_KEY_OVFL: @@ -264,10 +263,8 @@ __wt_ovfl_discard(WT_SESSION_IMPL *session, WT_CELL *cell) WT_ILLEGAL_VALUE(session); } - WT_TRET(__wt_writeunlock(session, btree->ovfl_lock)); + __wt_writeunlock(session, btree->ovfl_lock); /* Free the backing disk blocks. */ - WT_TRET(bm->free(bm, session, unpack->data, unpack->size)); - - return (ret); + return (bm->free(bm, session, unpack->data, unpack->size)); } diff --git a/src/third_party/wiredtiger/src/btree/bt_read.c b/src/third_party/wiredtiger/src/btree/bt_read.c index 3d396d5ae5b..fd9c371f8c3 100644 --- a/src/third_party/wiredtiger/src/btree/bt_read.c +++ b/src/third_party/wiredtiger/src/btree/bt_read.c @@ -319,14 +319,22 @@ __evict_force_check(WT_SESSION_IMPL *session, WT_REF *ref) /* Pages are usually small enough, check that first. */ if (page->memory_footprint < btree->splitmempage) return (false); - else if (page->memory_footprint < btree->maxmempage) + + /* + * If this session has more than one hazard pointer, eviction will fail + * and there is no point trying. + */ + if (__wt_hazard_count(session, page) > 1) + return (false); + + if (page->memory_footprint < btree->maxmempage) return (__wt_leaf_page_can_split(session, page)); /* Trigger eviction on the next page release. */ - (void)__wt_page_evict_soon(session, ref); + __wt_page_evict_soon(session, ref); /* Bump the oldest ID, we're about to do some visibility checks. */ - (void)__wt_txn_update_oldest(session, 0); + WT_IGNORE_RET(__wt_txn_update_oldest(session, 0)); /* If eviction cannot succeed, don't try. */ return (__wt_page_can_evict(session, ref, NULL)); @@ -599,14 +607,7 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags page = ref->page; if (page->read_gen == WT_READGEN_NOTSET) { if (evict_soon) - /* - * Ignore error returns, since the - * evict soon call is advisory and we - * are holding a hazard pointer to the - * page already. - */ - (void)__wt_page_evict_soon( - session, ref); + __wt_page_evict_soon(session, ref); else __wt_cache_read_gen_new(session, page); } else if (!LF_ISSET(WT_READ_NO_GEN)) diff --git a/src/third_party/wiredtiger/src/btree/bt_rebalance.c b/src/third_party/wiredtiger/src/btree/bt_rebalance.c index de54e8433a8..29380459b94 100644 --- a/src/third_party/wiredtiger/src/btree/bt_rebalance.c +++ b/src/third_party/wiredtiger/src/btree/bt_rebalance.c @@ -65,10 +65,10 @@ __rebalance_leaf_append(WT_SESSION_IMPL *session, WT_ADDR *copy_addr; WT_REF *copy; - WT_RET(__wt_verbose(session, WT_VERB_REBALANCE, + __wt_verbose(session, WT_VERB_REBALANCE, "rebalance leaf-list append %s, %s", __wt_buf_set_printable(session, key, key_len, rs->tmp2), - __wt_addr_string(session, addr, addr_len, rs->tmp1))); + __wt_addr_string(session, addr, addr_len, rs->tmp1)); /* Allocate and initialize a new leaf page reference. */ WT_RET(__wt_realloc_def( @@ -179,10 +179,10 @@ __rebalance_free_original(WT_SESSION_IMPL *session, WT_REBALANCE_STUFF *rs) for (i = 0; i < rs->fl_next; ++i) { addr = &rs->fl[i]; - WT_RET(__wt_verbose(session, WT_VERB_REBALANCE, + __wt_verbose(session, WT_VERB_REBALANCE, "rebalance discarding %s", __wt_addr_string( - session, addr->addr, addr->size, rs->tmp1))); + session, addr->addr, addr->size, rs->tmp1)); WT_RET(__wt_btree_block_free(session, addr->addr, addr->size)); } @@ -225,10 +225,10 @@ __rebalance_col_walk( WT_ERR(__wt_bt_read( session, buf, unpack.data, unpack.size)); WT_ERR(__rebalance_col_walk(session, buf->data, rs)); - WT_ERR(__wt_verbose(session, WT_VERB_REBALANCE, + __wt_verbose(session, WT_VERB_REBALANCE, "free-list append internal page: %s", __wt_addr_string( - session, unpack.data, unpack.size, rs->tmp1))); + session, unpack.data, unpack.size, rs->tmp1)); WT_ERR(__rebalance_fl_append( session, unpack.data, unpack.size, rs)); break; @@ -321,10 +321,10 @@ __rebalance_row_walk( * that's more work to get reconciliation to understand * and overflow keys are (well, should be), uncommon. */ - WT_ERR(__wt_verbose(session, WT_VERB_REBALANCE, + __wt_verbose(session, WT_VERB_REBALANCE, "free-list append overflow key: %s", __wt_addr_string( - session, unpack.data, unpack.size, rs->tmp1))); + session, unpack.data, unpack.size, rs->tmp1)); WT_ERR(__rebalance_fl_append( session, unpack.data, unpack.size, rs)); @@ -342,10 +342,10 @@ __rebalance_row_walk( break; case WT_CELL_ADDR_INT: /* An internal page, schedule its blocks to be freed. */ - WT_ERR(__wt_verbose(session, WT_VERB_REBALANCE, + __wt_verbose(session, WT_VERB_REBALANCE, "free-list append internal page: %s", __wt_addr_string( - session, unpack.data, unpack.size, rs->tmp1))); + session, unpack.data, unpack.size, rs->tmp1)); WT_ERR(__rebalance_fl_append( session, unpack.data, unpack.size, rs)); diff --git a/src/third_party/wiredtiger/src/btree/bt_slvg.c b/src/third_party/wiredtiger/src/btree/bt_slvg.c index 9b5e4daf74a..831e58b91bd 100644 --- a/src/third_party/wiredtiger/src/btree/bt_slvg.c +++ b/src/third_party/wiredtiger/src/btree/bt_slvg.c @@ -431,10 +431,10 @@ __slvg_read(WT_SESSION_IMPL *session, WT_STUFF *ss) case WT_PAGE_BLOCK_MANAGER: case WT_PAGE_COL_INT: case WT_PAGE_ROW_INT: - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s page ignored %s", __wt_page_type_string(dsk->type), - (const char *)as->data)); + (const char *)as->data); WT_ERR(bm->free(bm, session, addr, addr_size)); continue; } @@ -449,18 +449,18 @@ __slvg_read(WT_SESSION_IMPL *session, WT_STUFF *ss) * discard these pages now. */ if (__wt_verify_dsk(session, as->data, buf) != 0) { - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s page failed verify %s", __wt_page_type_string(dsk->type), - (const char *)as->data)); + (const char *)as->data); WT_ERR(bm->free(bm, session, addr, addr_size)); continue; } - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "tracking %s page, generation %" PRIu64 " %s", __wt_page_type_string(dsk->type), dsk->write_gen, - (const char *)as->data)); + (const char *)as->data); switch (dsk->type) { case WT_PAGE_COL_FIX: @@ -562,11 +562,11 @@ __slvg_trk_leaf(WT_SESSION_IMPL *session, trk->col_start = dsk->recno; trk->col_stop = dsk->recno + (dsk->u.entries - 1); - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s records %" PRIu64 "-%" PRIu64, __wt_addr_string( session, trk->trk_addr, trk->trk_addr_size, ss->tmp1), - trk->col_start, trk->col_stop)); + trk->col_start, trk->col_stop); break; case WT_PAGE_COL_VAR: /* @@ -583,11 +583,11 @@ __slvg_trk_leaf(WT_SESSION_IMPL *session, trk->col_start = dsk->recno; trk->col_stop = stop_recno - 1; - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s records %" PRIu64 "-%" PRIu64, __wt_addr_string( session, trk->trk_addr, trk->trk_addr_size, ss->tmp1), - trk->col_start, trk->col_stop)); + trk->col_start, trk->col_stop); /* Column-store pages can contain overflow items. */ WT_ERR(__slvg_trk_leaf_ovfl(session, dsk, trk)); @@ -607,18 +607,18 @@ __slvg_trk_leaf(WT_SESSION_IMPL *session, WT_ERR(__wt_row_leaf_key_copy(session, page, &page->pg_row_d[page->pg_row_entries - 1], &trk->row_stop)); - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s start key %s", __wt_addr_string(session, trk->trk_addr, trk->trk_addr_size, ss->tmp1), __wt_buf_set_printable(session, - trk->row_start.data, trk->row_start.size, ss->tmp2))); - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + trk->row_start.data, trk->row_start.size, ss->tmp2)); + __wt_verbose(session, WT_VERB_SALVAGE, "%s stop key %s", __wt_addr_string(session, trk->trk_addr, trk->trk_addr_size, ss->tmp1), __wt_buf_set_printable(session, - trk->row_stop.data, trk->row_stop.size, ss->tmp2))); + trk->row_stop.data, trk->row_stop.size, ss->tmp2)); /* Row-store pages can contain overflow items. */ WT_ERR(__slvg_trk_leaf_ovfl(session, dsk, trk)); @@ -700,12 +700,12 @@ __slvg_trk_leaf_ovfl( trk->trk_ovfl_addr[ovfl_cnt].size = (uint8_t)unpack->size; - WT_RET(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s overflow reference %s", __wt_addr_string(session, trk->trk_addr, trk->trk_addr_size, trk->ss->tmp1), __wt_addr_string(session, - unpack->data, unpack->size, trk->ss->tmp2))); + unpack->data, unpack->size, trk->ss->tmp2)); if (++ovfl_cnt == trk->trk_ovfl_cnt) break; @@ -871,12 +871,12 @@ __slvg_col_range_overlap( a_trk = ss->pages[a_slot]; b_trk = ss->pages[b_slot]; - WT_RET(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s and %s range overlap", __wt_addr_string( session, a_trk->trk_addr, a_trk->trk_addr_size, ss->tmp1), __wt_addr_string( - session, b_trk->trk_addr, b_trk->trk_addr_size, ss->tmp2))); + session, b_trk->trk_addr, b_trk->trk_addr_size, ss->tmp2)); /* * The key ranges of two WT_TRACK pages in the array overlap -- choose @@ -1053,12 +1053,12 @@ delete_b: /* F_SET(new, WT_TRACK_MERGE); F_SET(a_trk, WT_TRACK_MERGE); -merge: WT_RET(__wt_verbose(session, WT_VERB_SALVAGE, +merge: __wt_verbose(session, WT_VERB_SALVAGE, "%s and %s require merge", __wt_addr_string( session, a_trk->trk_addr, a_trk->trk_addr_size, ss->tmp1), __wt_addr_string( - session, b_trk->trk_addr, b_trk->trk_addr_size, ss->tmp2))); + session, b_trk->trk_addr, b_trk->trk_addr_size, ss->tmp2)); return (0); } @@ -1118,12 +1118,12 @@ __slvg_col_range_missing(WT_SESSION_IMPL *session, WT_STUFF *ss) if ((trk = ss->pages[i]) == NULL) continue; if (trk->col_start != r + 1) { - WT_RET(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s column-store missing range from %" PRIu64 " to %" PRIu64 " inclusive", __wt_addr_string(session, trk->trk_addr, trk->trk_addr_size, ss->tmp1), - r + 1, trk->col_start - 1)); + r + 1, trk->col_start - 1); /* * We need to instantiate deleted items for the missing @@ -1259,12 +1259,12 @@ __slvg_col_build_leaf(WT_SESSION_IMPL *session, WT_TRACK *trk, WT_REF *ref) cookie->skip = skip = trk->col_start - recno; cookie->take = take = (trk->col_stop - trk->col_start) + 1; - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s merge discarding first %" PRIu64 " records, " "then taking %" PRIu64 " records", __wt_addr_string( session, trk->trk_addr, trk->trk_addr_size, trk->ss->tmp1), - skip, take)); + skip, take); /* Set the referenced flag on overflow pages we're using. */ if (page->type == WT_PAGE_COL_VAR && trk->trk_ovfl_cnt != 0) @@ -1281,11 +1281,11 @@ __slvg_col_build_leaf(WT_SESSION_IMPL *session, WT_TRACK *trk, WT_REF *ref) ref->ref_recno = trk->col_missing; cookie->missing = trk->col_start - trk->col_missing; - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s merge inserting %" PRIu64 " missing records", __wt_addr_string( session, trk->trk_addr, trk->trk_addr_size, trk->ss->tmp1), - cookie->missing)); + cookie->missing); } /* @@ -1501,12 +1501,12 @@ __slvg_row_range_overlap( a_trk = ss->pages[a_slot]; b_trk = ss->pages[b_slot]; - WT_RET(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s and %s range overlap", __wt_addr_string( session, a_trk->trk_addr, a_trk->trk_addr_size, ss->tmp1), __wt_addr_string( - session, b_trk->trk_addr, b_trk->trk_addr_size, ss->tmp2))); + session, b_trk->trk_addr, b_trk->trk_addr_size, ss->tmp2)); /* * The key ranges of two WT_TRACK pages in the array overlap -- choose @@ -1698,12 +1698,12 @@ delete_b: /* F_SET(new, WT_TRACK_MERGE); F_SET(a_trk, WT_TRACK_MERGE); -merge: WT_RET(__wt_verbose(session, WT_VERB_SALVAGE, +merge: __wt_verbose(session, WT_VERB_SALVAGE, "%s and %s require merge", __wt_addr_string( session, a_trk->trk_addr, a_trk->trk_addr_size, ss->tmp1), __wt_addr_string( - session, b_trk->trk_addr, b_trk->trk_addr_size, ss->tmp2))); + session, b_trk->trk_addr, b_trk->trk_addr_size, ss->tmp2)); return (0); } @@ -1942,12 +1942,12 @@ __slvg_row_build_leaf( btree->collator, key, &trk->row_start, &cmp)); if (cmp >= 0) break; - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s merge discarding leading key %.*s", __wt_addr_string(session, trk->trk_addr, trk->trk_addr_size, ss->tmp1), __wt_buf_set_printable( - session, key->data, key->size, ss->tmp2))); + session, key->data, key->size, ss->tmp2)); ++skip_start; } if (F_ISSET(trk, WT_TRACK_CHECK_STOP)) @@ -1962,12 +1962,12 @@ __slvg_row_build_leaf( btree->collator, key, &trk->row_stop, &cmp)); if (cmp < 0) break; - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s merge discarding trailing key %.*s", __wt_addr_string(session, trk->trk_addr, trk->trk_addr_size, ss->tmp1), __wt_buf_set_printable( - session, key->data, key->size, ss->tmp2))); + session, key->data, key->size, ss->tmp2)); ++skip_stop; } @@ -2204,12 +2204,12 @@ __slvg_ovfl_reconcile(WT_SESSION_IMPL *session, WT_STUFF *ss) continue; } - WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s references unavailable overflow page %s", __wt_addr_string(session, trk->trk_addr, trk->trk_addr_size, ss->tmp1), __wt_addr_string(session, - addr->addr, addr->size, ss->tmp2))); + addr->addr, addr->size, ss->tmp2)); /* * Clear the "referenced" flag for any overflow pages @@ -2405,10 +2405,10 @@ __slvg_ovfl_discard(WT_SESSION_IMPL *session, WT_STUFF *ss) F_CLR(trk, WT_TRACK_OVFL_REFD); continue; } - WT_RET(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s unused overflow page", __wt_addr_string( - session, trk->trk_addr, trk->trk_addr_size, ss->tmp1))); + session, trk->trk_addr, trk->trk_addr_size, ss->tmp1)); WT_RET(__slvg_trk_free(session, &ss->ovfl[i], true)); } @@ -2470,10 +2470,10 @@ __slvg_trk_free_block(WT_SESSION_IMPL *session, WT_TRACK *trk) * If freeing underlying file blocks or overflow pages, this is a page * we were tracking but eventually decided not to use. */ - WT_RET(__wt_verbose(session, WT_VERB_SALVAGE, + __wt_verbose(session, WT_VERB_SALVAGE, "%s blocks discarded: discard freed file bytes %" PRIu32, __wt_addr_string(session, - trk->trk_addr, trk->trk_addr_size, trk->ss->tmp1), trk->trk_size)); + trk->trk_addr, trk->trk_addr_size, trk->ss->tmp1), trk->trk_size); return (bm->free(bm, session, trk->trk_addr, trk->trk_addr_size)); } diff --git a/src/third_party/wiredtiger/src/btree/bt_split.c b/src/third_party/wiredtiger/src/btree/bt_split.c index 4f6f300802e..700c2f3b192 100644 --- a/src/third_party/wiredtiger/src/btree/bt_split.c +++ b/src/third_party/wiredtiger/src/btree/bt_split.c @@ -577,10 +577,10 @@ __split_root(WT_SESSION_IMPL *session, WT_PAGE *root) chunk = pindex->entries / children; remain = pindex->entries - chunk * (children - 1); - WT_ERR(__wt_verbose(session, WT_VERB_SPLIT, + __wt_verbose(session, WT_VERB_SPLIT, "%p: %" PRIu32 " root page elements, splitting into %" PRIu32 " children", - root, pindex->entries, children)); + root, pindex->entries, children); /* * Allocate a new WT_PAGE_INDEX and set of WT_REF objects to be inserted @@ -795,7 +795,7 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref, WT_REF **ref_new, if (result_entries == 0) { empty_parent = true; if (!__wt_ref_is_root(parent->pg_intl_parent_ref)) - ret = __wt_page_evict_soon( + __wt_page_evict_soon( session, parent->pg_intl_parent_ref); goto err; } @@ -888,17 +888,17 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref, WT_REF **ref_new, */ if (ref->page == NULL) - WT_ERR(__wt_verbose(session, WT_VERB_SPLIT, + __wt_verbose(session, WT_VERB_SPLIT, "%p: reverse split into parent %p, %" PRIu32 " -> %" PRIu32 " (-%" PRIu32 ")", ref->page, parent, parent_entries, result_entries, - parent_entries - result_entries)); + parent_entries - result_entries); else - WT_ERR(__wt_verbose(session, WT_VERB_SPLIT, + __wt_verbose(session, WT_VERB_SPLIT, "%p: split into parent %p, %" PRIu32 " -> %" PRIu32 " (+%" PRIu32 ")", ref->page, parent, parent_entries, result_entries, - result_entries - parent_entries)); + result_entries - parent_entries); /* * The new page index is in place, free the WT_REF we were splitting and @@ -1060,10 +1060,10 @@ __split_internal(WT_SESSION_IMPL *session, WT_PAGE *parent, WT_PAGE *page) chunk = pindex->entries / children; remain = pindex->entries - chunk * (children - 1); - WT_ERR(__wt_verbose(session, WT_VERB_SPLIT, + __wt_verbose(session, WT_VERB_SPLIT, "%p: %" PRIu32 " internal page elements, splitting %" PRIu32 " children into parent %p", - page, pindex->entries, children, parent)); + page, pindex->entries, children, parent); /* * Ideally, we'd discard the original page, but that's hard since other @@ -1287,12 +1287,12 @@ __split_internal_lock(WT_SESSION_IMPL *session, WT_REF *ref, bool trylock, return (EBUSY); if (trylock) - WT_RET(__wt_fair_trylock(session, &parent->page_lock)); + WT_RET(__wt_try_writelock(session, &parent->page_lock)); else - WT_RET(__wt_fair_lock(session, &parent->page_lock)); + __wt_writelock(session, &parent->page_lock); if (parent == ref->home) break; - WT_RET(__wt_fair_unlock(session, &parent->page_lock)); + __wt_writeunlock(session, &parent->page_lock); } /* @@ -1315,7 +1315,7 @@ __split_internal_lock(WT_SESSION_IMPL *session, WT_REF *ref, bool trylock, *parentp = parent; return (0); -err: WT_TRET(__wt_fair_unlock(session, &parent->page_lock)); +err: __wt_writeunlock(session, &parent->page_lock); return (ret); } @@ -1331,7 +1331,7 @@ __split_internal_unlock(WT_SESSION_IMPL *session, WT_PAGE *parent, bool hazard) if (hazard) ret = __wt_hazard_clear(session, parent); - WT_TRET(__wt_fair_unlock(session, &parent->page_lock)); + __wt_writeunlock(session, &parent->page_lock); return (ret); } @@ -2077,8 +2077,7 @@ __wt_split_insert(WT_SESSION_IMPL *session, WT_REF *ref) WT_PAGE *parent; bool hazard; - WT_RET(__wt_verbose( - session, WT_VERB_SPLIT, "%p: split-insert", ref->page)); + __wt_verbose(session, WT_VERB_SPLIT, "%p: split-insert", ref->page); WT_RET(__split_internal_lock(session, ref, true, &parent, &hazard)); if ((ret = __split_insert(session, ref)) != 0) { @@ -2169,8 +2168,7 @@ __wt_split_multi(WT_SESSION_IMPL *session, WT_REF *ref, int closing) WT_PAGE *parent; bool hazard; - WT_RET(__wt_verbose( - session, WT_VERB_SPLIT, "%p: split-multi", ref->page)); + __wt_verbose(session, WT_VERB_SPLIT, "%p: split-multi", ref->page); WT_RET(__split_internal_lock(session, ref, false, &parent, &hazard)); if ((ret = __split_multi(session, ref, closing)) != 0 || closing) { @@ -2198,8 +2196,7 @@ __wt_split_reverse(WT_SESSION_IMPL *session, WT_REF *ref) WT_PAGE *parent; bool hazard; - WT_RET(__wt_verbose( - session, WT_VERB_SPLIT, "%p: reverse-split", ref->page)); + __wt_verbose(session, WT_VERB_SPLIT, "%p: reverse-split", ref->page); WT_RET(__split_internal_lock(session, ref, false, &parent, &hazard)); ret = __split_parent(session, ref, NULL, 0, 0, false, true); @@ -2220,8 +2217,7 @@ __wt_split_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, WT_MULTI *multi) page = ref->page; - WT_RET(__wt_verbose( - session, WT_VERB_SPLIT, "%p: split-rewrite", ref->page)); + __wt_verbose(session, WT_VERB_SPLIT, "%p: split-rewrite", ref->page); /* * This isn't a split: a reconciliation failed because we couldn't write diff --git a/src/third_party/wiredtiger/src/btree/bt_sync.c b/src/third_party/wiredtiger/src/btree/bt_sync.c index df794c96cda..b41179a565d 100644 --- a/src/third_party/wiredtiger/src/btree/bt_sync.c +++ b/src/third_party/wiredtiger/src/btree/bt_sync.c @@ -206,7 +206,7 @@ __sync_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop) if (WT_VERBOSE_ISSET(session, WT_VERB_CHECKPOINT)) { WT_ERR(__wt_epoch(session, &end)); - WT_ERR(__wt_verbose(session, WT_VERB_CHECKPOINT, + __wt_verbose(session, WT_VERB_CHECKPOINT, "__sync_file WT_SYNC_%s wrote:\n\t %" PRIu64 " bytes, %" PRIu64 " pages of leaves\n\t %" PRIu64 " bytes, %" PRIu64 " pages of internal\n\t" @@ -214,7 +214,7 @@ __sync_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop) syncop == WT_SYNC_WRITE_LEAVES ? "WRITE_LEAVES" : "CHECKPOINT", leaf_bytes, leaf_pages, internal_bytes, internal_pages, - WT_TIMEDIFF_MS(end, start))); + WT_TIMEDIFF_MS(end, start)); } err: /* On error, clear any left-over tree walk. */ diff --git a/src/third_party/wiredtiger/src/btree/bt_vrfy.c b/src/third_party/wiredtiger/src/btree/bt_vrfy.c index 0a04c387a0f..76817cef7cd 100644 --- a/src/third_party/wiredtiger/src/btree/bt_vrfy.c +++ b/src/third_party/wiredtiger/src/btree/bt_vrfy.c @@ -195,8 +195,8 @@ __wt_verify(WT_SESSION_IMPL *session, const char *cfg[]) /* Loop through the file's checkpoints, verifying each one. */ WT_CKPT_FOREACH(ckptbase, ckpt) { - WT_ERR(__wt_verbose(session, WT_VERB_VERIFY, - "%s: checkpoint %s", btree->dhandle->name, ckpt->name)); + __wt_verbose(session, WT_VERB_VERIFY, + "%s: checkpoint %s", btree->dhandle->name, ckpt->name); /* Fake checkpoints require no work. */ if (F_ISSET(ckpt, WT_CKPT_FAKE)) @@ -312,9 +312,9 @@ __verify_tree(WT_SESSION_IMPL *session, WT_REF *ref, WT_VSTUFF *vs) unpack = &_unpack; WT_CLEAR(*unpack); /* -Wuninitialized */ - WT_RET(__wt_verbose(session, WT_VERB_VERIFY, "%s %s", + __wt_verbose(session, WT_VERB_VERIFY, "%s %s", __wt_page_addr_string(session, ref, vs->tmp1), - __wt_page_type_string(page->type))); + __wt_page_type_string(page->type)); /* Optionally dump the address. */ if (vs->dump_address) diff --git a/src/third_party/wiredtiger/src/btree/bt_walk.c b/src/third_party/wiredtiger/src/btree/bt_walk.c index 17d32d6ed63..dc1cf4e7f98 100644 --- a/src/third_party/wiredtiger/src/btree/bt_walk.c +++ b/src/third_party/wiredtiger/src/btree/bt_walk.c @@ -399,7 +399,7 @@ restart: /* * eviction. */ if (empty_internal && pindex->entries > 1) { - WT_ERR(__wt_page_evict_soon(session, ref)); + __wt_page_evict_soon(session, ref); empty_internal = false; } diff --git a/src/third_party/wiredtiger/src/btree/row_key.c b/src/third_party/wiredtiger/src/btree/row_key.c index 83fd2dad9e4..99ee34a6c5d 100644 --- a/src/third_party/wiredtiger/src/btree/row_key.c +++ b/src/third_party/wiredtiger/src/btree/row_key.c @@ -282,8 +282,7 @@ switch_and_jump: /* Switching to a forward roll. */ * the tracking cache. */ if (slot_offset == 0) { - WT_ERR( - __wt_readlock(session, btree->ovfl_lock)); + __wt_readlock(session, btree->ovfl_lock); copy = WT_ROW_KEY_COPY(rip); if (!__wt_row_leaf_key_info(page, copy, NULL, &cell, &keyb->data, &keyb->size)) { @@ -291,8 +290,7 @@ switch_and_jump: /* Switching to a forward roll. */ ret = __wt_dsk_cell_data_ref(session, WT_PAGE_ROW_LEAF, unpack, keyb); } - WT_TRET( - __wt_readunlock(session, btree->ovfl_lock)); + __wt_readunlock(session, btree->ovfl_lock); WT_ERR(ret); break; } diff --git a/src/third_party/wiredtiger/src/btree/row_modify.c b/src/third_party/wiredtiger/src/btree/row_modify.c index f0424ff93b4..f37c77d284f 100644 --- a/src/third_party/wiredtiger/src/btree/row_modify.c +++ b/src/third_party/wiredtiger/src/btree/row_modify.c @@ -279,7 +279,8 @@ __wt_update_alloc( WT_UPDATE_DELETED_SET(*updp); else { (*updp)->size = WT_STORE_SIZE(size); - memcpy(WT_UPDATE_DATA(*updp), value->data, size); + if (size != 0) + memcpy(WT_UPDATE_DATA(*updp), value->data, size); } *sizep = WT_UPDATE_MEMSIZE(*updp); diff --git a/src/third_party/wiredtiger/src/btree/row_srch.c b/src/third_party/wiredtiger/src/btree/row_srch.c index 0f70e84de7e..d4e82c458d4 100644 --- a/src/third_party/wiredtiger/src/btree/row_srch.c +++ b/src/third_party/wiredtiger/src/btree/row_srch.c @@ -775,7 +775,7 @@ __wt_row_random_leaf(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) * traversing the skip list each time accumulates to real time. */ if (samples > 5000) - WT_RET(__wt_page_evict_soon(session, cbt->ref)); + __wt_page_evict_soon(session, cbt->ref); return (0); } diff --git a/src/third_party/wiredtiger/src/checksum/power8/crc32_wrapper.c b/src/third_party/wiredtiger/src/checksum/power8/crc32_wrapper.c index 62bd3e64f5c..cbfe1ab90f5 100644 --- a/src/third_party/wiredtiger/src/checksum/power8/crc32_wrapper.c +++ b/src/third_party/wiredtiger/src/checksum/power8/crc32_wrapper.c @@ -6,7 +6,7 @@ #define VMX_ALIGN_MASK (VMX_ALIGN-1) #ifdef REFLECT -static unsigned int crc32_align(unsigned int crc, unsigned char *p, +static unsigned int crc32_align(unsigned int crc, const unsigned char *p, unsigned long len) { while (len--) @@ -14,7 +14,7 @@ static unsigned int crc32_align(unsigned int crc, unsigned char *p, return crc; } #else -static unsigned int crc32_align(unsigned int crc, unsigned char *p, +static unsigned int crc32_align(unsigned int crc, const unsigned char *p, unsigned long len) { while (len--) @@ -23,13 +23,13 @@ static unsigned int crc32_align(unsigned int crc, unsigned char *p, } #endif -unsigned int __crc32_vpmsum(unsigned int crc, unsigned char *p, +unsigned int __crc32_vpmsum(unsigned int crc, const unsigned char *p, unsigned long len); /* -Werror=missing-prototypes */ -unsigned int crc32_vpmsum(unsigned int crc, unsigned char *p, +unsigned int crc32_vpmsum(unsigned int crc, const unsigned char *p, unsigned long len); -unsigned int crc32_vpmsum(unsigned int crc, unsigned char *p, +unsigned int crc32_vpmsum(unsigned int crc, const unsigned char *p, unsigned long len) { unsigned int prealign; @@ -67,3 +67,25 @@ out: return crc; } #endif + +#include "wt_internal.h" + +/* + * __wt_cksum -- + * WiredTiger: return a checksum for a chunk of memory. + */ +uint32_t +__wt_cksum(const void *chunk, size_t len) +{ + return crc32_vpmsum(0, chunk, len); +} + +/* + * __wt_cksum_init -- + * WiredTiger: detect CRC hardware and set the checksum function. + */ +void +__wt_cksum_init(void) +{ + /* None needed. */ +} diff --git a/src/third_party/wiredtiger/src/checksum/x86/checksum.c b/src/third_party/wiredtiger/src/checksum/x86/checksum.c new file mode 100644 index 00000000000..8a8c735cfc8 --- /dev/null +++ b/src/third_party/wiredtiger/src/checksum/x86/checksum.c @@ -0,0 +1,1307 @@ +/*- + * Public Domain 2014-2016 MongoDB, Inc. + * Public Domain 2008-2014 WiredTiger, Inc. + * + * This is free and unencumbered software released into the public domain. + * + * Anyone is free to copy, modify, publish, use, compile, sell, or + * distribute this software, either in source code form or as a compiled + * binary, for any purpose, commercial or non-commercial, and by any + * means. + * + * In jurisdictions that recognize copyright laws, the author or authors + * of this software dedicate any and all copyright interest in the + * software to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * software under copyright law. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +/* + * Slicing-by-8 algorithm by Michael E. Kounavis and Frank L. Berry, described + * in "Novel Table Lookup-Based Algorithms for High-Performance CRC Generation", + * IEEE Transactions on Computers, Volume 57 Issue 11, November 2008. + * + * See also Peter Kanowski's posting: + * http://www.strchr.com/crc32_popcnt + * + * The big endian version calculates the same result at each step, except the + * value of the crc is byte reversed from what it would be at that step for + * little endian. + */ + +#include "wt_internal.h" + +/* + * This file contains two implementations for computing CRC: one that uses + * hardware CRC instructions, available on newer x86_64/amd64, and one that uses + * a fast software algorithm. __wt_cksum() provides a common entry point that + * indirects to one of these two methods. + */ +static uint32_t (*__wt_cksum_func)(const void *chunk, size_t len); + +/* + * The CRC slicing tables are used by __wt_cksum_sw. + */ +static const uint32_t g_crc_slicing[8][256] = { +#ifdef WORDS_BIGENDIAN + /* + * Big endian tables have entries that are byte reversed from little + * endian tables. + */ + { + 0x00000000, 0x03836bf2, 0xf7703be1, 0xf4f35013, + 0x1f979ac7, 0x1c14f135, 0xe8e7a126, 0xeb64cad4, + 0xcf58d98a, 0xccdbb278, 0x3828e26b, 0x3bab8999, + 0xd0cf434d, 0xd34c28bf, 0x27bf78ac, 0x243c135e, + 0x6fc75e10, 0x6c4435e2, 0x98b765f1, 0x9b340e03, + 0x7050c4d7, 0x73d3af25, 0x8720ff36, 0x84a394c4, + 0xa09f879a, 0xa31cec68, 0x57efbc7b, 0x546cd789, + 0xbf081d5d, 0xbc8b76af, 0x487826bc, 0x4bfb4d4e, + 0xde8ebd20, 0xdd0dd6d2, 0x29fe86c1, 0x2a7ded33, + 0xc11927e7, 0xc29a4c15, 0x36691c06, 0x35ea77f4, + 0x11d664aa, 0x12550f58, 0xe6a65f4b, 0xe52534b9, + 0x0e41fe6d, 0x0dc2959f, 0xf931c58c, 0xfab2ae7e, + 0xb149e330, 0xb2ca88c2, 0x4639d8d1, 0x45bab323, + 0xaede79f7, 0xad5d1205, 0x59ae4216, 0x5a2d29e4, + 0x7e113aba, 0x7d925148, 0x8961015b, 0x8ae26aa9, + 0x6186a07d, 0x6205cb8f, 0x96f69b9c, 0x9575f06e, + 0xbc1d7b41, 0xbf9e10b3, 0x4b6d40a0, 0x48ee2b52, + 0xa38ae186, 0xa0098a74, 0x54fada67, 0x5779b195, + 0x7345a2cb, 0x70c6c939, 0x8435992a, 0x87b6f2d8, + 0x6cd2380c, 0x6f5153fe, 0x9ba203ed, 0x9821681f, + 0xd3da2551, 0xd0594ea3, 0x24aa1eb0, 0x27297542, + 0xcc4dbf96, 0xcfced464, 0x3b3d8477, 0x38beef85, + 0x1c82fcdb, 0x1f019729, 0xebf2c73a, 0xe871acc8, + 0x0315661c, 0x00960dee, 0xf4655dfd, 0xf7e6360f, + 0x6293c661, 0x6110ad93, 0x95e3fd80, 0x96609672, + 0x7d045ca6, 0x7e873754, 0x8a746747, 0x89f70cb5, + 0xadcb1feb, 0xae487419, 0x5abb240a, 0x59384ff8, + 0xb25c852c, 0xb1dfeede, 0x452cbecd, 0x46afd53f, + 0x0d549871, 0x0ed7f383, 0xfa24a390, 0xf9a7c862, + 0x12c302b6, 0x11406944, 0xe5b33957, 0xe63052a5, + 0xc20c41fb, 0xc18f2a09, 0x357c7a1a, 0x36ff11e8, + 0xdd9bdb3c, 0xde18b0ce, 0x2aebe0dd, 0x29688b2f, + 0x783bf682, 0x7bb89d70, 0x8f4bcd63, 0x8cc8a691, + 0x67ac6c45, 0x642f07b7, 0x90dc57a4, 0x935f3c56, + 0xb7632f08, 0xb4e044fa, 0x401314e9, 0x43907f1b, + 0xa8f4b5cf, 0xab77de3d, 0x5f848e2e, 0x5c07e5dc, + 0x17fca892, 0x147fc360, 0xe08c9373, 0xe30ff881, + 0x086b3255, 0x0be859a7, 0xff1b09b4, 0xfc986246, + 0xd8a47118, 0xdb271aea, 0x2fd44af9, 0x2c57210b, + 0xc733ebdf, 0xc4b0802d, 0x3043d03e, 0x33c0bbcc, + 0xa6b54ba2, 0xa5362050, 0x51c57043, 0x52461bb1, + 0xb922d165, 0xbaa1ba97, 0x4e52ea84, 0x4dd18176, + 0x69ed9228, 0x6a6ef9da, 0x9e9da9c9, 0x9d1ec23b, + 0x767a08ef, 0x75f9631d, 0x810a330e, 0x828958fc, + 0xc97215b2, 0xcaf17e40, 0x3e022e53, 0x3d8145a1, + 0xd6e58f75, 0xd566e487, 0x2195b494, 0x2216df66, + 0x062acc38, 0x05a9a7ca, 0xf15af7d9, 0xf2d99c2b, + 0x19bd56ff, 0x1a3e3d0d, 0xeecd6d1e, 0xed4e06ec, + 0xc4268dc3, 0xc7a5e631, 0x3356b622, 0x30d5ddd0, + 0xdbb11704, 0xd8327cf6, 0x2cc12ce5, 0x2f424717, + 0x0b7e5449, 0x08fd3fbb, 0xfc0e6fa8, 0xff8d045a, + 0x14e9ce8e, 0x176aa57c, 0xe399f56f, 0xe01a9e9d, + 0xabe1d3d3, 0xa862b821, 0x5c91e832, 0x5f1283c0, + 0xb4764914, 0xb7f522e6, 0x430672f5, 0x40851907, + 0x64b90a59, 0x673a61ab, 0x93c931b8, 0x904a5a4a, + 0x7b2e909e, 0x78adfb6c, 0x8c5eab7f, 0x8fddc08d, + 0x1aa830e3, 0x192b5b11, 0xedd80b02, 0xee5b60f0, + 0x053faa24, 0x06bcc1d6, 0xf24f91c5, 0xf1ccfa37, + 0xd5f0e969, 0xd673829b, 0x2280d288, 0x2103b97a, + 0xca6773ae, 0xc9e4185c, 0x3d17484f, 0x3e9423bd, + 0x756f6ef3, 0x76ec0501, 0x821f5512, 0x819c3ee0, + 0x6af8f434, 0x697b9fc6, 0x9d88cfd5, 0x9e0ba427, + 0xba37b779, 0xb9b4dc8b, 0x4d478c98, 0x4ec4e76a, + 0xa5a02dbe, 0xa623464c, 0x52d0165f, 0x51537dad + },{ + 0x00000000, 0x7798a213, 0xee304527, 0x99a8e734, + 0xdc618a4e, 0xabf9285d, 0x3251cf69, 0x45c96d7a, + 0xb8c3149d, 0xcf5bb68e, 0x56f351ba, 0x216bf3a9, + 0x64a29ed3, 0x133a3cc0, 0x8a92dbf4, 0xfd0a79e7, + 0x81f1c53f, 0xf669672c, 0x6fc18018, 0x1859220b, + 0x5d904f71, 0x2a08ed62, 0xb3a00a56, 0xc438a845, + 0x3932d1a2, 0x4eaa73b1, 0xd7029485, 0xa09a3696, + 0xe5535bec, 0x92cbf9ff, 0x0b631ecb, 0x7cfbbcd8, + 0x02e38b7f, 0x757b296c, 0xecd3ce58, 0x9b4b6c4b, + 0xde820131, 0xa91aa322, 0x30b24416, 0x472ae605, + 0xba209fe2, 0xcdb83df1, 0x5410dac5, 0x238878d6, + 0x664115ac, 0x11d9b7bf, 0x8871508b, 0xffe9f298, + 0x83124e40, 0xf48aec53, 0x6d220b67, 0x1abaa974, + 0x5f73c40e, 0x28eb661d, 0xb1438129, 0xc6db233a, + 0x3bd15add, 0x4c49f8ce, 0xd5e11ffa, 0xa279bde9, + 0xe7b0d093, 0x90287280, 0x098095b4, 0x7e1837a7, + 0x04c617ff, 0x735eb5ec, 0xeaf652d8, 0x9d6ef0cb, + 0xd8a79db1, 0xaf3f3fa2, 0x3697d896, 0x410f7a85, + 0xbc050362, 0xcb9da171, 0x52354645, 0x25ade456, + 0x6064892c, 0x17fc2b3f, 0x8e54cc0b, 0xf9cc6e18, + 0x8537d2c0, 0xf2af70d3, 0x6b0797e7, 0x1c9f35f4, + 0x5956588e, 0x2ecefa9d, 0xb7661da9, 0xc0febfba, + 0x3df4c65d, 0x4a6c644e, 0xd3c4837a, 0xa45c2169, + 0xe1954c13, 0x960dee00, 0x0fa50934, 0x783dab27, + 0x06259c80, 0x71bd3e93, 0xe815d9a7, 0x9f8d7bb4, + 0xda4416ce, 0xaddcb4dd, 0x347453e9, 0x43ecf1fa, + 0xbee6881d, 0xc97e2a0e, 0x50d6cd3a, 0x274e6f29, + 0x62870253, 0x151fa040, 0x8cb74774, 0xfb2fe567, + 0x87d459bf, 0xf04cfbac, 0x69e41c98, 0x1e7cbe8b, + 0x5bb5d3f1, 0x2c2d71e2, 0xb58596d6, 0xc21d34c5, + 0x3f174d22, 0x488fef31, 0xd1270805, 0xa6bfaa16, + 0xe376c76c, 0x94ee657f, 0x0d46824b, 0x7ade2058, + 0xf9fac3fb, 0x8e6261e8, 0x17ca86dc, 0x605224cf, + 0x259b49b5, 0x5203eba6, 0xcbab0c92, 0xbc33ae81, + 0x4139d766, 0x36a17575, 0xaf099241, 0xd8913052, + 0x9d585d28, 0xeac0ff3b, 0x7368180f, 0x04f0ba1c, + 0x780b06c4, 0x0f93a4d7, 0x963b43e3, 0xe1a3e1f0, + 0xa46a8c8a, 0xd3f22e99, 0x4a5ac9ad, 0x3dc26bbe, + 0xc0c81259, 0xb750b04a, 0x2ef8577e, 0x5960f56d, + 0x1ca99817, 0x6b313a04, 0xf299dd30, 0x85017f23, + 0xfb194884, 0x8c81ea97, 0x15290da3, 0x62b1afb0, + 0x2778c2ca, 0x50e060d9, 0xc94887ed, 0xbed025fe, + 0x43da5c19, 0x3442fe0a, 0xadea193e, 0xda72bb2d, + 0x9fbbd657, 0xe8237444, 0x718b9370, 0x06133163, + 0x7ae88dbb, 0x0d702fa8, 0x94d8c89c, 0xe3406a8f, + 0xa68907f5, 0xd111a5e6, 0x48b942d2, 0x3f21e0c1, + 0xc22b9926, 0xb5b33b35, 0x2c1bdc01, 0x5b837e12, + 0x1e4a1368, 0x69d2b17b, 0xf07a564f, 0x87e2f45c, + 0xfd3cd404, 0x8aa47617, 0x130c9123, 0x64943330, + 0x215d5e4a, 0x56c5fc59, 0xcf6d1b6d, 0xb8f5b97e, + 0x45ffc099, 0x3267628a, 0xabcf85be, 0xdc5727ad, + 0x999e4ad7, 0xee06e8c4, 0x77ae0ff0, 0x0036ade3, + 0x7ccd113b, 0x0b55b328, 0x92fd541c, 0xe565f60f, + 0xa0ac9b75, 0xd7343966, 0x4e9cde52, 0x39047c41, + 0xc40e05a6, 0xb396a7b5, 0x2a3e4081, 0x5da6e292, + 0x186f8fe8, 0x6ff72dfb, 0xf65fcacf, 0x81c768dc, + 0xffdf5f7b, 0x8847fd68, 0x11ef1a5c, 0x6677b84f, + 0x23bed535, 0x54267726, 0xcd8e9012, 0xba163201, + 0x471c4be6, 0x3084e9f5, 0xa92c0ec1, 0xdeb4acd2, + 0x9b7dc1a8, 0xece563bb, 0x754d848f, 0x02d5269c, + 0x7e2e9a44, 0x09b63857, 0x901edf63, 0xe7867d70, + 0xa24f100a, 0xd5d7b219, 0x4c7f552d, 0x3be7f73e, + 0xc6ed8ed9, 0xb1752cca, 0x28ddcbfe, 0x5f4569ed, + 0x1a8c0497, 0x6d14a684, 0xf4bc41b0, 0x8324e3a3 + },{ + 0x00000000, 0x7e9241a5, 0x0d526f4f, 0x73c02eea, + 0x1aa4de9e, 0x64369f3b, 0x17f6b1d1, 0x6964f074, + 0xc53e5138, 0xbbac109d, 0xc86c3e77, 0xb6fe7fd2, + 0xdf9a8fa6, 0xa108ce03, 0xd2c8e0e9, 0xac5aa14c, + 0x8a7da270, 0xf4efe3d5, 0x872fcd3f, 0xf9bd8c9a, + 0x90d97cee, 0xee4b3d4b, 0x9d8b13a1, 0xe3195204, + 0x4f43f348, 0x31d1b2ed, 0x42119c07, 0x3c83dda2, + 0x55e72dd6, 0x2b756c73, 0x58b54299, 0x2627033c, + 0x14fb44e1, 0x6a690544, 0x19a92bae, 0x673b6a0b, + 0x0e5f9a7f, 0x70cddbda, 0x030df530, 0x7d9fb495, + 0xd1c515d9, 0xaf57547c, 0xdc977a96, 0xa2053b33, + 0xcb61cb47, 0xb5f38ae2, 0xc633a408, 0xb8a1e5ad, + 0x9e86e691, 0xe014a734, 0x93d489de, 0xed46c87b, + 0x8422380f, 0xfab079aa, 0x89705740, 0xf7e216e5, + 0x5bb8b7a9, 0x252af60c, 0x56ead8e6, 0x28789943, + 0x411c6937, 0x3f8e2892, 0x4c4e0678, 0x32dc47dd, + 0xd98065c7, 0xa7122462, 0xd4d20a88, 0xaa404b2d, + 0xc324bb59, 0xbdb6fafc, 0xce76d416, 0xb0e495b3, + 0x1cbe34ff, 0x622c755a, 0x11ec5bb0, 0x6f7e1a15, + 0x061aea61, 0x7888abc4, 0x0b48852e, 0x75dac48b, + 0x53fdc7b7, 0x2d6f8612, 0x5eafa8f8, 0x203de95d, + 0x49591929, 0x37cb588c, 0x440b7666, 0x3a9937c3, + 0x96c3968f, 0xe851d72a, 0x9b91f9c0, 0xe503b865, + 0x8c674811, 0xf2f509b4, 0x8135275e, 0xffa766fb, + 0xcd7b2126, 0xb3e96083, 0xc0294e69, 0xbebb0fcc, + 0xd7dfffb8, 0xa94dbe1d, 0xda8d90f7, 0xa41fd152, + 0x0845701e, 0x76d731bb, 0x05171f51, 0x7b855ef4, + 0x12e1ae80, 0x6c73ef25, 0x1fb3c1cf, 0x6121806a, + 0x47068356, 0x3994c2f3, 0x4a54ec19, 0x34c6adbc, + 0x5da25dc8, 0x23301c6d, 0x50f03287, 0x2e627322, + 0x8238d26e, 0xfcaa93cb, 0x8f6abd21, 0xf1f8fc84, + 0x989c0cf0, 0xe60e4d55, 0x95ce63bf, 0xeb5c221a, + 0x4377278b, 0x3de5662e, 0x4e2548c4, 0x30b70961, + 0x59d3f915, 0x2741b8b0, 0x5481965a, 0x2a13d7ff, + 0x864976b3, 0xf8db3716, 0x8b1b19fc, 0xf5895859, + 0x9ceda82d, 0xe27fe988, 0x91bfc762, 0xef2d86c7, + 0xc90a85fb, 0xb798c45e, 0xc458eab4, 0xbacaab11, + 0xd3ae5b65, 0xad3c1ac0, 0xdefc342a, 0xa06e758f, + 0x0c34d4c3, 0x72a69566, 0x0166bb8c, 0x7ff4fa29, + 0x16900a5d, 0x68024bf8, 0x1bc26512, 0x655024b7, + 0x578c636a, 0x291e22cf, 0x5ade0c25, 0x244c4d80, + 0x4d28bdf4, 0x33bafc51, 0x407ad2bb, 0x3ee8931e, + 0x92b23252, 0xec2073f7, 0x9fe05d1d, 0xe1721cb8, + 0x8816eccc, 0xf684ad69, 0x85448383, 0xfbd6c226, + 0xddf1c11a, 0xa36380bf, 0xd0a3ae55, 0xae31eff0, + 0xc7551f84, 0xb9c75e21, 0xca0770cb, 0xb495316e, + 0x18cf9022, 0x665dd187, 0x159dff6d, 0x6b0fbec8, + 0x026b4ebc, 0x7cf90f19, 0x0f3921f3, 0x71ab6056, + 0x9af7424c, 0xe46503e9, 0x97a52d03, 0xe9376ca6, + 0x80539cd2, 0xfec1dd77, 0x8d01f39d, 0xf393b238, + 0x5fc91374, 0x215b52d1, 0x529b7c3b, 0x2c093d9e, + 0x456dcdea, 0x3bff8c4f, 0x483fa2a5, 0x36ade300, + 0x108ae03c, 0x6e18a199, 0x1dd88f73, 0x634aced6, + 0x0a2e3ea2, 0x74bc7f07, 0x077c51ed, 0x79ee1048, + 0xd5b4b104, 0xab26f0a1, 0xd8e6de4b, 0xa6749fee, + 0xcf106f9a, 0xb1822e3f, 0xc24200d5, 0xbcd04170, + 0x8e0c06ad, 0xf09e4708, 0x835e69e2, 0xfdcc2847, + 0x94a8d833, 0xea3a9996, 0x99fab77c, 0xe768f6d9, + 0x4b325795, 0x35a01630, 0x466038da, 0x38f2797f, + 0x5196890b, 0x2f04c8ae, 0x5cc4e644, 0x2256a7e1, + 0x0471a4dd, 0x7ae3e578, 0x0923cb92, 0x77b18a37, + 0x1ed57a43, 0x60473be6, 0x1387150c, 0x6d1554a9, + 0xc14ff5e5, 0xbfddb440, 0xcc1d9aaa, 0xb28fdb0f, + 0xdbeb2b7b, 0xa5796ade, 0xd6b94434, 0xa82b0591 + },{ + 0x00000000, 0xb8aa45dd, 0x812367bf, 0x39892262, + 0xf331227b, 0x4b9b67a6, 0x721245c4, 0xcab80019, + 0xe66344f6, 0x5ec9012b, 0x67402349, 0xdfea6694, + 0x1552668d, 0xadf82350, 0x94710132, 0x2cdb44ef, + 0x3db164e9, 0x851b2134, 0xbc920356, 0x0438468b, + 0xce804692, 0x762a034f, 0x4fa3212d, 0xf70964f0, + 0xdbd2201f, 0x637865c2, 0x5af147a0, 0xe25b027d, + 0x28e30264, 0x904947b9, 0xa9c065db, 0x116a2006, + 0x8b1425d7, 0x33be600a, 0x0a374268, 0xb29d07b5, + 0x782507ac, 0xc08f4271, 0xf9066013, 0x41ac25ce, + 0x6d776121, 0xd5dd24fc, 0xec54069e, 0x54fe4343, + 0x9e46435a, 0x26ec0687, 0x1f6524e5, 0xa7cf6138, + 0xb6a5413e, 0x0e0f04e3, 0x37862681, 0x8f2c635c, + 0x45946345, 0xfd3e2698, 0xc4b704fa, 0x7c1d4127, + 0x50c605c8, 0xe86c4015, 0xd1e56277, 0x694f27aa, + 0xa3f727b3, 0x1b5d626e, 0x22d4400c, 0x9a7e05d1, + 0xe75fa6ab, 0x5ff5e376, 0x667cc114, 0xded684c9, + 0x146e84d0, 0xacc4c10d, 0x954de36f, 0x2de7a6b2, + 0x013ce25d, 0xb996a780, 0x801f85e2, 0x38b5c03f, + 0xf20dc026, 0x4aa785fb, 0x732ea799, 0xcb84e244, + 0xdaeec242, 0x6244879f, 0x5bcda5fd, 0xe367e020, + 0x29dfe039, 0x9175a5e4, 0xa8fc8786, 0x1056c25b, + 0x3c8d86b4, 0x8427c369, 0xbdaee10b, 0x0504a4d6, + 0xcfbca4cf, 0x7716e112, 0x4e9fc370, 0xf63586ad, + 0x6c4b837c, 0xd4e1c6a1, 0xed68e4c3, 0x55c2a11e, + 0x9f7aa107, 0x27d0e4da, 0x1e59c6b8, 0xa6f38365, + 0x8a28c78a, 0x32828257, 0x0b0ba035, 0xb3a1e5e8, + 0x7919e5f1, 0xc1b3a02c, 0xf83a824e, 0x4090c793, + 0x51fae795, 0xe950a248, 0xd0d9802a, 0x6873c5f7, + 0xa2cbc5ee, 0x1a618033, 0x23e8a251, 0x9b42e78c, + 0xb799a363, 0x0f33e6be, 0x36bac4dc, 0x8e108101, + 0x44a88118, 0xfc02c4c5, 0xc58be6a7, 0x7d21a37a, + 0x3fc9a052, 0x8763e58f, 0xbeeac7ed, 0x06408230, + 0xccf88229, 0x7452c7f4, 0x4ddbe596, 0xf571a04b, + 0xd9aae4a4, 0x6100a179, 0x5889831b, 0xe023c6c6, + 0x2a9bc6df, 0x92318302, 0xabb8a160, 0x1312e4bd, + 0x0278c4bb, 0xbad28166, 0x835ba304, 0x3bf1e6d9, + 0xf149e6c0, 0x49e3a31d, 0x706a817f, 0xc8c0c4a2, + 0xe41b804d, 0x5cb1c590, 0x6538e7f2, 0xdd92a22f, + 0x172aa236, 0xaf80e7eb, 0x9609c589, 0x2ea38054, + 0xb4dd8585, 0x0c77c058, 0x35fee23a, 0x8d54a7e7, + 0x47eca7fe, 0xff46e223, 0xc6cfc041, 0x7e65859c, + 0x52bec173, 0xea1484ae, 0xd39da6cc, 0x6b37e311, + 0xa18fe308, 0x1925a6d5, 0x20ac84b7, 0x9806c16a, + 0x896ce16c, 0x31c6a4b1, 0x084f86d3, 0xb0e5c30e, + 0x7a5dc317, 0xc2f786ca, 0xfb7ea4a8, 0x43d4e175, + 0x6f0fa59a, 0xd7a5e047, 0xee2cc225, 0x568687f8, + 0x9c3e87e1, 0x2494c23c, 0x1d1de05e, 0xa5b7a583, + 0xd89606f9, 0x603c4324, 0x59b56146, 0xe11f249b, + 0x2ba72482, 0x930d615f, 0xaa84433d, 0x122e06e0, + 0x3ef5420f, 0x865f07d2, 0xbfd625b0, 0x077c606d, + 0xcdc46074, 0x756e25a9, 0x4ce707cb, 0xf44d4216, + 0xe5276210, 0x5d8d27cd, 0x640405af, 0xdcae4072, + 0x1616406b, 0xaebc05b6, 0x973527d4, 0x2f9f6209, + 0x034426e6, 0xbbee633b, 0x82674159, 0x3acd0484, + 0xf075049d, 0x48df4140, 0x71566322, 0xc9fc26ff, + 0x5382232e, 0xeb2866f3, 0xd2a14491, 0x6a0b014c, + 0xa0b30155, 0x18194488, 0x219066ea, 0x993a2337, + 0xb5e167d8, 0x0d4b2205, 0x34c20067, 0x8c6845ba, + 0x46d045a3, 0xfe7a007e, 0xc7f3221c, 0x7f5967c1, + 0x6e3347c7, 0xd699021a, 0xef102078, 0x57ba65a5, + 0x9d0265bc, 0x25a82061, 0x1c210203, 0xa48b47de, + 0x88500331, 0x30fa46ec, 0x0973648e, 0xb1d92153, + 0x7b61214a, 0xc3cb6497, 0xfa4246f5, 0x42e80328 + },{ + 0x00000000, 0xac6f1138, 0x58df2270, 0xf4b03348, + 0xb0be45e0, 0x1cd154d8, 0xe8616790, 0x440e76a8, + 0x910b67c5, 0x3d6476fd, 0xc9d445b5, 0x65bb548d, + 0x21b52225, 0x8dda331d, 0x796a0055, 0xd505116d, + 0xd361228f, 0x7f0e33b7, 0x8bbe00ff, 0x27d111c7, + 0x63df676f, 0xcfb07657, 0x3b00451f, 0x976f5427, + 0x426a454a, 0xee055472, 0x1ab5673a, 0xb6da7602, + 0xf2d400aa, 0x5ebb1192, 0xaa0b22da, 0x066433e2, + 0x57b5a81b, 0xfbdab923, 0x0f6a8a6b, 0xa3059b53, + 0xe70bedfb, 0x4b64fcc3, 0xbfd4cf8b, 0x13bbdeb3, + 0xc6becfde, 0x6ad1dee6, 0x9e61edae, 0x320efc96, + 0x76008a3e, 0xda6f9b06, 0x2edfa84e, 0x82b0b976, + 0x84d48a94, 0x28bb9bac, 0xdc0ba8e4, 0x7064b9dc, + 0x346acf74, 0x9805de4c, 0x6cb5ed04, 0xc0dafc3c, + 0x15dfed51, 0xb9b0fc69, 0x4d00cf21, 0xe16fde19, + 0xa561a8b1, 0x090eb989, 0xfdbe8ac1, 0x51d19bf9, + 0xae6a5137, 0x0205400f, 0xf6b57347, 0x5ada627f, + 0x1ed414d7, 0xb2bb05ef, 0x460b36a7, 0xea64279f, + 0x3f6136f2, 0x930e27ca, 0x67be1482, 0xcbd105ba, + 0x8fdf7312, 0x23b0622a, 0xd7005162, 0x7b6f405a, + 0x7d0b73b8, 0xd1646280, 0x25d451c8, 0x89bb40f0, + 0xcdb53658, 0x61da2760, 0x956a1428, 0x39050510, + 0xec00147d, 0x406f0545, 0xb4df360d, 0x18b02735, + 0x5cbe519d, 0xf0d140a5, 0x046173ed, 0xa80e62d5, + 0xf9dff92c, 0x55b0e814, 0xa100db5c, 0x0d6fca64, + 0x4961bccc, 0xe50eadf4, 0x11be9ebc, 0xbdd18f84, + 0x68d49ee9, 0xc4bb8fd1, 0x300bbc99, 0x9c64ada1, + 0xd86adb09, 0x7405ca31, 0x80b5f979, 0x2cdae841, + 0x2abedba3, 0x86d1ca9b, 0x7261f9d3, 0xde0ee8eb, + 0x9a009e43, 0x366f8f7b, 0xc2dfbc33, 0x6eb0ad0b, + 0xbbb5bc66, 0x17daad5e, 0xe36a9e16, 0x4f058f2e, + 0x0b0bf986, 0xa764e8be, 0x53d4dbf6, 0xffbbcace, + 0x5cd5a26e, 0xf0bab356, 0x040a801e, 0xa8659126, + 0xec6be78e, 0x4004f6b6, 0xb4b4c5fe, 0x18dbd4c6, + 0xcddec5ab, 0x61b1d493, 0x9501e7db, 0x396ef6e3, + 0x7d60804b, 0xd10f9173, 0x25bfa23b, 0x89d0b303, + 0x8fb480e1, 0x23db91d9, 0xd76ba291, 0x7b04b3a9, + 0x3f0ac501, 0x9365d439, 0x67d5e771, 0xcbbaf649, + 0x1ebfe724, 0xb2d0f61c, 0x4660c554, 0xea0fd46c, + 0xae01a2c4, 0x026eb3fc, 0xf6de80b4, 0x5ab1918c, + 0x0b600a75, 0xa70f1b4d, 0x53bf2805, 0xffd0393d, + 0xbbde4f95, 0x17b15ead, 0xe3016de5, 0x4f6e7cdd, + 0x9a6b6db0, 0x36047c88, 0xc2b44fc0, 0x6edb5ef8, + 0x2ad52850, 0x86ba3968, 0x720a0a20, 0xde651b18, + 0xd80128fa, 0x746e39c2, 0x80de0a8a, 0x2cb11bb2, + 0x68bf6d1a, 0xc4d07c22, 0x30604f6a, 0x9c0f5e52, + 0x490a4f3f, 0xe5655e07, 0x11d56d4f, 0xbdba7c77, + 0xf9b40adf, 0x55db1be7, 0xa16b28af, 0x0d043997, + 0xf2bff359, 0x5ed0e261, 0xaa60d129, 0x060fc011, + 0x4201b6b9, 0xee6ea781, 0x1ade94c9, 0xb6b185f1, + 0x63b4949c, 0xcfdb85a4, 0x3b6bb6ec, 0x9704a7d4, + 0xd30ad17c, 0x7f65c044, 0x8bd5f30c, 0x27bae234, + 0x21ded1d6, 0x8db1c0ee, 0x7901f3a6, 0xd56ee29e, + 0x91609436, 0x3d0f850e, 0xc9bfb646, 0x65d0a77e, + 0xb0d5b613, 0x1cbaa72b, 0xe80a9463, 0x4465855b, + 0x006bf3f3, 0xac04e2cb, 0x58b4d183, 0xf4dbc0bb, + 0xa50a5b42, 0x09654a7a, 0xfdd57932, 0x51ba680a, + 0x15b41ea2, 0xb9db0f9a, 0x4d6b3cd2, 0xe1042dea, + 0x34013c87, 0x986e2dbf, 0x6cde1ef7, 0xc0b10fcf, + 0x84bf7967, 0x28d0685f, 0xdc605b17, 0x700f4a2f, + 0x766b79cd, 0xda0468f5, 0x2eb45bbd, 0x82db4a85, + 0xc6d53c2d, 0x6aba2d15, 0x9e0a1e5d, 0x32650f65, + 0xe7601e08, 0x4b0f0f30, 0xbfbf3c78, 0x13d02d40, + 0x57de5be8, 0xfbb14ad0, 0x0f017998, 0xa36e68a0 + },{ + 0x00000000, 0x196b30ef, 0xc3a08cdb, 0xdacbbc34, + 0x7737f5b2, 0x6e5cc55d, 0xb4977969, 0xadfc4986, + 0x1f180660, 0x0673368f, 0xdcb88abb, 0xc5d3ba54, + 0x682ff3d2, 0x7144c33d, 0xab8f7f09, 0xb2e44fe6, + 0x3e300cc0, 0x275b3c2f, 0xfd90801b, 0xe4fbb0f4, + 0x4907f972, 0x506cc99d, 0x8aa775a9, 0x93cc4546, + 0x21280aa0, 0x38433a4f, 0xe288867b, 0xfbe3b694, + 0x561fff12, 0x4f74cffd, 0x95bf73c9, 0x8cd44326, + 0x8d16f485, 0x947dc46a, 0x4eb6785e, 0x57dd48b1, + 0xfa210137, 0xe34a31d8, 0x39818dec, 0x20eabd03, + 0x920ef2e5, 0x8b65c20a, 0x51ae7e3e, 0x48c54ed1, + 0xe5390757, 0xfc5237b8, 0x26998b8c, 0x3ff2bb63, + 0xb326f845, 0xaa4dc8aa, 0x7086749e, 0x69ed4471, + 0xc4110df7, 0xdd7a3d18, 0x07b1812c, 0x1edab1c3, + 0xac3efe25, 0xb555ceca, 0x6f9e72fe, 0x76f54211, + 0xdb090b97, 0xc2623b78, 0x18a9874c, 0x01c2b7a3, + 0xeb5b040e, 0xf23034e1, 0x28fb88d5, 0x3190b83a, + 0x9c6cf1bc, 0x8507c153, 0x5fcc7d67, 0x46a74d88, + 0xf443026e, 0xed283281, 0x37e38eb5, 0x2e88be5a, + 0x8374f7dc, 0x9a1fc733, 0x40d47b07, 0x59bf4be8, + 0xd56b08ce, 0xcc003821, 0x16cb8415, 0x0fa0b4fa, + 0xa25cfd7c, 0xbb37cd93, 0x61fc71a7, 0x78974148, + 0xca730eae, 0xd3183e41, 0x09d38275, 0x10b8b29a, + 0xbd44fb1c, 0xa42fcbf3, 0x7ee477c7, 0x678f4728, + 0x664df08b, 0x7f26c064, 0xa5ed7c50, 0xbc864cbf, + 0x117a0539, 0x081135d6, 0xd2da89e2, 0xcbb1b90d, + 0x7955f6eb, 0x603ec604, 0xbaf57a30, 0xa39e4adf, + 0x0e620359, 0x170933b6, 0xcdc28f82, 0xd4a9bf6d, + 0x587dfc4b, 0x4116cca4, 0x9bdd7090, 0x82b6407f, + 0x2f4a09f9, 0x36213916, 0xecea8522, 0xf581b5cd, + 0x4765fa2b, 0x5e0ecac4, 0x84c576f0, 0x9dae461f, + 0x30520f99, 0x29393f76, 0xf3f28342, 0xea99b3ad, + 0xd6b7081c, 0xcfdc38f3, 0x151784c7, 0x0c7cb428, + 0xa180fdae, 0xb8ebcd41, 0x62207175, 0x7b4b419a, + 0xc9af0e7c, 0xd0c43e93, 0x0a0f82a7, 0x1364b248, + 0xbe98fbce, 0xa7f3cb21, 0x7d387715, 0x645347fa, + 0xe88704dc, 0xf1ec3433, 0x2b278807, 0x324cb8e8, + 0x9fb0f16e, 0x86dbc181, 0x5c107db5, 0x457b4d5a, + 0xf79f02bc, 0xeef43253, 0x343f8e67, 0x2d54be88, + 0x80a8f70e, 0x99c3c7e1, 0x43087bd5, 0x5a634b3a, + 0x5ba1fc99, 0x42cacc76, 0x98017042, 0x816a40ad, + 0x2c96092b, 0x35fd39c4, 0xef3685f0, 0xf65db51f, + 0x44b9faf9, 0x5dd2ca16, 0x87197622, 0x9e7246cd, + 0x338e0f4b, 0x2ae53fa4, 0xf02e8390, 0xe945b37f, + 0x6591f059, 0x7cfac0b6, 0xa6317c82, 0xbf5a4c6d, + 0x12a605eb, 0x0bcd3504, 0xd1068930, 0xc86db9df, + 0x7a89f639, 0x63e2c6d6, 0xb9297ae2, 0xa0424a0d, + 0x0dbe038b, 0x14d53364, 0xce1e8f50, 0xd775bfbf, + 0x3dec0c12, 0x24873cfd, 0xfe4c80c9, 0xe727b026, + 0x4adbf9a0, 0x53b0c94f, 0x897b757b, 0x90104594, + 0x22f40a72, 0x3b9f3a9d, 0xe15486a9, 0xf83fb646, + 0x55c3ffc0, 0x4ca8cf2f, 0x9663731b, 0x8f0843f4, + 0x03dc00d2, 0x1ab7303d, 0xc07c8c09, 0xd917bce6, + 0x74ebf560, 0x6d80c58f, 0xb74b79bb, 0xae204954, + 0x1cc406b2, 0x05af365d, 0xdf648a69, 0xc60fba86, + 0x6bf3f300, 0x7298c3ef, 0xa8537fdb, 0xb1384f34, + 0xb0faf897, 0xa991c878, 0x735a744c, 0x6a3144a3, + 0xc7cd0d25, 0xdea63dca, 0x046d81fe, 0x1d06b111, + 0xafe2fef7, 0xb689ce18, 0x6c42722c, 0x752942c3, + 0xd8d50b45, 0xc1be3baa, 0x1b75879e, 0x021eb771, + 0x8ecaf457, 0x97a1c4b8, 0x4d6a788c, 0x54014863, + 0xf9fd01e5, 0xe096310a, 0x3a5d8d3e, 0x2336bdd1, + 0x91d2f237, 0x88b9c2d8, 0x52727eec, 0x4b194e03, + 0xe6e50785, 0xff8e376a, 0x25458b5e, 0x3c2ebbb1 + },{ + 0x00000000, 0xc82c0368, 0x905906d0, 0x587505b8, + 0xd1c5e0a5, 0x19e9e3cd, 0x419ce675, 0x89b0e51d, + 0x53fd2d4e, 0x9bd12e26, 0xc3a42b9e, 0x0b8828f6, + 0x8238cdeb, 0x4a14ce83, 0x1261cb3b, 0xda4dc853, + 0xa6fa5b9c, 0x6ed658f4, 0x36a35d4c, 0xfe8f5e24, + 0x773fbb39, 0xbf13b851, 0xe766bde9, 0x2f4abe81, + 0xf50776d2, 0x3d2b75ba, 0x655e7002, 0xad72736a, + 0x24c29677, 0xecee951f, 0xb49b90a7, 0x7cb793cf, + 0xbd835b3d, 0x75af5855, 0x2dda5ded, 0xe5f65e85, + 0x6c46bb98, 0xa46ab8f0, 0xfc1fbd48, 0x3433be20, + 0xee7e7673, 0x2652751b, 0x7e2770a3, 0xb60b73cb, + 0x3fbb96d6, 0xf79795be, 0xafe29006, 0x67ce936e, + 0x1b7900a1, 0xd35503c9, 0x8b200671, 0x430c0519, + 0xcabce004, 0x0290e36c, 0x5ae5e6d4, 0x92c9e5bc, + 0x48842def, 0x80a82e87, 0xd8dd2b3f, 0x10f12857, + 0x9941cd4a, 0x516dce22, 0x0918cb9a, 0xc134c8f2, + 0x7a07b77a, 0xb22bb412, 0xea5eb1aa, 0x2272b2c2, + 0xabc257df, 0x63ee54b7, 0x3b9b510f, 0xf3b75267, + 0x29fa9a34, 0xe1d6995c, 0xb9a39ce4, 0x718f9f8c, + 0xf83f7a91, 0x301379f9, 0x68667c41, 0xa04a7f29, + 0xdcfdece6, 0x14d1ef8e, 0x4ca4ea36, 0x8488e95e, + 0x0d380c43, 0xc5140f2b, 0x9d610a93, 0x554d09fb, + 0x8f00c1a8, 0x472cc2c0, 0x1f59c778, 0xd775c410, + 0x5ec5210d, 0x96e92265, 0xce9c27dd, 0x06b024b5, + 0xc784ec47, 0x0fa8ef2f, 0x57ddea97, 0x9ff1e9ff, + 0x16410ce2, 0xde6d0f8a, 0x86180a32, 0x4e34095a, + 0x9479c109, 0x5c55c261, 0x0420c7d9, 0xcc0cc4b1, + 0x45bc21ac, 0x8d9022c4, 0xd5e5277c, 0x1dc92414, + 0x617eb7db, 0xa952b4b3, 0xf127b10b, 0x390bb263, + 0xb0bb577e, 0x78975416, 0x20e251ae, 0xe8ce52c6, + 0x32839a95, 0xfaaf99fd, 0xa2da9c45, 0x6af69f2d, + 0xe3467a30, 0x2b6a7958, 0x731f7ce0, 0xbb337f88, + 0xf40e6ef5, 0x3c226d9d, 0x64576825, 0xac7b6b4d, + 0x25cb8e50, 0xede78d38, 0xb5928880, 0x7dbe8be8, + 0xa7f343bb, 0x6fdf40d3, 0x37aa456b, 0xff864603, + 0x7636a31e, 0xbe1aa076, 0xe66fa5ce, 0x2e43a6a6, + 0x52f43569, 0x9ad83601, 0xc2ad33b9, 0x0a8130d1, + 0x8331d5cc, 0x4b1dd6a4, 0x1368d31c, 0xdb44d074, + 0x01091827, 0xc9251b4f, 0x91501ef7, 0x597c1d9f, + 0xd0ccf882, 0x18e0fbea, 0x4095fe52, 0x88b9fd3a, + 0x498d35c8, 0x81a136a0, 0xd9d43318, 0x11f83070, + 0x9848d56d, 0x5064d605, 0x0811d3bd, 0xc03dd0d5, + 0x1a701886, 0xd25c1bee, 0x8a291e56, 0x42051d3e, + 0xcbb5f823, 0x0399fb4b, 0x5becfef3, 0x93c0fd9b, + 0xef776e54, 0x275b6d3c, 0x7f2e6884, 0xb7026bec, + 0x3eb28ef1, 0xf69e8d99, 0xaeeb8821, 0x66c78b49, + 0xbc8a431a, 0x74a64072, 0x2cd345ca, 0xe4ff46a2, + 0x6d4fa3bf, 0xa563a0d7, 0xfd16a56f, 0x353aa607, + 0x8e09d98f, 0x4625dae7, 0x1e50df5f, 0xd67cdc37, + 0x5fcc392a, 0x97e03a42, 0xcf953ffa, 0x07b93c92, + 0xddf4f4c1, 0x15d8f7a9, 0x4dadf211, 0x8581f179, + 0x0c311464, 0xc41d170c, 0x9c6812b4, 0x544411dc, + 0x28f38213, 0xe0df817b, 0xb8aa84c3, 0x708687ab, + 0xf93662b6, 0x311a61de, 0x696f6466, 0xa143670e, + 0x7b0eaf5d, 0xb322ac35, 0xeb57a98d, 0x237baae5, + 0xaacb4ff8, 0x62e74c90, 0x3a924928, 0xf2be4a40, + 0x338a82b2, 0xfba681da, 0xa3d38462, 0x6bff870a, + 0xe24f6217, 0x2a63617f, 0x721664c7, 0xba3a67af, + 0x6077affc, 0xa85bac94, 0xf02ea92c, 0x3802aa44, + 0xb1b24f59, 0x799e4c31, 0x21eb4989, 0xe9c74ae1, + 0x9570d92e, 0x5d5cda46, 0x0529dffe, 0xcd05dc96, + 0x44b5398b, 0x8c993ae3, 0xd4ec3f5b, 0x1cc03c33, + 0xc68df460, 0x0ea1f708, 0x56d4f2b0, 0x9ef8f1d8, + 0x174814c5, 0xdf6417ad, 0x87111215, 0x4f3d117d + },{ + 0x00000000, 0x277d3c49, 0x4efa7892, 0x698744db, + 0x6d821d21, 0x4aff2168, 0x237865b3, 0x040559fa, + 0xda043b42, 0xfd79070b, 0x94fe43d0, 0xb3837f99, + 0xb7862663, 0x90fb1a2a, 0xf97c5ef1, 0xde0162b8, + 0xb4097684, 0x93744acd, 0xfaf30e16, 0xdd8e325f, + 0xd98b6ba5, 0xfef657ec, 0x97711337, 0xb00c2f7e, + 0x6e0d4dc6, 0x4970718f, 0x20f73554, 0x078a091d, + 0x038f50e7, 0x24f26cae, 0x4d752875, 0x6a08143c, + 0x9965000d, 0xbe183c44, 0xd79f789f, 0xf0e244d6, + 0xf4e71d2c, 0xd39a2165, 0xba1d65be, 0x9d6059f7, + 0x43613b4f, 0x641c0706, 0x0d9b43dd, 0x2ae67f94, + 0x2ee3266e, 0x099e1a27, 0x60195efc, 0x476462b5, + 0x2d6c7689, 0x0a114ac0, 0x63960e1b, 0x44eb3252, + 0x40ee6ba8, 0x679357e1, 0x0e14133a, 0x29692f73, + 0xf7684dcb, 0xd0157182, 0xb9923559, 0x9eef0910, + 0x9aea50ea, 0xbd976ca3, 0xd4102878, 0xf36d1431, + 0x32cb001a, 0x15b63c53, 0x7c317888, 0x5b4c44c1, + 0x5f491d3b, 0x78342172, 0x11b365a9, 0x36ce59e0, + 0xe8cf3b58, 0xcfb20711, 0xa63543ca, 0x81487f83, + 0x854d2679, 0xa2301a30, 0xcbb75eeb, 0xecca62a2, + 0x86c2769e, 0xa1bf4ad7, 0xc8380e0c, 0xef453245, + 0xeb406bbf, 0xcc3d57f6, 0xa5ba132d, 0x82c72f64, + 0x5cc64ddc, 0x7bbb7195, 0x123c354e, 0x35410907, + 0x314450fd, 0x16396cb4, 0x7fbe286f, 0x58c31426, + 0xabae0017, 0x8cd33c5e, 0xe5547885, 0xc22944cc, + 0xc62c1d36, 0xe151217f, 0x88d665a4, 0xafab59ed, + 0x71aa3b55, 0x56d7071c, 0x3f5043c7, 0x182d7f8e, + 0x1c282674, 0x3b551a3d, 0x52d25ee6, 0x75af62af, + 0x1fa77693, 0x38da4ada, 0x515d0e01, 0x76203248, + 0x72256bb2, 0x555857fb, 0x3cdf1320, 0x1ba22f69, + 0xc5a34dd1, 0xe2de7198, 0x8b593543, 0xac24090a, + 0xa82150f0, 0x8f5c6cb9, 0xe6db2862, 0xc1a6142b, + 0x64960134, 0x43eb3d7d, 0x2a6c79a6, 0x0d1145ef, + 0x09141c15, 0x2e69205c, 0x47ee6487, 0x609358ce, + 0xbe923a76, 0x99ef063f, 0xf06842e4, 0xd7157ead, + 0xd3102757, 0xf46d1b1e, 0x9dea5fc5, 0xba97638c, + 0xd09f77b0, 0xf7e24bf9, 0x9e650f22, 0xb918336b, + 0xbd1d6a91, 0x9a6056d8, 0xf3e71203, 0xd49a2e4a, + 0x0a9b4cf2, 0x2de670bb, 0x44613460, 0x631c0829, + 0x671951d3, 0x40646d9a, 0x29e32941, 0x0e9e1508, + 0xfdf30139, 0xda8e3d70, 0xb30979ab, 0x947445e2, + 0x90711c18, 0xb70c2051, 0xde8b648a, 0xf9f658c3, + 0x27f73a7b, 0x008a0632, 0x690d42e9, 0x4e707ea0, + 0x4a75275a, 0x6d081b13, 0x048f5fc8, 0x23f26381, + 0x49fa77bd, 0x6e874bf4, 0x07000f2f, 0x207d3366, + 0x24786a9c, 0x030556d5, 0x6a82120e, 0x4dff2e47, + 0x93fe4cff, 0xb48370b6, 0xdd04346d, 0xfa790824, + 0xfe7c51de, 0xd9016d97, 0xb086294c, 0x97fb1505, + 0x565d012e, 0x71203d67, 0x18a779bc, 0x3fda45f5, + 0x3bdf1c0f, 0x1ca22046, 0x7525649d, 0x525858d4, + 0x8c593a6c, 0xab240625, 0xc2a342fe, 0xe5de7eb7, + 0xe1db274d, 0xc6a61b04, 0xaf215fdf, 0x885c6396, + 0xe25477aa, 0xc5294be3, 0xacae0f38, 0x8bd33371, + 0x8fd66a8b, 0xa8ab56c2, 0xc12c1219, 0xe6512e50, + 0x38504ce8, 0x1f2d70a1, 0x76aa347a, 0x51d70833, + 0x55d251c9, 0x72af6d80, 0x1b28295b, 0x3c551512, + 0xcf380123, 0xe8453d6a, 0x81c279b1, 0xa6bf45f8, + 0xa2ba1c02, 0x85c7204b, 0xec406490, 0xcb3d58d9, + 0x153c3a61, 0x32410628, 0x5bc642f3, 0x7cbb7eba, + 0x78be2740, 0x5fc31b09, 0x36445fd2, 0x1139639b, + 0x7b3177a7, 0x5c4c4bee, 0x35cb0f35, 0x12b6337c, + 0x16b36a86, 0x31ce56cf, 0x58491214, 0x7f342e5d, + 0xa1354ce5, 0x864870ac, 0xefcf3477, 0xc8b2083e, + 0xccb751c4, 0xebca6d8d, 0x824d2956, 0xa530151f + } +#else + { + 0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4, + 0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb, + 0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b, + 0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24, + 0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b, + 0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384, + 0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, 0x89d76c54, + 0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b, + 0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a, + 0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35, + 0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5, + 0x6dfe410e, 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa, + 0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45, + 0xf779deae, 0x05125dad, 0x1642ae59, 0xe4292d5a, + 0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a, + 0x7da08661, 0x8fcb0562, 0x9c9bf696, 0x6ef07595, + 0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48, + 0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957, + 0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687, + 0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198, + 0x5125dad3, 0xa34e59d0, 0xb01eaa24, 0x42752927, + 0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38, + 0xdbfc821c, 0x2997011f, 0x3ac7f2eb, 0xc8ac71e8, + 0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7, + 0x61c69362, 0x93ad1061, 0x80fde395, 0x72966096, + 0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789, + 0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859, + 0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46, + 0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9, + 0xb602c312, 0x44694011, 0x5739b3e5, 0xa55230e6, + 0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36, + 0x3cdb9bdd, 0xceb018de, 0xdde0eb2a, 0x2f8b6829, + 0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c, + 0x456cac67, 0xb7072f64, 0xa457dc90, 0x563c5f93, + 0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043, + 0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c, + 0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3, + 0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc, + 0x1871a4d8, 0xea1a27db, 0xf94ad42f, 0x0b21572c, + 0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033, + 0xa24bb5a6, 0x502036a5, 0x4370c551, 0xb11b4652, + 0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d, + 0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, 0x3bc21e9d, + 0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982, + 0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d, + 0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622, + 0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2, + 0xff56bd19, 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed, + 0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530, + 0x0417b1db, 0xf67c32d8, 0xe52cc12c, 0x1747422f, + 0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff, + 0x8ecee914, 0x7ca56a17, 0x6ff599e3, 0x9d9e1ae0, + 0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f, + 0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540, + 0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90, + 0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f, + 0xe330a81a, 0x115b2b19, 0x020bd8ed, 0xf0605bee, + 0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1, + 0x69e9f0d5, 0x9b8273d6, 0x88d28022, 0x7ab90321, + 0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e, + 0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81, + 0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e, + 0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e, + 0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351 + },{ + 0x00000000, 0x13a29877, 0x274530ee, 0x34e7a899, + 0x4e8a61dc, 0x5d28f9ab, 0x69cf5132, 0x7a6dc945, + 0x9d14c3b8, 0x8eb65bcf, 0xba51f356, 0xa9f36b21, + 0xd39ea264, 0xc03c3a13, 0xf4db928a, 0xe7790afd, + 0x3fc5f181, 0x2c6769f6, 0x1880c16f, 0x0b225918, + 0x714f905d, 0x62ed082a, 0x560aa0b3, 0x45a838c4, + 0xa2d13239, 0xb173aa4e, 0x859402d7, 0x96369aa0, + 0xec5b53e5, 0xfff9cb92, 0xcb1e630b, 0xd8bcfb7c, + 0x7f8be302, 0x6c297b75, 0x58ced3ec, 0x4b6c4b9b, + 0x310182de, 0x22a31aa9, 0x1644b230, 0x05e62a47, + 0xe29f20ba, 0xf13db8cd, 0xc5da1054, 0xd6788823, + 0xac154166, 0xbfb7d911, 0x8b507188, 0x98f2e9ff, + 0x404e1283, 0x53ec8af4, 0x670b226d, 0x74a9ba1a, + 0x0ec4735f, 0x1d66eb28, 0x298143b1, 0x3a23dbc6, + 0xdd5ad13b, 0xcef8494c, 0xfa1fe1d5, 0xe9bd79a2, + 0x93d0b0e7, 0x80722890, 0xb4958009, 0xa737187e, + 0xff17c604, 0xecb55e73, 0xd852f6ea, 0xcbf06e9d, + 0xb19da7d8, 0xa23f3faf, 0x96d89736, 0x857a0f41, + 0x620305bc, 0x71a19dcb, 0x45463552, 0x56e4ad25, + 0x2c896460, 0x3f2bfc17, 0x0bcc548e, 0x186eccf9, + 0xc0d23785, 0xd370aff2, 0xe797076b, 0xf4359f1c, + 0x8e585659, 0x9dface2e, 0xa91d66b7, 0xbabffec0, + 0x5dc6f43d, 0x4e646c4a, 0x7a83c4d3, 0x69215ca4, + 0x134c95e1, 0x00ee0d96, 0x3409a50f, 0x27ab3d78, + 0x809c2506, 0x933ebd71, 0xa7d915e8, 0xb47b8d9f, + 0xce1644da, 0xddb4dcad, 0xe9537434, 0xfaf1ec43, + 0x1d88e6be, 0x0e2a7ec9, 0x3acdd650, 0x296f4e27, + 0x53028762, 0x40a01f15, 0x7447b78c, 0x67e52ffb, + 0xbf59d487, 0xacfb4cf0, 0x981ce469, 0x8bbe7c1e, + 0xf1d3b55b, 0xe2712d2c, 0xd69685b5, 0xc5341dc2, + 0x224d173f, 0x31ef8f48, 0x050827d1, 0x16aabfa6, + 0x6cc776e3, 0x7f65ee94, 0x4b82460d, 0x5820de7a, + 0xfbc3faf9, 0xe861628e, 0xdc86ca17, 0xcf245260, + 0xb5499b25, 0xa6eb0352, 0x920cabcb, 0x81ae33bc, + 0x66d73941, 0x7575a136, 0x419209af, 0x523091d8, + 0x285d589d, 0x3bffc0ea, 0x0f186873, 0x1cbaf004, + 0xc4060b78, 0xd7a4930f, 0xe3433b96, 0xf0e1a3e1, + 0x8a8c6aa4, 0x992ef2d3, 0xadc95a4a, 0xbe6bc23d, + 0x5912c8c0, 0x4ab050b7, 0x7e57f82e, 0x6df56059, + 0x1798a91c, 0x043a316b, 0x30dd99f2, 0x237f0185, + 0x844819fb, 0x97ea818c, 0xa30d2915, 0xb0afb162, + 0xcac27827, 0xd960e050, 0xed8748c9, 0xfe25d0be, + 0x195cda43, 0x0afe4234, 0x3e19eaad, 0x2dbb72da, + 0x57d6bb9f, 0x447423e8, 0x70938b71, 0x63311306, + 0xbb8de87a, 0xa82f700d, 0x9cc8d894, 0x8f6a40e3, + 0xf50789a6, 0xe6a511d1, 0xd242b948, 0xc1e0213f, + 0x26992bc2, 0x353bb3b5, 0x01dc1b2c, 0x127e835b, + 0x68134a1e, 0x7bb1d269, 0x4f567af0, 0x5cf4e287, + 0x04d43cfd, 0x1776a48a, 0x23910c13, 0x30339464, + 0x4a5e5d21, 0x59fcc556, 0x6d1b6dcf, 0x7eb9f5b8, + 0x99c0ff45, 0x8a626732, 0xbe85cfab, 0xad2757dc, + 0xd74a9e99, 0xc4e806ee, 0xf00fae77, 0xe3ad3600, + 0x3b11cd7c, 0x28b3550b, 0x1c54fd92, 0x0ff665e5, + 0x759baca0, 0x663934d7, 0x52de9c4e, 0x417c0439, + 0xa6050ec4, 0xb5a796b3, 0x81403e2a, 0x92e2a65d, + 0xe88f6f18, 0xfb2df76f, 0xcfca5ff6, 0xdc68c781, + 0x7b5fdfff, 0x68fd4788, 0x5c1aef11, 0x4fb87766, + 0x35d5be23, 0x26772654, 0x12908ecd, 0x013216ba, + 0xe64b1c47, 0xf5e98430, 0xc10e2ca9, 0xd2acb4de, + 0xa8c17d9b, 0xbb63e5ec, 0x8f844d75, 0x9c26d502, + 0x449a2e7e, 0x5738b609, 0x63df1e90, 0x707d86e7, + 0x0a104fa2, 0x19b2d7d5, 0x2d557f4c, 0x3ef7e73b, + 0xd98eedc6, 0xca2c75b1, 0xfecbdd28, 0xed69455f, + 0x97048c1a, 0x84a6146d, 0xb041bcf4, 0xa3e32483 + },{ + 0x00000000, 0xa541927e, 0x4f6f520d, 0xea2ec073, + 0x9edea41a, 0x3b9f3664, 0xd1b1f617, 0x74f06469, + 0x38513ec5, 0x9d10acbb, 0x773e6cc8, 0xd27ffeb6, + 0xa68f9adf, 0x03ce08a1, 0xe9e0c8d2, 0x4ca15aac, + 0x70a27d8a, 0xd5e3eff4, 0x3fcd2f87, 0x9a8cbdf9, + 0xee7cd990, 0x4b3d4bee, 0xa1138b9d, 0x045219e3, + 0x48f3434f, 0xedb2d131, 0x079c1142, 0xa2dd833c, + 0xd62de755, 0x736c752b, 0x9942b558, 0x3c032726, + 0xe144fb14, 0x4405696a, 0xae2ba919, 0x0b6a3b67, + 0x7f9a5f0e, 0xdadbcd70, 0x30f50d03, 0x95b49f7d, + 0xd915c5d1, 0x7c5457af, 0x967a97dc, 0x333b05a2, + 0x47cb61cb, 0xe28af3b5, 0x08a433c6, 0xade5a1b8, + 0x91e6869e, 0x34a714e0, 0xde89d493, 0x7bc846ed, + 0x0f382284, 0xaa79b0fa, 0x40577089, 0xe516e2f7, + 0xa9b7b85b, 0x0cf62a25, 0xe6d8ea56, 0x43997828, + 0x37691c41, 0x92288e3f, 0x78064e4c, 0xdd47dc32, + 0xc76580d9, 0x622412a7, 0x880ad2d4, 0x2d4b40aa, + 0x59bb24c3, 0xfcfab6bd, 0x16d476ce, 0xb395e4b0, + 0xff34be1c, 0x5a752c62, 0xb05bec11, 0x151a7e6f, + 0x61ea1a06, 0xc4ab8878, 0x2e85480b, 0x8bc4da75, + 0xb7c7fd53, 0x12866f2d, 0xf8a8af5e, 0x5de93d20, + 0x29195949, 0x8c58cb37, 0x66760b44, 0xc337993a, + 0x8f96c396, 0x2ad751e8, 0xc0f9919b, 0x65b803e5, + 0x1148678c, 0xb409f5f2, 0x5e273581, 0xfb66a7ff, + 0x26217bcd, 0x8360e9b3, 0x694e29c0, 0xcc0fbbbe, + 0xb8ffdfd7, 0x1dbe4da9, 0xf7908dda, 0x52d11fa4, + 0x1e704508, 0xbb31d776, 0x511f1705, 0xf45e857b, + 0x80aee112, 0x25ef736c, 0xcfc1b31f, 0x6a802161, + 0x56830647, 0xf3c29439, 0x19ec544a, 0xbcadc634, + 0xc85da25d, 0x6d1c3023, 0x8732f050, 0x2273622e, + 0x6ed23882, 0xcb93aafc, 0x21bd6a8f, 0x84fcf8f1, + 0xf00c9c98, 0x554d0ee6, 0xbf63ce95, 0x1a225ceb, + 0x8b277743, 0x2e66e53d, 0xc448254e, 0x6109b730, + 0x15f9d359, 0xb0b84127, 0x5a968154, 0xffd7132a, + 0xb3764986, 0x1637dbf8, 0xfc191b8b, 0x595889f5, + 0x2da8ed9c, 0x88e97fe2, 0x62c7bf91, 0xc7862def, + 0xfb850ac9, 0x5ec498b7, 0xb4ea58c4, 0x11abcaba, + 0x655baed3, 0xc01a3cad, 0x2a34fcde, 0x8f756ea0, + 0xc3d4340c, 0x6695a672, 0x8cbb6601, 0x29faf47f, + 0x5d0a9016, 0xf84b0268, 0x1265c21b, 0xb7245065, + 0x6a638c57, 0xcf221e29, 0x250cde5a, 0x804d4c24, + 0xf4bd284d, 0x51fcba33, 0xbbd27a40, 0x1e93e83e, + 0x5232b292, 0xf77320ec, 0x1d5de09f, 0xb81c72e1, + 0xccec1688, 0x69ad84f6, 0x83834485, 0x26c2d6fb, + 0x1ac1f1dd, 0xbf8063a3, 0x55aea3d0, 0xf0ef31ae, + 0x841f55c7, 0x215ec7b9, 0xcb7007ca, 0x6e3195b4, + 0x2290cf18, 0x87d15d66, 0x6dff9d15, 0xc8be0f6b, + 0xbc4e6b02, 0x190ff97c, 0xf321390f, 0x5660ab71, + 0x4c42f79a, 0xe90365e4, 0x032da597, 0xa66c37e9, + 0xd29c5380, 0x77ddc1fe, 0x9df3018d, 0x38b293f3, + 0x7413c95f, 0xd1525b21, 0x3b7c9b52, 0x9e3d092c, + 0xeacd6d45, 0x4f8cff3b, 0xa5a23f48, 0x00e3ad36, + 0x3ce08a10, 0x99a1186e, 0x738fd81d, 0xd6ce4a63, + 0xa23e2e0a, 0x077fbc74, 0xed517c07, 0x4810ee79, + 0x04b1b4d5, 0xa1f026ab, 0x4bdee6d8, 0xee9f74a6, + 0x9a6f10cf, 0x3f2e82b1, 0xd50042c2, 0x7041d0bc, + 0xad060c8e, 0x08479ef0, 0xe2695e83, 0x4728ccfd, + 0x33d8a894, 0x96993aea, 0x7cb7fa99, 0xd9f668e7, + 0x9557324b, 0x3016a035, 0xda386046, 0x7f79f238, + 0x0b899651, 0xaec8042f, 0x44e6c45c, 0xe1a75622, + 0xdda47104, 0x78e5e37a, 0x92cb2309, 0x378ab177, + 0x437ad51e, 0xe63b4760, 0x0c158713, 0xa954156d, + 0xe5f54fc1, 0x40b4ddbf, 0xaa9a1dcc, 0x0fdb8fb2, + 0x7b2bebdb, 0xde6a79a5, 0x3444b9d6, 0x91052ba8 + },{ + 0x00000000, 0xdd45aab8, 0xbf672381, 0x62228939, + 0x7b2231f3, 0xa6679b4b, 0xc4451272, 0x1900b8ca, + 0xf64463e6, 0x2b01c95e, 0x49234067, 0x9466eadf, + 0x8d665215, 0x5023f8ad, 0x32017194, 0xef44db2c, + 0xe964b13d, 0x34211b85, 0x560392bc, 0x8b463804, + 0x924680ce, 0x4f032a76, 0x2d21a34f, 0xf06409f7, + 0x1f20d2db, 0xc2657863, 0xa047f15a, 0x7d025be2, + 0x6402e328, 0xb9474990, 0xdb65c0a9, 0x06206a11, + 0xd725148b, 0x0a60be33, 0x6842370a, 0xb5079db2, + 0xac072578, 0x71428fc0, 0x136006f9, 0xce25ac41, + 0x2161776d, 0xfc24ddd5, 0x9e0654ec, 0x4343fe54, + 0x5a43469e, 0x8706ec26, 0xe524651f, 0x3861cfa7, + 0x3e41a5b6, 0xe3040f0e, 0x81268637, 0x5c632c8f, + 0x45639445, 0x98263efd, 0xfa04b7c4, 0x27411d7c, + 0xc805c650, 0x15406ce8, 0x7762e5d1, 0xaa274f69, + 0xb327f7a3, 0x6e625d1b, 0x0c40d422, 0xd1057e9a, + 0xaba65fe7, 0x76e3f55f, 0x14c17c66, 0xc984d6de, + 0xd0846e14, 0x0dc1c4ac, 0x6fe34d95, 0xb2a6e72d, + 0x5de23c01, 0x80a796b9, 0xe2851f80, 0x3fc0b538, + 0x26c00df2, 0xfb85a74a, 0x99a72e73, 0x44e284cb, + 0x42c2eeda, 0x9f874462, 0xfda5cd5b, 0x20e067e3, + 0x39e0df29, 0xe4a57591, 0x8687fca8, 0x5bc25610, + 0xb4868d3c, 0x69c32784, 0x0be1aebd, 0xd6a40405, + 0xcfa4bccf, 0x12e11677, 0x70c39f4e, 0xad8635f6, + 0x7c834b6c, 0xa1c6e1d4, 0xc3e468ed, 0x1ea1c255, + 0x07a17a9f, 0xdae4d027, 0xb8c6591e, 0x6583f3a6, + 0x8ac7288a, 0x57828232, 0x35a00b0b, 0xe8e5a1b3, + 0xf1e51979, 0x2ca0b3c1, 0x4e823af8, 0x93c79040, + 0x95e7fa51, 0x48a250e9, 0x2a80d9d0, 0xf7c57368, + 0xeec5cba2, 0x3380611a, 0x51a2e823, 0x8ce7429b, + 0x63a399b7, 0xbee6330f, 0xdcc4ba36, 0x0181108e, + 0x1881a844, 0xc5c402fc, 0xa7e68bc5, 0x7aa3217d, + 0x52a0c93f, 0x8fe56387, 0xedc7eabe, 0x30824006, + 0x2982f8cc, 0xf4c75274, 0x96e5db4d, 0x4ba071f5, + 0xa4e4aad9, 0x79a10061, 0x1b838958, 0xc6c623e0, + 0xdfc69b2a, 0x02833192, 0x60a1b8ab, 0xbde41213, + 0xbbc47802, 0x6681d2ba, 0x04a35b83, 0xd9e6f13b, + 0xc0e649f1, 0x1da3e349, 0x7f816a70, 0xa2c4c0c8, + 0x4d801be4, 0x90c5b15c, 0xf2e73865, 0x2fa292dd, + 0x36a22a17, 0xebe780af, 0x89c50996, 0x5480a32e, + 0x8585ddb4, 0x58c0770c, 0x3ae2fe35, 0xe7a7548d, + 0xfea7ec47, 0x23e246ff, 0x41c0cfc6, 0x9c85657e, + 0x73c1be52, 0xae8414ea, 0xcca69dd3, 0x11e3376b, + 0x08e38fa1, 0xd5a62519, 0xb784ac20, 0x6ac10698, + 0x6ce16c89, 0xb1a4c631, 0xd3864f08, 0x0ec3e5b0, + 0x17c35d7a, 0xca86f7c2, 0xa8a47efb, 0x75e1d443, + 0x9aa50f6f, 0x47e0a5d7, 0x25c22cee, 0xf8878656, + 0xe1873e9c, 0x3cc29424, 0x5ee01d1d, 0x83a5b7a5, + 0xf90696d8, 0x24433c60, 0x4661b559, 0x9b241fe1, + 0x8224a72b, 0x5f610d93, 0x3d4384aa, 0xe0062e12, + 0x0f42f53e, 0xd2075f86, 0xb025d6bf, 0x6d607c07, + 0x7460c4cd, 0xa9256e75, 0xcb07e74c, 0x16424df4, + 0x106227e5, 0xcd278d5d, 0xaf050464, 0x7240aedc, + 0x6b401616, 0xb605bcae, 0xd4273597, 0x09629f2f, + 0xe6264403, 0x3b63eebb, 0x59416782, 0x8404cd3a, + 0x9d0475f0, 0x4041df48, 0x22635671, 0xff26fcc9, + 0x2e238253, 0xf36628eb, 0x9144a1d2, 0x4c010b6a, + 0x5501b3a0, 0x88441918, 0xea669021, 0x37233a99, + 0xd867e1b5, 0x05224b0d, 0x6700c234, 0xba45688c, + 0xa345d046, 0x7e007afe, 0x1c22f3c7, 0xc167597f, + 0xc747336e, 0x1a0299d6, 0x782010ef, 0xa565ba57, + 0xbc65029d, 0x6120a825, 0x0302211c, 0xde478ba4, + 0x31035088, 0xec46fa30, 0x8e647309, 0x5321d9b1, + 0x4a21617b, 0x9764cbc3, 0xf54642fa, 0x2803e842 + },{ + 0x00000000, 0x38116fac, 0x7022df58, 0x4833b0f4, + 0xe045beb0, 0xd854d11c, 0x906761e8, 0xa8760e44, + 0xc5670b91, 0xfd76643d, 0xb545d4c9, 0x8d54bb65, + 0x2522b521, 0x1d33da8d, 0x55006a79, 0x6d1105d5, + 0x8f2261d3, 0xb7330e7f, 0xff00be8b, 0xc711d127, + 0x6f67df63, 0x5776b0cf, 0x1f45003b, 0x27546f97, + 0x4a456a42, 0x725405ee, 0x3a67b51a, 0x0276dab6, + 0xaa00d4f2, 0x9211bb5e, 0xda220baa, 0xe2336406, + 0x1ba8b557, 0x23b9dafb, 0x6b8a6a0f, 0x539b05a3, + 0xfbed0be7, 0xc3fc644b, 0x8bcfd4bf, 0xb3debb13, + 0xdecfbec6, 0xe6ded16a, 0xaeed619e, 0x96fc0e32, + 0x3e8a0076, 0x069b6fda, 0x4ea8df2e, 0x76b9b082, + 0x948ad484, 0xac9bbb28, 0xe4a80bdc, 0xdcb96470, + 0x74cf6a34, 0x4cde0598, 0x04edb56c, 0x3cfcdac0, + 0x51eddf15, 0x69fcb0b9, 0x21cf004d, 0x19de6fe1, + 0xb1a861a5, 0x89b90e09, 0xc18abefd, 0xf99bd151, + 0x37516aae, 0x0f400502, 0x4773b5f6, 0x7f62da5a, + 0xd714d41e, 0xef05bbb2, 0xa7360b46, 0x9f2764ea, + 0xf236613f, 0xca270e93, 0x8214be67, 0xba05d1cb, + 0x1273df8f, 0x2a62b023, 0x625100d7, 0x5a406f7b, + 0xb8730b7d, 0x806264d1, 0xc851d425, 0xf040bb89, + 0x5836b5cd, 0x6027da61, 0x28146a95, 0x10050539, + 0x7d1400ec, 0x45056f40, 0x0d36dfb4, 0x3527b018, + 0x9d51be5c, 0xa540d1f0, 0xed736104, 0xd5620ea8, + 0x2cf9dff9, 0x14e8b055, 0x5cdb00a1, 0x64ca6f0d, + 0xccbc6149, 0xf4ad0ee5, 0xbc9ebe11, 0x848fd1bd, + 0xe99ed468, 0xd18fbbc4, 0x99bc0b30, 0xa1ad649c, + 0x09db6ad8, 0x31ca0574, 0x79f9b580, 0x41e8da2c, + 0xa3dbbe2a, 0x9bcad186, 0xd3f96172, 0xebe80ede, + 0x439e009a, 0x7b8f6f36, 0x33bcdfc2, 0x0badb06e, + 0x66bcb5bb, 0x5eadda17, 0x169e6ae3, 0x2e8f054f, + 0x86f90b0b, 0xbee864a7, 0xf6dbd453, 0xcecabbff, + 0x6ea2d55c, 0x56b3baf0, 0x1e800a04, 0x269165a8, + 0x8ee76bec, 0xb6f60440, 0xfec5b4b4, 0xc6d4db18, + 0xabc5decd, 0x93d4b161, 0xdbe70195, 0xe3f66e39, + 0x4b80607d, 0x73910fd1, 0x3ba2bf25, 0x03b3d089, + 0xe180b48f, 0xd991db23, 0x91a26bd7, 0xa9b3047b, + 0x01c50a3f, 0x39d46593, 0x71e7d567, 0x49f6bacb, + 0x24e7bf1e, 0x1cf6d0b2, 0x54c56046, 0x6cd40fea, + 0xc4a201ae, 0xfcb36e02, 0xb480def6, 0x8c91b15a, + 0x750a600b, 0x4d1b0fa7, 0x0528bf53, 0x3d39d0ff, + 0x954fdebb, 0xad5eb117, 0xe56d01e3, 0xdd7c6e4f, + 0xb06d6b9a, 0x887c0436, 0xc04fb4c2, 0xf85edb6e, + 0x5028d52a, 0x6839ba86, 0x200a0a72, 0x181b65de, + 0xfa2801d8, 0xc2396e74, 0x8a0ade80, 0xb21bb12c, + 0x1a6dbf68, 0x227cd0c4, 0x6a4f6030, 0x525e0f9c, + 0x3f4f0a49, 0x075e65e5, 0x4f6dd511, 0x777cbabd, + 0xdf0ab4f9, 0xe71bdb55, 0xaf286ba1, 0x9739040d, + 0x59f3bff2, 0x61e2d05e, 0x29d160aa, 0x11c00f06, + 0xb9b60142, 0x81a76eee, 0xc994de1a, 0xf185b1b6, + 0x9c94b463, 0xa485dbcf, 0xecb66b3b, 0xd4a70497, + 0x7cd10ad3, 0x44c0657f, 0x0cf3d58b, 0x34e2ba27, + 0xd6d1de21, 0xeec0b18d, 0xa6f30179, 0x9ee26ed5, + 0x36946091, 0x0e850f3d, 0x46b6bfc9, 0x7ea7d065, + 0x13b6d5b0, 0x2ba7ba1c, 0x63940ae8, 0x5b856544, + 0xf3f36b00, 0xcbe204ac, 0x83d1b458, 0xbbc0dbf4, + 0x425b0aa5, 0x7a4a6509, 0x3279d5fd, 0x0a68ba51, + 0xa21eb415, 0x9a0fdbb9, 0xd23c6b4d, 0xea2d04e1, + 0x873c0134, 0xbf2d6e98, 0xf71ede6c, 0xcf0fb1c0, + 0x6779bf84, 0x5f68d028, 0x175b60dc, 0x2f4a0f70, + 0xcd796b76, 0xf56804da, 0xbd5bb42e, 0x854adb82, + 0x2d3cd5c6, 0x152dba6a, 0x5d1e0a9e, 0x650f6532, + 0x081e60e7, 0x300f0f4b, 0x783cbfbf, 0x402dd013, + 0xe85bde57, 0xd04ab1fb, 0x9879010f, 0xa0686ea3 + },{ + 0x00000000, 0xef306b19, 0xdb8ca0c3, 0x34bccbda, + 0xb2f53777, 0x5dc55c6e, 0x697997b4, 0x8649fcad, + 0x6006181f, 0x8f367306, 0xbb8ab8dc, 0x54bad3c5, + 0xd2f32f68, 0x3dc34471, 0x097f8fab, 0xe64fe4b2, + 0xc00c303e, 0x2f3c5b27, 0x1b8090fd, 0xf4b0fbe4, + 0x72f90749, 0x9dc96c50, 0xa975a78a, 0x4645cc93, + 0xa00a2821, 0x4f3a4338, 0x7b8688e2, 0x94b6e3fb, + 0x12ff1f56, 0xfdcf744f, 0xc973bf95, 0x2643d48c, + 0x85f4168d, 0x6ac47d94, 0x5e78b64e, 0xb148dd57, + 0x370121fa, 0xd8314ae3, 0xec8d8139, 0x03bdea20, + 0xe5f20e92, 0x0ac2658b, 0x3e7eae51, 0xd14ec548, + 0x570739e5, 0xb83752fc, 0x8c8b9926, 0x63bbf23f, + 0x45f826b3, 0xaac84daa, 0x9e748670, 0x7144ed69, + 0xf70d11c4, 0x183d7add, 0x2c81b107, 0xc3b1da1e, + 0x25fe3eac, 0xcace55b5, 0xfe729e6f, 0x1142f576, + 0x970b09db, 0x783b62c2, 0x4c87a918, 0xa3b7c201, + 0x0e045beb, 0xe13430f2, 0xd588fb28, 0x3ab89031, + 0xbcf16c9c, 0x53c10785, 0x677dcc5f, 0x884da746, + 0x6e0243f4, 0x813228ed, 0xb58ee337, 0x5abe882e, + 0xdcf77483, 0x33c71f9a, 0x077bd440, 0xe84bbf59, + 0xce086bd5, 0x213800cc, 0x1584cb16, 0xfab4a00f, + 0x7cfd5ca2, 0x93cd37bb, 0xa771fc61, 0x48419778, + 0xae0e73ca, 0x413e18d3, 0x7582d309, 0x9ab2b810, + 0x1cfb44bd, 0xf3cb2fa4, 0xc777e47e, 0x28478f67, + 0x8bf04d66, 0x64c0267f, 0x507ceda5, 0xbf4c86bc, + 0x39057a11, 0xd6351108, 0xe289dad2, 0x0db9b1cb, + 0xebf65579, 0x04c63e60, 0x307af5ba, 0xdf4a9ea3, + 0x5903620e, 0xb6330917, 0x828fc2cd, 0x6dbfa9d4, + 0x4bfc7d58, 0xa4cc1641, 0x9070dd9b, 0x7f40b682, + 0xf9094a2f, 0x16392136, 0x2285eaec, 0xcdb581f5, + 0x2bfa6547, 0xc4ca0e5e, 0xf076c584, 0x1f46ae9d, + 0x990f5230, 0x763f3929, 0x4283f2f3, 0xadb399ea, + 0x1c08b7d6, 0xf338dccf, 0xc7841715, 0x28b47c0c, + 0xaefd80a1, 0x41cdebb8, 0x75712062, 0x9a414b7b, + 0x7c0eafc9, 0x933ec4d0, 0xa7820f0a, 0x48b26413, + 0xcefb98be, 0x21cbf3a7, 0x1577387d, 0xfa475364, + 0xdc0487e8, 0x3334ecf1, 0x0788272b, 0xe8b84c32, + 0x6ef1b09f, 0x81c1db86, 0xb57d105c, 0x5a4d7b45, + 0xbc029ff7, 0x5332f4ee, 0x678e3f34, 0x88be542d, + 0x0ef7a880, 0xe1c7c399, 0xd57b0843, 0x3a4b635a, + 0x99fca15b, 0x76ccca42, 0x42700198, 0xad406a81, + 0x2b09962c, 0xc439fd35, 0xf08536ef, 0x1fb55df6, + 0xf9fab944, 0x16cad25d, 0x22761987, 0xcd46729e, + 0x4b0f8e33, 0xa43fe52a, 0x90832ef0, 0x7fb345e9, + 0x59f09165, 0xb6c0fa7c, 0x827c31a6, 0x6d4c5abf, + 0xeb05a612, 0x0435cd0b, 0x308906d1, 0xdfb96dc8, + 0x39f6897a, 0xd6c6e263, 0xe27a29b9, 0x0d4a42a0, + 0x8b03be0d, 0x6433d514, 0x508f1ece, 0xbfbf75d7, + 0x120cec3d, 0xfd3c8724, 0xc9804cfe, 0x26b027e7, + 0xa0f9db4a, 0x4fc9b053, 0x7b757b89, 0x94451090, + 0x720af422, 0x9d3a9f3b, 0xa98654e1, 0x46b63ff8, + 0xc0ffc355, 0x2fcfa84c, 0x1b736396, 0xf443088f, + 0xd200dc03, 0x3d30b71a, 0x098c7cc0, 0xe6bc17d9, + 0x60f5eb74, 0x8fc5806d, 0xbb794bb7, 0x544920ae, + 0xb206c41c, 0x5d36af05, 0x698a64df, 0x86ba0fc6, + 0x00f3f36b, 0xefc39872, 0xdb7f53a8, 0x344f38b1, + 0x97f8fab0, 0x78c891a9, 0x4c745a73, 0xa344316a, + 0x250dcdc7, 0xca3da6de, 0xfe816d04, 0x11b1061d, + 0xf7fee2af, 0x18ce89b6, 0x2c72426c, 0xc3422975, + 0x450bd5d8, 0xaa3bbec1, 0x9e87751b, 0x71b71e02, + 0x57f4ca8e, 0xb8c4a197, 0x8c786a4d, 0x63480154, + 0xe501fdf9, 0x0a3196e0, 0x3e8d5d3a, 0xd1bd3623, + 0x37f2d291, 0xd8c2b988, 0xec7e7252, 0x034e194b, + 0x8507e5e6, 0x6a378eff, 0x5e8b4525, 0xb1bb2e3c + },{ + 0x00000000, 0x68032cc8, 0xd0065990, 0xb8057558, + 0xa5e0c5d1, 0xcde3e919, 0x75e69c41, 0x1de5b089, + 0x4e2dfd53, 0x262ed19b, 0x9e2ba4c3, 0xf628880b, + 0xebcd3882, 0x83ce144a, 0x3bcb6112, 0x53c84dda, + 0x9c5bfaa6, 0xf458d66e, 0x4c5da336, 0x245e8ffe, + 0x39bb3f77, 0x51b813bf, 0xe9bd66e7, 0x81be4a2f, + 0xd27607f5, 0xba752b3d, 0x02705e65, 0x6a7372ad, + 0x7796c224, 0x1f95eeec, 0xa7909bb4, 0xcf93b77c, + 0x3d5b83bd, 0x5558af75, 0xed5dda2d, 0x855ef6e5, + 0x98bb466c, 0xf0b86aa4, 0x48bd1ffc, 0x20be3334, + 0x73767eee, 0x1b755226, 0xa370277e, 0xcb730bb6, + 0xd696bb3f, 0xbe9597f7, 0x0690e2af, 0x6e93ce67, + 0xa100791b, 0xc90355d3, 0x7106208b, 0x19050c43, + 0x04e0bcca, 0x6ce39002, 0xd4e6e55a, 0xbce5c992, + 0xef2d8448, 0x872ea880, 0x3f2bddd8, 0x5728f110, + 0x4acd4199, 0x22ce6d51, 0x9acb1809, 0xf2c834c1, + 0x7ab7077a, 0x12b42bb2, 0xaab15eea, 0xc2b27222, + 0xdf57c2ab, 0xb754ee63, 0x0f519b3b, 0x6752b7f3, + 0x349afa29, 0x5c99d6e1, 0xe49ca3b9, 0x8c9f8f71, + 0x917a3ff8, 0xf9791330, 0x417c6668, 0x297f4aa0, + 0xe6ecfddc, 0x8eefd114, 0x36eaa44c, 0x5ee98884, + 0x430c380d, 0x2b0f14c5, 0x930a619d, 0xfb094d55, + 0xa8c1008f, 0xc0c22c47, 0x78c7591f, 0x10c475d7, + 0x0d21c55e, 0x6522e996, 0xdd279cce, 0xb524b006, + 0x47ec84c7, 0x2fefa80f, 0x97eadd57, 0xffe9f19f, + 0xe20c4116, 0x8a0f6dde, 0x320a1886, 0x5a09344e, + 0x09c17994, 0x61c2555c, 0xd9c72004, 0xb1c40ccc, + 0xac21bc45, 0xc422908d, 0x7c27e5d5, 0x1424c91d, + 0xdbb77e61, 0xb3b452a9, 0x0bb127f1, 0x63b20b39, + 0x7e57bbb0, 0x16549778, 0xae51e220, 0xc652cee8, + 0x959a8332, 0xfd99affa, 0x459cdaa2, 0x2d9ff66a, + 0x307a46e3, 0x58796a2b, 0xe07c1f73, 0x887f33bb, + 0xf56e0ef4, 0x9d6d223c, 0x25685764, 0x4d6b7bac, + 0x508ecb25, 0x388de7ed, 0x808892b5, 0xe88bbe7d, + 0xbb43f3a7, 0xd340df6f, 0x6b45aa37, 0x034686ff, + 0x1ea33676, 0x76a01abe, 0xcea56fe6, 0xa6a6432e, + 0x6935f452, 0x0136d89a, 0xb933adc2, 0xd130810a, + 0xccd53183, 0xa4d61d4b, 0x1cd36813, 0x74d044db, + 0x27180901, 0x4f1b25c9, 0xf71e5091, 0x9f1d7c59, + 0x82f8ccd0, 0xeafbe018, 0x52fe9540, 0x3afdb988, + 0xc8358d49, 0xa036a181, 0x1833d4d9, 0x7030f811, + 0x6dd54898, 0x05d66450, 0xbdd31108, 0xd5d03dc0, + 0x8618701a, 0xee1b5cd2, 0x561e298a, 0x3e1d0542, + 0x23f8b5cb, 0x4bfb9903, 0xf3feec5b, 0x9bfdc093, + 0x546e77ef, 0x3c6d5b27, 0x84682e7f, 0xec6b02b7, + 0xf18eb23e, 0x998d9ef6, 0x2188ebae, 0x498bc766, + 0x1a438abc, 0x7240a674, 0xca45d32c, 0xa246ffe4, + 0xbfa34f6d, 0xd7a063a5, 0x6fa516fd, 0x07a63a35, + 0x8fd9098e, 0xe7da2546, 0x5fdf501e, 0x37dc7cd6, + 0x2a39cc5f, 0x423ae097, 0xfa3f95cf, 0x923cb907, + 0xc1f4f4dd, 0xa9f7d815, 0x11f2ad4d, 0x79f18185, + 0x6414310c, 0x0c171dc4, 0xb412689c, 0xdc114454, + 0x1382f328, 0x7b81dfe0, 0xc384aab8, 0xab878670, + 0xb66236f9, 0xde611a31, 0x66646f69, 0x0e6743a1, + 0x5daf0e7b, 0x35ac22b3, 0x8da957eb, 0xe5aa7b23, + 0xf84fcbaa, 0x904ce762, 0x2849923a, 0x404abef2, + 0xb2828a33, 0xda81a6fb, 0x6284d3a3, 0x0a87ff6b, + 0x17624fe2, 0x7f61632a, 0xc7641672, 0xaf673aba, + 0xfcaf7760, 0x94ac5ba8, 0x2ca92ef0, 0x44aa0238, + 0x594fb2b1, 0x314c9e79, 0x8949eb21, 0xe14ac7e9, + 0x2ed97095, 0x46da5c5d, 0xfedf2905, 0x96dc05cd, + 0x8b39b544, 0xe33a998c, 0x5b3fecd4, 0x333cc01c, + 0x60f48dc6, 0x08f7a10e, 0xb0f2d456, 0xd8f1f89e, + 0xc5144817, 0xad1764df, 0x15121187, 0x7d113d4f + },{ + 0x00000000, 0x493c7d27, 0x9278fa4e, 0xdb448769, + 0x211d826d, 0x6821ff4a, 0xb3657823, 0xfa590504, + 0x423b04da, 0x0b0779fd, 0xd043fe94, 0x997f83b3, + 0x632686b7, 0x2a1afb90, 0xf15e7cf9, 0xb86201de, + 0x847609b4, 0xcd4a7493, 0x160ef3fa, 0x5f328edd, + 0xa56b8bd9, 0xec57f6fe, 0x37137197, 0x7e2f0cb0, + 0xc64d0d6e, 0x8f717049, 0x5435f720, 0x1d098a07, + 0xe7508f03, 0xae6cf224, 0x7528754d, 0x3c14086a, + 0x0d006599, 0x443c18be, 0x9f789fd7, 0xd644e2f0, + 0x2c1de7f4, 0x65219ad3, 0xbe651dba, 0xf759609d, + 0x4f3b6143, 0x06071c64, 0xdd439b0d, 0x947fe62a, + 0x6e26e32e, 0x271a9e09, 0xfc5e1960, 0xb5626447, + 0x89766c2d, 0xc04a110a, 0x1b0e9663, 0x5232eb44, + 0xa86bee40, 0xe1579367, 0x3a13140e, 0x732f6929, + 0xcb4d68f7, 0x827115d0, 0x593592b9, 0x1009ef9e, + 0xea50ea9a, 0xa36c97bd, 0x782810d4, 0x31146df3, + 0x1a00cb32, 0x533cb615, 0x8878317c, 0xc1444c5b, + 0x3b1d495f, 0x72213478, 0xa965b311, 0xe059ce36, + 0x583bcfe8, 0x1107b2cf, 0xca4335a6, 0x837f4881, + 0x79264d85, 0x301a30a2, 0xeb5eb7cb, 0xa262caec, + 0x9e76c286, 0xd74abfa1, 0x0c0e38c8, 0x453245ef, + 0xbf6b40eb, 0xf6573dcc, 0x2d13baa5, 0x642fc782, + 0xdc4dc65c, 0x9571bb7b, 0x4e353c12, 0x07094135, + 0xfd504431, 0xb46c3916, 0x6f28be7f, 0x2614c358, + 0x1700aeab, 0x5e3cd38c, 0x857854e5, 0xcc4429c2, + 0x361d2cc6, 0x7f2151e1, 0xa465d688, 0xed59abaf, + 0x553baa71, 0x1c07d756, 0xc743503f, 0x8e7f2d18, + 0x7426281c, 0x3d1a553b, 0xe65ed252, 0xaf62af75, + 0x9376a71f, 0xda4ada38, 0x010e5d51, 0x48322076, + 0xb26b2572, 0xfb575855, 0x2013df3c, 0x692fa21b, + 0xd14da3c5, 0x9871dee2, 0x4335598b, 0x0a0924ac, + 0xf05021a8, 0xb96c5c8f, 0x6228dbe6, 0x2b14a6c1, + 0x34019664, 0x7d3deb43, 0xa6796c2a, 0xef45110d, + 0x151c1409, 0x5c20692e, 0x8764ee47, 0xce589360, + 0x763a92be, 0x3f06ef99, 0xe44268f0, 0xad7e15d7, + 0x572710d3, 0x1e1b6df4, 0xc55fea9d, 0x8c6397ba, + 0xb0779fd0, 0xf94be2f7, 0x220f659e, 0x6b3318b9, + 0x916a1dbd, 0xd856609a, 0x0312e7f3, 0x4a2e9ad4, + 0xf24c9b0a, 0xbb70e62d, 0x60346144, 0x29081c63, + 0xd3511967, 0x9a6d6440, 0x4129e329, 0x08159e0e, + 0x3901f3fd, 0x703d8eda, 0xab7909b3, 0xe2457494, + 0x181c7190, 0x51200cb7, 0x8a648bde, 0xc358f6f9, + 0x7b3af727, 0x32068a00, 0xe9420d69, 0xa07e704e, + 0x5a27754a, 0x131b086d, 0xc85f8f04, 0x8163f223, + 0xbd77fa49, 0xf44b876e, 0x2f0f0007, 0x66337d20, + 0x9c6a7824, 0xd5560503, 0x0e12826a, 0x472eff4d, + 0xff4cfe93, 0xb67083b4, 0x6d3404dd, 0x240879fa, + 0xde517cfe, 0x976d01d9, 0x4c2986b0, 0x0515fb97, + 0x2e015d56, 0x673d2071, 0xbc79a718, 0xf545da3f, + 0x0f1cdf3b, 0x4620a21c, 0x9d642575, 0xd4585852, + 0x6c3a598c, 0x250624ab, 0xfe42a3c2, 0xb77edee5, + 0x4d27dbe1, 0x041ba6c6, 0xdf5f21af, 0x96635c88, + 0xaa7754e2, 0xe34b29c5, 0x380faeac, 0x7133d38b, + 0x8b6ad68f, 0xc256aba8, 0x19122cc1, 0x502e51e6, + 0xe84c5038, 0xa1702d1f, 0x7a34aa76, 0x3308d751, + 0xc951d255, 0x806daf72, 0x5b29281b, 0x1215553c, + 0x230138cf, 0x6a3d45e8, 0xb179c281, 0xf845bfa6, + 0x021cbaa2, 0x4b20c785, 0x906440ec, 0xd9583dcb, + 0x613a3c15, 0x28064132, 0xf342c65b, 0xba7ebb7c, + 0x4027be78, 0x091bc35f, 0xd25f4436, 0x9b633911, + 0xa777317b, 0xee4b4c5c, 0x350fcb35, 0x7c33b612, + 0x866ab316, 0xcf56ce31, 0x14124958, 0x5d2e347f, + 0xe54c35a1, 0xac704886, 0x7734cfef, 0x3e08b2c8, + 0xc451b7cc, 0x8d6dcaeb, 0x56294d82, 0x1f1530a5 + } +#endif +}; + +/* + * __wt_cksum_sw -- + * Return a checksum for a chunk of memory, computed in software. + */ +static uint32_t +__wt_cksum_sw(const void *chunk, size_t len) +{ + uint32_t crc, next; + size_t nqwords; + const uint8_t *p; + + crc = 0xffffffff; + + /* Checksum one byte at a time to the first 4B boundary. */ + for (p = chunk; + ((uintptr_t)p & (sizeof(uint32_t) - 1)) != 0 && + len > 0; ++p, --len) +#ifdef WORDS_BIGENDIAN + crc = g_crc_slicing[0][((crc >> 24) ^ *p) & 0xFF] ^ (crc << 8); +#else + crc = g_crc_slicing[0][(crc ^ *p) & 0xFF] ^ (crc >> 8); +#endif + + /* Checksum in 8B chunks. */ + for (nqwords = len / sizeof(uint64_t); nqwords; nqwords--) { + crc ^= *(uint32_t *)p; + p += sizeof(uint32_t); + next = *(uint32_t *)p; + p += sizeof(uint32_t); + crc = +#ifdef WORDS_BIGENDIAN + g_crc_slicing[4][(crc ) & 0xFF] ^ + g_crc_slicing[5][(crc >> 8) & 0xFF] ^ + g_crc_slicing[6][(crc >> 16) & 0xFF] ^ + g_crc_slicing[7][(crc >> 24)] ^ + g_crc_slicing[0][(next ) & 0xFF] ^ + g_crc_slicing[1][(next >> 8) & 0xFF] ^ + g_crc_slicing[2][(next >> 16) & 0xFF] ^ + g_crc_slicing[3][(next >> 24)]; +#else + g_crc_slicing[7][(crc ) & 0xFF] ^ + g_crc_slicing[6][(crc >> 8) & 0xFF] ^ + g_crc_slicing[5][(crc >> 16) & 0xFF] ^ + g_crc_slicing[4][(crc >> 24)] ^ + g_crc_slicing[3][(next ) & 0xFF] ^ + g_crc_slicing[2][(next >> 8) & 0xFF] ^ + g_crc_slicing[1][(next >> 16) & 0xFF] ^ + g_crc_slicing[0][(next >> 24)]; +#endif + } + + /* Checksum trailing bytes one byte at a time. */ +#ifdef WORDS_BIGENDIAN + for (len &= 0x7; len > 0; ++p, len--) + crc = g_crc_slicing[0][((crc >> 24) ^ *p) & 0xFF] ^ (crc << 8); + + /* Do final byte swap to produce a result identical to little endian */ + crc = + ((crc << 24) & 0xFF000000) | + ((crc << 8) & 0x00FF0000) | + ((crc >> 8) & 0x0000FF00) | + ((crc >> 24) & 0x000000FF); +#else + for (len &= 0x7; len > 0; ++p, len--) + crc = g_crc_slicing[0][(crc ^ *p) & 0xFF] ^ (crc >> 8); +#endif + return (~crc); +} + +#if (defined(__amd64) || defined(__x86_64)) +/* + * __wt_cksum_hw -- + * Return a checksum for a chunk of memory, computed in hardware + * using 8 byte steps. + */ +static uint32_t +__wt_cksum_hw(const void *chunk, size_t len) +{ + uint32_t crc; + size_t nqwords; + const uint8_t *p; + const uint64_t *p64; + + crc = 0xffffffff; + + /* Checksum one byte at a time to the first 4B boundary. */ + for (p = chunk; + ((uintptr_t)p & (sizeof(uint32_t) - 1)) != 0 && + len > 0; ++p, --len) { + __asm__ __volatile__( + ".byte 0xF2, 0x0F, 0x38, 0xF0, 0xF1" + : "=S" (crc) + : "0" (crc), "c" (*p)); + } + + p64 = (const uint64_t *)p; + /* Checksum in 8B chunks. */ + for (nqwords = len / sizeof(uint64_t); nqwords; nqwords--) { + __asm__ __volatile__ ( + ".byte 0xF2, 0x48, 0x0F, 0x38, 0xF1, 0xF1" + : "=S"(crc) + : "0"(crc), "c" (*p64)); + p64++; + } + + /* Checksum trailing bytes one byte at a time. */ + p = (const uint8_t *)p64; + for (len &= 0x7; len > 0; ++p, len--) { + __asm__ __volatile__( + ".byte 0xF2, 0x0F, 0x38, 0xF0, 0xF1" + : "=S" (crc) + : "0" (crc), "c" (*p)); + } + return (~crc); +} +#endif + +#if defined(_M_AMD64) +/* + * __wt_cksum_hw -- + * Return a checksum for a chunk of memory, computed in hardware + * using 8 byte steps. + */ +static uint32_t +__wt_cksum_hw(const void *chunk, size_t len) +{ + uint32_t crc; + size_t nqwords; + const uint8_t *p; + const uint64_t *p64; + + crc = 0xffffffff; + + /* Checksum one byte at a time to the first 4B boundary. */ + for (p = chunk; + ((uintptr_t)p & (sizeof(uint32_t) - 1)) != 0 && + len > 0; ++p, --len) { + crc = _mm_crc32_u8(crc, *p); + } + + p64 = (const uint64_t *)p; + /* Checksum in 8B chunks. */ + for (nqwords = len / sizeof(uint64_t); nqwords; nqwords--) { + crc = (uint32_t)_mm_crc32_u64(crc, *p64); + p64++; + } + + /* Checksum trailing bytes one byte at a time. */ + p = (const uint8_t *)p64; + for (len &= 0x7; len > 0; ++p, len--) { + crc = _mm_crc32_u8(crc, *p); + } + + return (~crc); +} +#endif + +/* + * __wt_cksum -- + * WiredTiger: return a checksum for a chunk of memory. + */ +uint32_t +__wt_cksum(const void *chunk, size_t len) +{ + return (*__wt_cksum_func)(chunk, len); +} + +/* + * __wt_cksum_init -- + * WiredTiger: detect CRC hardware and set the checksum function. + */ +void +__wt_cksum_init(void) +{ +#if (defined(__amd64) || defined(__x86_64)) + unsigned int eax, ebx, ecx, edx; + + __asm__ __volatile__ ( + "cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (1)); + +#define CPUID_ECX_HAS_SSE42 (1 << 20) + if (ecx & CPUID_ECX_HAS_SSE42) + __wt_cksum_func = __wt_cksum_hw; + else + __wt_cksum_func = __wt_cksum_sw; + +#elif defined(_M_AMD64) + int cpuInfo[4]; + + __cpuid(cpuInfo, 1); + +#define CPUID_ECX_HAS_SSE42 (1 << 20) + if (cpuInfo[2] & CPUID_ECX_HAS_SSE42) + __wt_cksum_func = __wt_cksum_hw; + else + __wt_cksum_func = __wt_cksum_sw; +#else + __wt_cksum_func = __wt_cksum_sw; +#endif +} diff --git a/src/third_party/wiredtiger/src/checksum/zseries/LICENSE.TXT b/src/third_party/wiredtiger/src/checksum/zseries/LICENSE.TXT new file mode 100644 index 00000000000..9946c98f568 --- /dev/null +++ b/src/third_party/wiredtiger/src/checksum/zseries/LICENSE.TXT @@ -0,0 +1,482 @@ +Copyright (C) 2016 IBM Corp. + +Author(s): + Hendrik Brueckner <brueckner@linux.vnet.ibm.com> + Anton Blanchard <anton@au.ibm.com> + Bryan Chan <bryan.chan@ca.ibm.com> + Chris Zou <chriszou@ca.ibm.com> + +crc32-s390x is free software; you can redistribute it and/or modify it +under the terms of either: + + a) the GNU General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) + any later version, or + b) the Apache License, Version 2.0 + + + + + + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + + + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/src/third_party/wiredtiger/src/checksum/zseries/README.md b/src/third_party/wiredtiger/src/checksum/zseries/README.md new file mode 100644 index 00000000000..5d59ceb6f6a --- /dev/null +++ b/src/third_party/wiredtiger/src/checksum/zseries/README.md @@ -0,0 +1,61 @@ +crc32-s390x +=========== + +A library of functions for accelerating CRC32 calculations using the +Vector Galois Field Multiply instruction family instructions introduced in +the z13. The Vector Extension Facility for z/Architecture provides two +instructions to perform a binary Galois field multiplication. Both +instructions (VGFM and VGFMA) can operate on different element sizes. +For the 32-bit CRC computation, doublewords are used throughout the +implementation. + +Quick start +----------- + +Type make to generate a static library libcrc32\_s390x.a. + +The library provides functions to compute CRC-32 (IEEE 802.3) and +CRC-32C (Castagnoli), with optional bit reflection (with the `*_le` +versions of the functions). + +Function prototypes are declared in crc32-s390x.h. A sample program +crc32-cli.c shows how the library is used. + +Testing +------- + +The correctness of the hardware-accelerated implementation is verified +with the pure-software Rocksoft Model CRC algorithm. There are four +variants of the test, each of which exercise one type of CRC on random +data with random alignment and buffer sizes, in an infinite loop: + + ./crc32_be_test + ./crc32_le_test + ./crc32c_be_test + ./crc32c_le_test + +If the hardware-accelerated algorithm ever returns a different result +than the Rocksoft Model, the test will print messages to indicate the +errors. + +Performance +----------- + +The performance of the hardware-accelerated implemention is compared +with the slicing-by-8 algorithm. Testing 500000 iterations of a CRC +of 32kB of data showed a 70-times speed-up: + + $ time ./crc32_sw_bench 32768 500000 + CRC: a98177aa + + real 0m21.862s + user 0m21.859s + sys 0m0.002s + + $ time ./crc32_vx_bench 32768 500000 + CRC: a98177aa + + real 0m0.323s + user 0m0.323s + sys 0m0.000s + diff --git a/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c b/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c new file mode 100644 index 00000000000..daf7ce06c53 --- /dev/null +++ b/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c @@ -0,0 +1,92 @@ +/* + * CRC-32 algorithms implemented with the z/Architecture + * Vector Extension Facility. + * + * Copyright IBM Corp. 2015 + * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> + * + */ +#include <sys/types.h> +#include <endian.h> +#include "crc32-s390x.h" +#include "slicing-consts.h" + +#define VX_MIN_LEN 64 +#define VX_ALIGNMENT 16UL +#define VX_ALIGN_MASK (VX_ALIGNMENT - 1) + +/* Prototypes for functions in assembly files */ +unsigned int __wt_crc32c_le_vgfm_16(unsigned int crc, const unsigned char *buf, size_t size); + +/* Pure C implementations of CRC, one byte at a time */ +unsigned int __wt_crc32c_le(unsigned int crc, const unsigned char *buf, size_t len){ + crc = htole32(crc); + while (len--) + crc = crc32ctable_le[0][((crc >> 24) ^ *buf++) & 0xFF] ^ (crc << 8); + crc = le32toh(crc); + return crc; +} + +/* + * DEFINE_CRC32_VX() - Define a CRC-32 function using the vector extension + * + * Creates a function to perform a particular CRC-32 computation. Depending + * on the message buffer, the hardware-accelerated or software implementation + * is used. Note that the message buffer is aligned to improve fetch + * operations of VECTOR LOAD MULTIPLE instructions. + * + */ +#define DEFINE_CRC32_VX(___fname, ___crc32_vx, ___crc32_sw) \ + unsigned int ___fname(unsigned int crc, \ + const unsigned char *data, \ + size_t datalen) \ + { \ + unsigned long prealign, aligned, remaining; \ + \ + if ((unsigned long)data & VX_ALIGN_MASK) { \ + prealign = VX_ALIGNMENT - \ + ((unsigned long)data & VX_ALIGN_MASK); \ + datalen -= prealign; \ + crc = ___crc32_sw(crc, data, prealign); \ + data = data + prealign; \ + } \ + \ + if (datalen < VX_MIN_LEN) \ + return ___crc32_sw(crc, data, datalen); \ + \ + aligned = datalen & ~VX_ALIGN_MASK; \ + remaining = datalen & VX_ALIGN_MASK; \ + \ + crc = ___crc32_vx(crc, data, aligned); \ + data = data + aligned; \ + \ + if (remaining) \ + crc = ___crc32_sw(crc, data, remaining); \ + \ + return crc; \ + } + +/* Main CRC-32 functions */ +DEFINE_CRC32_VX(__wt_crc32c_le_vx, __wt_crc32c_le_vgfm_16, __wt_crc32c_le) + +#include "wt_internal.h" + +/* + * __wt_cksum -- + * WiredTiger: return a checksum for a chunk of memory. + */ +unsigned int +__wt_cksum(const void *chunk, size_t len) +{ + return (~__wt_crc32c_le_vx(0xffffffff, chunk, len)); +} + +/* + * __wt_cksum_init -- + * WiredTiger: detect CRC hardware and set the checksum function. + */ +void +__wt_cksum_init(void) +{ + /* None needed. */ +} diff --git a/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.h b/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.h new file mode 100644 index 00000000000..14d6c07f62e --- /dev/null +++ b/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.h @@ -0,0 +1,12 @@ +/* + * Copyright IBM Corp. 2015 + */ +#include <sys/types.h> + +/* Portable implementations of CRC-32 (IEEE and Castagnoli), both + big-endian and little-endian variants. */ +unsigned int __wt_crc32c_le(unsigned int, const unsigned char *, size_t); + +/* Hardware-accelerated versions of the above. It is up to the caller + to detect the availability of vector facility and kernel support. */ +unsigned int __wt_crc32c_le_vx(unsigned int, const unsigned char *, size_t); diff --git a/src/third_party/wiredtiger/src/checksum/zseries/crc32le-vx.S b/src/third_party/wiredtiger/src/checksum/zseries/crc32le-vx.S new file mode 100644 index 00000000000..0f1392b0952 --- /dev/null +++ b/src/third_party/wiredtiger/src/checksum/zseries/crc32le-vx.S @@ -0,0 +1,280 @@ +/* + * Hardware-accelerated CRC-32 variants for Linux on z Systems + * + * Use the z/Architecture Vector Extension Facility to accelerate the + * computing of bit-reflected CRC-32 checksums for IEEE 802.3 Ethernet + * and Castagnoli. + * + * This CRC-32 implementation algorithm is bit-reflected and processes + * the least-significant bit first (Little-Endian). + * + * Copyright IBM Corp. 2015 + * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> + */ + +#include "vx-insn.h" + +/* Vector register range containing CRC-32 constants */ +#define CONST_PERM_LE2BE %v9 +#define CONST_R2R1 %v10 +#define CONST_R4R3 %v11 +#define CONST_R5 %v12 +#define CONST_RU_POLY %v13 +#define CONST_CRC_POLY %v14 + +.data +.align 8 + +/* + * The CRC-32 constant block contains reduction constants to fold and + * process particular chunks of the input data stream in parallel. + * + * For the CRC-32 variants, the constants are precomputed according to + * these definitions: + * + * R1 = [(x4*128+32 mod P'(x) << 32)]' << 1 + * R2 = [(x4*128-32 mod P'(x) << 32)]' << 1 + * R3 = [(x128+32 mod P'(x) << 32)]' << 1 + * R4 = [(x128-32 mod P'(x) << 32)]' << 1 + * R5 = [(x64 mod P'(x) << 32)]' << 1 + * R6 = [(x32 mod P'(x) << 32)]' << 1 + * + * The bit-reflected Barret reduction constant, u', is defined as + * the bit reversal of floor(x**64 / P(x)). + * + * where P(x) is the polynomial in the normal domain and the P'(x) is the + * polynomial in the reversed (bit-reflected) domain. + * + * CRC-32 (IEEE 802.3 Ethernet, ...) polynomials: + * + * P(x) = 0x04C11DB7 + * P'(x) = 0xEDB88320 + * + * CRC-32C (Castagnoli) polynomials: + * + * P(x) = 0x1EDC6F41 + * P'(x) = 0x82F63B78 + */ + +.Lconstants_CRC_32_LE: + .octa 0x0F0E0D0C0B0A09080706050403020100 # BE->LE mask + .quad 0x1c6e41596, 0x154442bd4 # R2, R1 + .quad 0x0ccaa009e, 0x1751997d0 # R4, R3 + .octa 0x163cd6124 # R5 + .octa 0x1F7011641 # u' + .octa 0x1DB710641 # P'(x) << 1 + +.Lconstants_CRC_32C_LE: + .octa 0x0F0E0D0C0B0A09080706050403020100 # BE->LE mask + .quad 0x09e4addf8, 0x740eef02 # R2, R1 + .quad 0x14cd00bd6, 0xf20c0dfe # R4, R3 + .octa 0x0dd45aab8 # R5 + .octa 0x0dea713f1 # u' + .octa 0x105ec76f0 # P'(x) << 1 + +.previous + +.text +/* + * The CRC-32 functions use these calling conventions: + * + * Parameters: + * + * %r2: Initial CRC value, typically ~0; and final CRC (return) value. + * %r3: Input buffer pointer, performance might be improved if the + * buffer is on a doubleword boundary. + * %r4: Length of the buffer, must be 64 bytes or greater. + * + * Register usage: + * + * %r5: CRC-32 constant pool base pointer. + * V0: Initial CRC value and intermediate constants and results. + * V1..V4: Data for CRC computation. + * V5..V8: Next data chunks that are fetched from the input buffer. + * V9: Constant for BE->LE conversion and shift operations + * + * V10..V14: CRC-32 constants. + */ + +WT_CRC32_ENTRY(__wt_crc32c_le_vgfm_16) + larl %r5,.Lconstants_CRC_32C_LE + j crc32_le_vgfm_generic + +crc32_le_vgfm_generic: + /* Preserve non-volatile vector registers. */ + stmg %r14,%r15,112(%r15) + lay %r15,-128(%r15) + VSTM %v8,%v15,0,%r15 + + /* Load CRC-32 constants into multiple vector registers. */ + VLM CONST_PERM_LE2BE,CONST_CRC_POLY,0,%r5 + + /* + * Load the initial CRC value. + * + * The CRC value is loaded into the rightmost word of the + * vector register and is later XORed with the LSB portion + * of the loaded input data. + */ + VZERO %v0 /* Clear V0 */ + VLVGF %v0,%r2,3 /* Load CRC into rightmost word */ + + /* Load a 64-byte data chunk and XOR with CRC */ + VLM %v1,%v4,0,%r3 /* 64-bytes into V1..V4 */ + + /* Reflect the data since the CRC operates in the bit-reflected domain. */ + VPERM %v1,%v1,%v1,CONST_PERM_LE2BE + VPERM %v2,%v2,%v2,CONST_PERM_LE2BE + VPERM %v3,%v3,%v3,CONST_PERM_LE2BE + VPERM %v4,%v4,%v4,CONST_PERM_LE2BE + + VX %v1,%v0,%v1 /* V1 ^= CRC */ + aghi %r3,64 /* BUF = BUF + 64 */ + aghi %r4,-64 /* LEN = LEN - 64 */ + + /* Check remaining buffer size and jump to proper folding method. */ + cghi %r4,64 + jl .Lless_than_64bytes + +.Lfold_64bytes_loop: + /* Load the next 64-byte data chunk into V5 to V8 */ + VLM %v5,%v8,0,%r3 + VPERM %v5,%v5,%v5,CONST_PERM_LE2BE + VPERM %v6,%v6,%v6,CONST_PERM_LE2BE + VPERM %v7,%v7,%v7,CONST_PERM_LE2BE + VPERM %v8,%v8,%v8,CONST_PERM_LE2BE + + /* + * Perform a GF(2) multiplication of the doublewords in V1 with + * the R1 and R2 reduction constants in V10. The intermediate result + * is then folded (accumulated, or XOR-ed) with the next data chunk + * in V5 and stored in V1. Repeat this step for the register contents + * in V2, V3, and V4 respectively. + */ + VGFMAG %v1,CONST_R2R1,%v1,%v5 + VGFMAG %v2,CONST_R2R1,%v2,%v6 + VGFMAG %v3,CONST_R2R1,%v3,%v7 + VGFMAG %v4,CONST_R2R1,%v4,%v8 + + /* Adjust buffer pointer and length for next loop. */ + aghi %r3,64 /* BUF = BUF + 64 */ + aghi %r4,-64 /* LEN = LEN - 64 */ + + cghi %r4,64 + jnl .Lfold_64bytes_loop + +.Lless_than_64bytes: + /* + * Fold V1 to V4 into a single 128-bit value in V1. Multiply V1 with R3 + * and R4 and accumulating the next 128-bit chunk until a single 128-bit + * value remains. + */ + VGFMAG %v1,CONST_R4R3,%v1,%v2 + VGFMAG %v1,CONST_R4R3,%v1,%v3 + VGFMAG %v1,CONST_R4R3,%v1,%v4 + + /* Check whether to continue with 64-bit folding. */ + cghi %r4,16 + jl .Lfinal_fold + +.Lfold_16bytes_loop: + + VL %v2,0,,%r3 /* Load next data chunk */ + VPERM %v2,%v2,%v2,CONST_PERM_LE2BE + VGFMAG %v1,CONST_R4R3,%v1,%v2 /* Fold next data chunk */ + + /* Adjust buffer pointer and size for folding next data chunk. */ + aghi %r3,16 + aghi %r4,-16 + + /* Process remaining data chunks. */ + cghi %r4,16 + jnl .Lfold_16bytes_loop + +.Lfinal_fold: + /* + * Set up a vector register for byte shifts. The shift value must + * be loaded in bits 1-4 in byte element 7 of a vector register. + * Shift by 8 bytes: 0x40 + * Shift by 4 bytes: 0x20 + */ + VLEIB %v9,0x40,7 + + /* + * Prepare V0 for the next GF(2) multiplication: shift V0 by 8 bytes + * to move R4 into the rightmost doubleword and set the leftmost + * doubleword to 0x1. + */ + VSRLB %v0,CONST_R4R3,%v9 + VLEIG %v0,1,0 + + /* + * Compute GF(2) product of V1 and V0. The rightmost doubleword + * of V1 is multiplied with R4. The leftmost doubleword of V1 is + * multiplied by 0x1 and is then XORed with rightmost product. + * Implicitly, the intermediate leftmost product becomes padded + */ + VGFMG %v1,%v0,%v1 + + /* + * Now do the final 32-bit fold by multiplying the rightmost word + * in V1 with R5 and XOR the result with the remaining bits in V1. + * + * To achieve this by a single VGFMAG, right shift V1 by a word + * and store the result in V2 which is then accumulated. Use the + * vector unpack instruction to load the rightmost half of the + * doubleword into the rightmost doubleword element of V1; the other + * half is loaded in the leftmost doubleword. + * The vector register with CONST_R5 contains the R5 constant in the + * rightmost doubleword and the leftmost doubleword is zero to ignore + * the leftmost product of V1. + */ + VLEIB %v9,0x20,7 /* Shift by words */ + VSRLB %v2,%v1,%v9 /* Store remaining bits in V2 */ + VUPLLF %v1,%v1 /* Split rightmost doubleword */ + VGFMAG %v1,CONST_R5,%v1,%v2 /* V1 = (V1 * R5) XOR V2 */ + + /* + * Apply a Barret reduction to compute the final 32-bit CRC value. + * + * The input values to the Barret reduction are the degree-63 polynomial + * in V1 (R(x)), degree-32 generator polynomial, and the reduction + * constant u. The Barret reduction result is the CRC value of R(x) mod + * P(x). + * + * The Barret reduction algorithm is defined as: + * + * 1. T1(x) = floor( R(x) / x^32 ) GF2MUL u + * 2. T2(x) = floor( T1(x) / x^32 ) GF2MUL P(x) + * 3. C(x) = R(x) XOR T2(x) mod x^32 + * + * Note: The leftmost doubleword of vector register containing + * CONST_RU_POLY is zero and, thus, the intermediate GF(2) product + * is zero and does not contribute to the final result. + */ + + /* T1(x) = floor( R(x) / x^32 ) GF2MUL u */ + VUPLLF %v2,%v1 + VGFMG %v2,CONST_RU_POLY,%v2 + + /* + * Compute the GF(2) product of the CRC polynomial with T1(x) in + * V2 and XOR the intermediate result, T2(x), with the value in V1. + * The final result is stored in word element 2 of V2. + */ + VUPLLF %v2,%v2 + VGFMAG %v2,CONST_CRC_POLY,%v2,%v1 + +.Ldone: + /* Move the result to R2, restore preserved registers and return. */ + VLGVF %r2,%v2,2 + VLM %v8,%v15,0,%r15 + lmg %r14,%r15,240(%r15) + br %r14 + +/* + * Make sure the stack isn't executable with GCC (regardless of platform). + */ +#ifndef __clang__ +.section .note.GNU-stack,"",@progbits +#endif diff --git a/src/third_party/wiredtiger/src/checksum/zseries/slicing-consts.h b/src/third_party/wiredtiger/src/checksum/zseries/slicing-consts.h new file mode 100644 index 00000000000..3dc11dc52af --- /dev/null +++ b/src/third_party/wiredtiger/src/checksum/zseries/slicing-consts.h @@ -0,0 +1,2096 @@ +/* CRC-32 and CRC-32C slicing-by-8 constants, for use on big-endian systems. */ +static const unsigned int __attribute__((aligned(128))) crc32table_le[8][256] = { + { + 0x00000000, 0x96300777, 0x2c610eee, 0xba510999, + 0x19c46d07, 0x8ff46a70, 0x35a563e9, 0xa395649e, + 0x3288db0e, 0xa4b8dc79, 0x1ee9d5e0, 0x88d9d297, + 0x2b4cb609, 0xbd7cb17e, 0x072db8e7, 0x911dbf90, + 0x6410b71d, 0xf220b06a, 0x4871b9f3, 0xde41be84, + 0x7dd4da1a, 0xebe4dd6d, 0x51b5d4f4, 0xc785d383, + 0x56986c13, 0xc0a86b64, 0x7af962fd, 0xecc9658a, + 0x4f5c0114, 0xd96c0663, 0x633d0ffa, 0xf50d088d, + 0xc8206e3b, 0x5e10694c, 0xe44160d5, 0x727167a2, + 0xd1e4033c, 0x47d4044b, 0xfd850dd2, 0x6bb50aa5, + 0xfaa8b535, 0x6c98b242, 0xd6c9bbdb, 0x40f9bcac, + 0xe36cd832, 0x755cdf45, 0xcf0dd6dc, 0x593dd1ab, + 0xac30d926, 0x3a00de51, 0x8051d7c8, 0x1661d0bf, + 0xb5f4b421, 0x23c4b356, 0x9995bacf, 0x0fa5bdb8, + 0x9eb80228, 0x0888055f, 0xb2d90cc6, 0x24e90bb1, + 0x877c6f2f, 0x114c6858, 0xab1d61c1, 0x3d2d66b6, + 0x9041dc76, 0x0671db01, 0xbc20d298, 0x2a10d5ef, + 0x8985b171, 0x1fb5b606, 0xa5e4bf9f, 0x33d4b8e8, + 0xa2c90778, 0x34f9000f, 0x8ea80996, 0x18980ee1, + 0xbb0d6a7f, 0x2d3d6d08, 0x976c6491, 0x015c63e6, + 0xf4516b6b, 0x62616c1c, 0xd8306585, 0x4e0062f2, + 0xed95066c, 0x7ba5011b, 0xc1f40882, 0x57c40ff5, + 0xc6d9b065, 0x50e9b712, 0xeab8be8b, 0x7c88b9fc, + 0xdf1ddd62, 0x492dda15, 0xf37cd38c, 0x654cd4fb, + 0x5861b24d, 0xce51b53a, 0x7400bca3, 0xe230bbd4, + 0x41a5df4a, 0xd795d83d, 0x6dc4d1a4, 0xfbf4d6d3, + 0x6ae96943, 0xfcd96e34, 0x468867ad, 0xd0b860da, + 0x732d0444, 0xe51d0333, 0x5f4c0aaa, 0xc97c0ddd, + 0x3c710550, 0xaa410227, 0x10100bbe, 0x86200cc9, + 0x25b56857, 0xb3856f20, 0x09d466b9, 0x9fe461ce, + 0x0ef9de5e, 0x98c9d929, 0x2298d0b0, 0xb4a8d7c7, + 0x173db359, 0x810db42e, 0x3b5cbdb7, 0xad6cbac0, + 0x2083b8ed, 0xb6b3bf9a, 0x0ce2b603, 0x9ad2b174, + 0x3947d5ea, 0xaf77d29d, 0x1526db04, 0x8316dc73, + 0x120b63e3, 0x843b6494, 0x3e6a6d0d, 0xa85a6a7a, + 0x0bcf0ee4, 0x9dff0993, 0x27ae000a, 0xb19e077d, + 0x44930ff0, 0xd2a30887, 0x68f2011e, 0xfec20669, + 0x5d5762f7, 0xcb676580, 0x71366c19, 0xe7066b6e, + 0x761bd4fe, 0xe02bd389, 0x5a7ada10, 0xcc4add67, + 0x6fdfb9f9, 0xf9efbe8e, 0x43beb717, 0xd58eb060, + 0xe8a3d6d6, 0x7e93d1a1, 0xc4c2d838, 0x52f2df4f, + 0xf167bbd1, 0x6757bca6, 0xdd06b53f, 0x4b36b248, + 0xda2b0dd8, 0x4c1b0aaf, 0xf64a0336, 0x607a0441, + 0xc3ef60df, 0x55df67a8, 0xef8e6e31, 0x79be6946, + 0x8cb361cb, 0x1a8366bc, 0xa0d26f25, 0x36e26852, + 0x95770ccc, 0x03470bbb, 0xb9160222, 0x2f260555, + 0xbe3bbac5, 0x280bbdb2, 0x925ab42b, 0x046ab35c, + 0xa7ffd7c2, 0x31cfd0b5, 0x8b9ed92c, 0x1daede5b, + 0xb0c2649b, 0x26f263ec, 0x9ca36a75, 0x0a936d02, + 0xa906099c, 0x3f360eeb, 0x85670772, 0x13570005, + 0x824abf95, 0x147ab8e2, 0xae2bb17b, 0x381bb60c, + 0x9b8ed292, 0x0dbed5e5, 0xb7efdc7c, 0x21dfdb0b, + 0xd4d2d386, 0x42e2d4f1, 0xf8b3dd68, 0x6e83da1f, + 0xcd16be81, 0x5b26b9f6, 0xe177b06f, 0x7747b718, + 0xe65a0888, 0x706a0fff, 0xca3b0666, 0x5c0b0111, + 0xff9e658f, 0x69ae62f8, 0xd3ff6b61, 0x45cf6c16, + 0x78e20aa0, 0xeed20dd7, 0x5483044e, 0xc2b30339, + 0x612667a7, 0xf71660d0, 0x4d476949, 0xdb776e3e, + 0x4a6ad1ae, 0xdc5ad6d9, 0x660bdf40, 0xf03bd837, + 0x53aebca9, 0xc59ebbde, 0x7fcfb247, 0xe9ffb530, + 0x1cf2bdbd, 0x8ac2baca, 0x3093b353, 0xa6a3b424, + 0x0536d0ba, 0x9306d7cd, 0x2957de54, 0xbf67d923, + 0x2e7a66b3, 0xb84a61c4, 0x021b685d, 0x942b6f2a, + 0x37be0bb4, 0xa18e0cc3, 0x1bdf055a, 0x8def022d + },{ + 0x00000000, 0x41311b19, 0x82623632, 0xc3532d2b, + 0x04c56c64, 0x45f4777d, 0x86a75a56, 0xc796414f, + 0x088ad9c8, 0x49bbc2d1, 0x8ae8effa, 0xcbd9f4e3, + 0x0c4fb5ac, 0x4d7eaeb5, 0x8e2d839e, 0xcf1c9887, + 0x5112c24a, 0x1023d953, 0xd370f478, 0x9241ef61, + 0x55d7ae2e, 0x14e6b537, 0xd7b5981c, 0x96848305, + 0x59981b82, 0x18a9009b, 0xdbfa2db0, 0x9acb36a9, + 0x5d5d77e6, 0x1c6c6cff, 0xdf3f41d4, 0x9e0e5acd, + 0xa2248495, 0xe3159f8c, 0x2046b2a7, 0x6177a9be, + 0xa6e1e8f1, 0xe7d0f3e8, 0x2483dec3, 0x65b2c5da, + 0xaaae5d5d, 0xeb9f4644, 0x28cc6b6f, 0x69fd7076, + 0xae6b3139, 0xef5a2a20, 0x2c09070b, 0x6d381c12, + 0xf33646df, 0xb2075dc6, 0x715470ed, 0x30656bf4, + 0xf7f32abb, 0xb6c231a2, 0x75911c89, 0x34a00790, + 0xfbbc9f17, 0xba8d840e, 0x79dea925, 0x38efb23c, + 0xff79f373, 0xbe48e86a, 0x7d1bc541, 0x3c2ade58, + 0x054f79f0, 0x447e62e9, 0x872d4fc2, 0xc61c54db, + 0x018a1594, 0x40bb0e8d, 0x83e823a6, 0xc2d938bf, + 0x0dc5a038, 0x4cf4bb21, 0x8fa7960a, 0xce968d13, + 0x0900cc5c, 0x4831d745, 0x8b62fa6e, 0xca53e177, + 0x545dbbba, 0x156ca0a3, 0xd63f8d88, 0x970e9691, + 0x5098d7de, 0x11a9ccc7, 0xd2fae1ec, 0x93cbfaf5, + 0x5cd76272, 0x1de6796b, 0xdeb55440, 0x9f844f59, + 0x58120e16, 0x1923150f, 0xda703824, 0x9b41233d, + 0xa76bfd65, 0xe65ae67c, 0x2509cb57, 0x6438d04e, + 0xa3ae9101, 0xe29f8a18, 0x21cca733, 0x60fdbc2a, + 0xafe124ad, 0xeed03fb4, 0x2d83129f, 0x6cb20986, + 0xab2448c9, 0xea1553d0, 0x29467efb, 0x687765e2, + 0xf6793f2f, 0xb7482436, 0x741b091d, 0x352a1204, + 0xf2bc534b, 0xb38d4852, 0x70de6579, 0x31ef7e60, + 0xfef3e6e7, 0xbfc2fdfe, 0x7c91d0d5, 0x3da0cbcc, + 0xfa368a83, 0xbb07919a, 0x7854bcb1, 0x3965a7a8, + 0x4b98833b, 0x0aa99822, 0xc9fab509, 0x88cbae10, + 0x4f5def5f, 0x0e6cf446, 0xcd3fd96d, 0x8c0ec274, + 0x43125af3, 0x022341ea, 0xc1706cc1, 0x804177d8, + 0x47d73697, 0x06e62d8e, 0xc5b500a5, 0x84841bbc, + 0x1a8a4171, 0x5bbb5a68, 0x98e87743, 0xd9d96c5a, + 0x1e4f2d15, 0x5f7e360c, 0x9c2d1b27, 0xdd1c003e, + 0x120098b9, 0x533183a0, 0x9062ae8b, 0xd153b592, + 0x16c5f4dd, 0x57f4efc4, 0x94a7c2ef, 0xd596d9f6, + 0xe9bc07ae, 0xa88d1cb7, 0x6bde319c, 0x2aef2a85, + 0xed796bca, 0xac4870d3, 0x6f1b5df8, 0x2e2a46e1, + 0xe136de66, 0xa007c57f, 0x6354e854, 0x2265f34d, + 0xe5f3b202, 0xa4c2a91b, 0x67918430, 0x26a09f29, + 0xb8aec5e4, 0xf99fdefd, 0x3accf3d6, 0x7bfde8cf, + 0xbc6ba980, 0xfd5ab299, 0x3e099fb2, 0x7f3884ab, + 0xb0241c2c, 0xf1150735, 0x32462a1e, 0x73773107, + 0xb4e17048, 0xf5d06b51, 0x3683467a, 0x77b25d63, + 0x4ed7facb, 0x0fe6e1d2, 0xccb5ccf9, 0x8d84d7e0, + 0x4a1296af, 0x0b238db6, 0xc870a09d, 0x8941bb84, + 0x465d2303, 0x076c381a, 0xc43f1531, 0x850e0e28, + 0x42984f67, 0x03a9547e, 0xc0fa7955, 0x81cb624c, + 0x1fc53881, 0x5ef42398, 0x9da70eb3, 0xdc9615aa, + 0x1b0054e5, 0x5a314ffc, 0x996262d7, 0xd85379ce, + 0x174fe149, 0x567efa50, 0x952dd77b, 0xd41ccc62, + 0x138a8d2d, 0x52bb9634, 0x91e8bb1f, 0xd0d9a006, + 0xecf37e5e, 0xadc26547, 0x6e91486c, 0x2fa05375, + 0xe836123a, 0xa9070923, 0x6a542408, 0x2b653f11, + 0xe479a796, 0xa548bc8f, 0x661b91a4, 0x272a8abd, + 0xe0bccbf2, 0xa18dd0eb, 0x62defdc0, 0x23efe6d9, + 0xbde1bc14, 0xfcd0a70d, 0x3f838a26, 0x7eb2913f, + 0xb924d070, 0xf815cb69, 0x3b46e642, 0x7a77fd5b, + 0xb56b65dc, 0xf45a7ec5, 0x370953ee, 0x763848f7, + 0xb1ae09b8, 0xf09f12a1, 0x33cc3f8a, 0x72fd2493 + },{ + 0x00000000, 0x376ac201, 0x6ed48403, 0x59be4602, + 0xdca80907, 0xebc2cb06, 0xb27c8d04, 0x85164f05, + 0xb851130e, 0x8f3bd10f, 0xd685970d, 0xe1ef550c, + 0x64f91a09, 0x5393d808, 0x0a2d9e0a, 0x3d475c0b, + 0x70a3261c, 0x47c9e41d, 0x1e77a21f, 0x291d601e, + 0xac0b2f1b, 0x9b61ed1a, 0xc2dfab18, 0xf5b56919, + 0xc8f23512, 0xff98f713, 0xa626b111, 0x914c7310, + 0x145a3c15, 0x2330fe14, 0x7a8eb816, 0x4de47a17, + 0xe0464d38, 0xd72c8f39, 0x8e92c93b, 0xb9f80b3a, + 0x3cee443f, 0x0b84863e, 0x523ac03c, 0x6550023d, + 0x58175e36, 0x6f7d9c37, 0x36c3da35, 0x01a91834, + 0x84bf5731, 0xb3d59530, 0xea6bd332, 0xdd011133, + 0x90e56b24, 0xa78fa925, 0xfe31ef27, 0xc95b2d26, + 0x4c4d6223, 0x7b27a022, 0x2299e620, 0x15f32421, + 0x28b4782a, 0x1fdeba2b, 0x4660fc29, 0x710a3e28, + 0xf41c712d, 0xc376b32c, 0x9ac8f52e, 0xada2372f, + 0xc08d9a70, 0xf7e75871, 0xae591e73, 0x9933dc72, + 0x1c259377, 0x2b4f5176, 0x72f11774, 0x459bd575, + 0x78dc897e, 0x4fb64b7f, 0x16080d7d, 0x2162cf7c, + 0xa4748079, 0x931e4278, 0xcaa0047a, 0xfdcac67b, + 0xb02ebc6c, 0x87447e6d, 0xdefa386f, 0xe990fa6e, + 0x6c86b56b, 0x5bec776a, 0x02523168, 0x3538f369, + 0x087faf62, 0x3f156d63, 0x66ab2b61, 0x51c1e960, + 0xd4d7a665, 0xe3bd6464, 0xba032266, 0x8d69e067, + 0x20cbd748, 0x17a11549, 0x4e1f534b, 0x7975914a, + 0xfc63de4f, 0xcb091c4e, 0x92b75a4c, 0xa5dd984d, + 0x989ac446, 0xaff00647, 0xf64e4045, 0xc1248244, + 0x4432cd41, 0x73580f40, 0x2ae64942, 0x1d8c8b43, + 0x5068f154, 0x67023355, 0x3ebc7557, 0x09d6b756, + 0x8cc0f853, 0xbbaa3a52, 0xe2147c50, 0xd57ebe51, + 0xe839e25a, 0xdf53205b, 0x86ed6659, 0xb187a458, + 0x3491eb5d, 0x03fb295c, 0x5a456f5e, 0x6d2fad5f, + 0x801b35e1, 0xb771f7e0, 0xeecfb1e2, 0xd9a573e3, + 0x5cb33ce6, 0x6bd9fee7, 0x3267b8e5, 0x050d7ae4, + 0x384a26ef, 0x0f20e4ee, 0x569ea2ec, 0x61f460ed, + 0xe4e22fe8, 0xd388ede9, 0x8a36abeb, 0xbd5c69ea, + 0xf0b813fd, 0xc7d2d1fc, 0x9e6c97fe, 0xa90655ff, + 0x2c101afa, 0x1b7ad8fb, 0x42c49ef9, 0x75ae5cf8, + 0x48e900f3, 0x7f83c2f2, 0x263d84f0, 0x115746f1, + 0x944109f4, 0xa32bcbf5, 0xfa958df7, 0xcdff4ff6, + 0x605d78d9, 0x5737bad8, 0x0e89fcda, 0x39e33edb, + 0xbcf571de, 0x8b9fb3df, 0xd221f5dd, 0xe54b37dc, + 0xd80c6bd7, 0xef66a9d6, 0xb6d8efd4, 0x81b22dd5, + 0x04a462d0, 0x33cea0d1, 0x6a70e6d3, 0x5d1a24d2, + 0x10fe5ec5, 0x27949cc4, 0x7e2adac6, 0x494018c7, + 0xcc5657c2, 0xfb3c95c3, 0xa282d3c1, 0x95e811c0, + 0xa8af4dcb, 0x9fc58fca, 0xc67bc9c8, 0xf1110bc9, + 0x740744cc, 0x436d86cd, 0x1ad3c0cf, 0x2db902ce, + 0x4096af91, 0x77fc6d90, 0x2e422b92, 0x1928e993, + 0x9c3ea696, 0xab546497, 0xf2ea2295, 0xc580e094, + 0xf8c7bc9f, 0xcfad7e9e, 0x9613389c, 0xa179fa9d, + 0x246fb598, 0x13057799, 0x4abb319b, 0x7dd1f39a, + 0x3035898d, 0x075f4b8c, 0x5ee10d8e, 0x698bcf8f, + 0xec9d808a, 0xdbf7428b, 0x82490489, 0xb523c688, + 0x88649a83, 0xbf0e5882, 0xe6b01e80, 0xd1dadc81, + 0x54cc9384, 0x63a65185, 0x3a181787, 0x0d72d586, + 0xa0d0e2a9, 0x97ba20a8, 0xce0466aa, 0xf96ea4ab, + 0x7c78ebae, 0x4b1229af, 0x12ac6fad, 0x25c6adac, + 0x1881f1a7, 0x2feb33a6, 0x765575a4, 0x413fb7a5, + 0xc429f8a0, 0xf3433aa1, 0xaafd7ca3, 0x9d97bea2, + 0xd073c4b5, 0xe71906b4, 0xbea740b6, 0x89cd82b7, + 0x0cdbcdb2, 0x3bb10fb3, 0x620f49b1, 0x55658bb0, + 0x6822d7bb, 0x5f4815ba, 0x06f653b8, 0x319c91b9, + 0xb48adebc, 0x83e01cbd, 0xda5e5abf, 0xed3498be + },{ + 0x00000000, 0x6567bcb8, 0x8bc809aa, 0xeeafb512, + 0x5797628f, 0x32f0de37, 0xdc5f6b25, 0xb938d79d, + 0xef28b4c5, 0x8a4f087d, 0x64e0bd6f, 0x018701d7, + 0xb8bfd64a, 0xddd86af2, 0x3377dfe0, 0x56106358, + 0x9f571950, 0xfa30a5e8, 0x149f10fa, 0x71f8ac42, + 0xc8c07bdf, 0xada7c767, 0x43087275, 0x266fcecd, + 0x707fad95, 0x1518112d, 0xfbb7a43f, 0x9ed01887, + 0x27e8cf1a, 0x428f73a2, 0xac20c6b0, 0xc9477a08, + 0x3eaf32a0, 0x5bc88e18, 0xb5673b0a, 0xd00087b2, + 0x6938502f, 0x0c5fec97, 0xe2f05985, 0x8797e53d, + 0xd1878665, 0xb4e03add, 0x5a4f8fcf, 0x3f283377, + 0x8610e4ea, 0xe3775852, 0x0dd8ed40, 0x68bf51f8, + 0xa1f82bf0, 0xc49f9748, 0x2a30225a, 0x4f579ee2, + 0xf66f497f, 0x9308f5c7, 0x7da740d5, 0x18c0fc6d, + 0x4ed09f35, 0x2bb7238d, 0xc518969f, 0xa07f2a27, + 0x1947fdba, 0x7c204102, 0x928ff410, 0xf7e848a8, + 0x3d58149b, 0x583fa823, 0xb6901d31, 0xd3f7a189, + 0x6acf7614, 0x0fa8caac, 0xe1077fbe, 0x8460c306, + 0xd270a05e, 0xb7171ce6, 0x59b8a9f4, 0x3cdf154c, + 0x85e7c2d1, 0xe0807e69, 0x0e2fcb7b, 0x6b4877c3, + 0xa20f0dcb, 0xc768b173, 0x29c70461, 0x4ca0b8d9, + 0xf5986f44, 0x90ffd3fc, 0x7e5066ee, 0x1b37da56, + 0x4d27b90e, 0x284005b6, 0xc6efb0a4, 0xa3880c1c, + 0x1ab0db81, 0x7fd76739, 0x9178d22b, 0xf41f6e93, + 0x03f7263b, 0x66909a83, 0x883f2f91, 0xed589329, + 0x546044b4, 0x3107f80c, 0xdfa84d1e, 0xbacff1a6, + 0xecdf92fe, 0x89b82e46, 0x67179b54, 0x027027ec, + 0xbb48f071, 0xde2f4cc9, 0x3080f9db, 0x55e74563, + 0x9ca03f6b, 0xf9c783d3, 0x176836c1, 0x720f8a79, + 0xcb375de4, 0xae50e15c, 0x40ff544e, 0x2598e8f6, + 0x73888bae, 0x16ef3716, 0xf8408204, 0x9d273ebc, + 0x241fe921, 0x41785599, 0xafd7e08b, 0xcab05c33, + 0x3bb659ed, 0x5ed1e555, 0xb07e5047, 0xd519ecff, + 0x6c213b62, 0x094687da, 0xe7e932c8, 0x828e8e70, + 0xd49eed28, 0xb1f95190, 0x5f56e482, 0x3a31583a, + 0x83098fa7, 0xe66e331f, 0x08c1860d, 0x6da63ab5, + 0xa4e140bd, 0xc186fc05, 0x2f294917, 0x4a4ef5af, + 0xf3762232, 0x96119e8a, 0x78be2b98, 0x1dd99720, + 0x4bc9f478, 0x2eae48c0, 0xc001fdd2, 0xa566416a, + 0x1c5e96f7, 0x79392a4f, 0x97969f5d, 0xf2f123e5, + 0x05196b4d, 0x607ed7f5, 0x8ed162e7, 0xebb6de5f, + 0x528e09c2, 0x37e9b57a, 0xd9460068, 0xbc21bcd0, + 0xea31df88, 0x8f566330, 0x61f9d622, 0x049e6a9a, + 0xbda6bd07, 0xd8c101bf, 0x366eb4ad, 0x53090815, + 0x9a4e721d, 0xff29cea5, 0x11867bb7, 0x74e1c70f, + 0xcdd91092, 0xa8beac2a, 0x46111938, 0x2376a580, + 0x7566c6d8, 0x10017a60, 0xfeaecf72, 0x9bc973ca, + 0x22f1a457, 0x479618ef, 0xa939adfd, 0xcc5e1145, + 0x06ee4d76, 0x6389f1ce, 0x8d2644dc, 0xe841f864, + 0x51792ff9, 0x341e9341, 0xdab12653, 0xbfd69aeb, + 0xe9c6f9b3, 0x8ca1450b, 0x620ef019, 0x07694ca1, + 0xbe519b3c, 0xdb362784, 0x35999296, 0x50fe2e2e, + 0x99b95426, 0xfcdee89e, 0x12715d8c, 0x7716e134, + 0xce2e36a9, 0xab498a11, 0x45e63f03, 0x208183bb, + 0x7691e0e3, 0x13f65c5b, 0xfd59e949, 0x983e55f1, + 0x2106826c, 0x44613ed4, 0xaace8bc6, 0xcfa9377e, + 0x38417fd6, 0x5d26c36e, 0xb389767c, 0xd6eecac4, + 0x6fd61d59, 0x0ab1a1e1, 0xe41e14f3, 0x8179a84b, + 0xd769cb13, 0xb20e77ab, 0x5ca1c2b9, 0x39c67e01, + 0x80fea99c, 0xe5991524, 0x0b36a036, 0x6e511c8e, + 0xa7166686, 0xc271da3e, 0x2cde6f2c, 0x49b9d394, + 0xf0810409, 0x95e6b8b1, 0x7b490da3, 0x1e2eb11b, + 0x483ed243, 0x2d596efb, 0xc3f6dbe9, 0xa6916751, + 0x1fa9b0cc, 0x7ace0c74, 0x9461b966, 0xf10605de + },{ + 0x00000000, 0xb029603d, 0x6053c07a, 0xd07aa047, + 0xc0a680f5, 0x708fe0c8, 0xa0f5408f, 0x10dc20b2, + 0xc14b7030, 0x7162100d, 0xa118b04a, 0x1131d077, + 0x01edf0c5, 0xb1c490f8, 0x61be30bf, 0xd1975082, + 0x8297e060, 0x32be805d, 0xe2c4201a, 0x52ed4027, + 0x42316095, 0xf21800a8, 0x2262a0ef, 0x924bc0d2, + 0x43dc9050, 0xf3f5f06d, 0x238f502a, 0x93a63017, + 0x837a10a5, 0x33537098, 0xe329d0df, 0x5300b0e2, + 0x042fc1c1, 0xb406a1fc, 0x647c01bb, 0xd4556186, + 0xc4894134, 0x74a02109, 0xa4da814e, 0x14f3e173, + 0xc564b1f1, 0x754dd1cc, 0xa537718b, 0x151e11b6, + 0x05c23104, 0xb5eb5139, 0x6591f17e, 0xd5b89143, + 0x86b821a1, 0x3691419c, 0xe6ebe1db, 0x56c281e6, + 0x461ea154, 0xf637c169, 0x264d612e, 0x96640113, + 0x47f35191, 0xf7da31ac, 0x27a091eb, 0x9789f1d6, + 0x8755d164, 0x377cb159, 0xe706111e, 0x572f7123, + 0x4958f358, 0xf9719365, 0x290b3322, 0x9922531f, + 0x89fe73ad, 0x39d71390, 0xe9adb3d7, 0x5984d3ea, + 0x88138368, 0x383ae355, 0xe8404312, 0x5869232f, + 0x48b5039d, 0xf89c63a0, 0x28e6c3e7, 0x98cfa3da, + 0xcbcf1338, 0x7be67305, 0xab9cd342, 0x1bb5b37f, + 0x0b6993cd, 0xbb40f3f0, 0x6b3a53b7, 0xdb13338a, + 0x0a846308, 0xbaad0335, 0x6ad7a372, 0xdafec34f, + 0xca22e3fd, 0x7a0b83c0, 0xaa712387, 0x1a5843ba, + 0x4d773299, 0xfd5e52a4, 0x2d24f2e3, 0x9d0d92de, + 0x8dd1b26c, 0x3df8d251, 0xed827216, 0x5dab122b, + 0x8c3c42a9, 0x3c152294, 0xec6f82d3, 0x5c46e2ee, + 0x4c9ac25c, 0xfcb3a261, 0x2cc90226, 0x9ce0621b, + 0xcfe0d2f9, 0x7fc9b2c4, 0xafb31283, 0x1f9a72be, + 0x0f46520c, 0xbf6f3231, 0x6f159276, 0xdf3cf24b, + 0x0eaba2c9, 0xbe82c2f4, 0x6ef862b3, 0xded1028e, + 0xce0d223c, 0x7e244201, 0xae5ee246, 0x1e77827b, + 0x92b0e6b1, 0x2299868c, 0xf2e326cb, 0x42ca46f6, + 0x52166644, 0xe23f0679, 0x3245a63e, 0x826cc603, + 0x53fb9681, 0xe3d2f6bc, 0x33a856fb, 0x838136c6, + 0x935d1674, 0x23747649, 0xf30ed60e, 0x4327b633, + 0x102706d1, 0xa00e66ec, 0x7074c6ab, 0xc05da696, + 0xd0818624, 0x60a8e619, 0xb0d2465e, 0x00fb2663, + 0xd16c76e1, 0x614516dc, 0xb13fb69b, 0x0116d6a6, + 0x11caf614, 0xa1e39629, 0x7199366e, 0xc1b05653, + 0x969f2770, 0x26b6474d, 0xf6cce70a, 0x46e58737, + 0x5639a785, 0xe610c7b8, 0x366a67ff, 0x864307c2, + 0x57d45740, 0xe7fd377d, 0x3787973a, 0x87aef707, + 0x9772d7b5, 0x275bb788, 0xf72117cf, 0x470877f2, + 0x1408c710, 0xa421a72d, 0x745b076a, 0xc4726757, + 0xd4ae47e5, 0x648727d8, 0xb4fd879f, 0x04d4e7a2, + 0xd543b720, 0x656ad71d, 0xb510775a, 0x05391767, + 0x15e537d5, 0xa5cc57e8, 0x75b6f7af, 0xc59f9792, + 0xdbe815e9, 0x6bc175d4, 0xbbbbd593, 0x0b92b5ae, + 0x1b4e951c, 0xab67f521, 0x7b1d5566, 0xcb34355b, + 0x1aa365d9, 0xaa8a05e4, 0x7af0a5a3, 0xcad9c59e, + 0xda05e52c, 0x6a2c8511, 0xba562556, 0x0a7f456b, + 0x597ff589, 0xe95695b4, 0x392c35f3, 0x890555ce, + 0x99d9757c, 0x29f01541, 0xf98ab506, 0x49a3d53b, + 0x983485b9, 0x281de584, 0xf86745c3, 0x484e25fe, + 0x5892054c, 0xe8bb6571, 0x38c1c536, 0x88e8a50b, + 0xdfc7d428, 0x6feeb415, 0xbf941452, 0x0fbd746f, + 0x1f6154dd, 0xaf4834e0, 0x7f3294a7, 0xcf1bf49a, + 0x1e8ca418, 0xaea5c425, 0x7edf6462, 0xcef6045f, + 0xde2a24ed, 0x6e0344d0, 0xbe79e497, 0x0e5084aa, + 0x5d503448, 0xed795475, 0x3d03f432, 0x8d2a940f, + 0x9df6b4bd, 0x2ddfd480, 0xfda574c7, 0x4d8c14fa, + 0x9c1b4478, 0x2c322445, 0xfc488402, 0x4c61e43f, + 0x5cbdc48d, 0xec94a4b0, 0x3cee04f7, 0x8cc764ca + },{ + 0x00000000, 0xa5d35ccb, 0x0ba1c84d, 0xae729486, + 0x1642919b, 0xb391cd50, 0x1de359d6, 0xb830051d, + 0x6d8253ec, 0xc8510f27, 0x66239ba1, 0xc3f0c76a, + 0x7bc0c277, 0xde139ebc, 0x70610a3a, 0xd5b256f1, + 0x9b02d603, 0x3ed18ac8, 0x90a31e4e, 0x35704285, + 0x8d404798, 0x28931b53, 0x86e18fd5, 0x2332d31e, + 0xf68085ef, 0x5353d924, 0xfd214da2, 0x58f21169, + 0xe0c21474, 0x451148bf, 0xeb63dc39, 0x4eb080f2, + 0x3605ac07, 0x93d6f0cc, 0x3da4644a, 0x98773881, + 0x20473d9c, 0x85946157, 0x2be6f5d1, 0x8e35a91a, + 0x5b87ffeb, 0xfe54a320, 0x502637a6, 0xf5f56b6d, + 0x4dc56e70, 0xe81632bb, 0x4664a63d, 0xe3b7faf6, + 0xad077a04, 0x08d426cf, 0xa6a6b249, 0x0375ee82, + 0xbb45eb9f, 0x1e96b754, 0xb0e423d2, 0x15377f19, + 0xc08529e8, 0x65567523, 0xcb24e1a5, 0x6ef7bd6e, + 0xd6c7b873, 0x7314e4b8, 0xdd66703e, 0x78b52cf5, + 0x6c0a580f, 0xc9d904c4, 0x67ab9042, 0xc278cc89, + 0x7a48c994, 0xdf9b955f, 0x71e901d9, 0xd43a5d12, + 0x01880be3, 0xa45b5728, 0x0a29c3ae, 0xaffa9f65, + 0x17ca9a78, 0xb219c6b3, 0x1c6b5235, 0xb9b80efe, + 0xf7088e0c, 0x52dbd2c7, 0xfca94641, 0x597a1a8a, + 0xe14a1f97, 0x4499435c, 0xeaebd7da, 0x4f388b11, + 0x9a8adde0, 0x3f59812b, 0x912b15ad, 0x34f84966, + 0x8cc84c7b, 0x291b10b0, 0x87698436, 0x22bad8fd, + 0x5a0ff408, 0xffdca8c3, 0x51ae3c45, 0xf47d608e, + 0x4c4d6593, 0xe99e3958, 0x47ecadde, 0xe23ff115, + 0x378da7e4, 0x925efb2f, 0x3c2c6fa9, 0x99ff3362, + 0x21cf367f, 0x841c6ab4, 0x2a6efe32, 0x8fbda2f9, + 0xc10d220b, 0x64de7ec0, 0xcaacea46, 0x6f7fb68d, + 0xd74fb390, 0x729cef5b, 0xdcee7bdd, 0x793d2716, + 0xac8f71e7, 0x095c2d2c, 0xa72eb9aa, 0x02fde561, + 0xbacde07c, 0x1f1ebcb7, 0xb16c2831, 0x14bf74fa, + 0xd814b01e, 0x7dc7ecd5, 0xd3b57853, 0x76662498, + 0xce562185, 0x6b857d4e, 0xc5f7e9c8, 0x6024b503, + 0xb596e3f2, 0x1045bf39, 0xbe372bbf, 0x1be47774, + 0xa3d47269, 0x06072ea2, 0xa875ba24, 0x0da6e6ef, + 0x4316661d, 0xe6c53ad6, 0x48b7ae50, 0xed64f29b, + 0x5554f786, 0xf087ab4d, 0x5ef53fcb, 0xfb266300, + 0x2e9435f1, 0x8b47693a, 0x2535fdbc, 0x80e6a177, + 0x38d6a46a, 0x9d05f8a1, 0x33776c27, 0x96a430ec, + 0xee111c19, 0x4bc240d2, 0xe5b0d454, 0x4063889f, + 0xf8538d82, 0x5d80d149, 0xf3f245cf, 0x56211904, + 0x83934ff5, 0x2640133e, 0x883287b8, 0x2de1db73, + 0x95d1de6e, 0x300282a5, 0x9e701623, 0x3ba34ae8, + 0x7513ca1a, 0xd0c096d1, 0x7eb20257, 0xdb615e9c, + 0x63515b81, 0xc682074a, 0x68f093cc, 0xcd23cf07, + 0x189199f6, 0xbd42c53d, 0x133051bb, 0xb6e30d70, + 0x0ed3086d, 0xab0054a6, 0x0572c020, 0xa0a19ceb, + 0xb41ee811, 0x11cdb4da, 0xbfbf205c, 0x1a6c7c97, + 0xa25c798a, 0x078f2541, 0xa9fdb1c7, 0x0c2eed0c, + 0xd99cbbfd, 0x7c4fe736, 0xd23d73b0, 0x77ee2f7b, + 0xcfde2a66, 0x6a0d76ad, 0xc47fe22b, 0x61acbee0, + 0x2f1c3e12, 0x8acf62d9, 0x24bdf65f, 0x816eaa94, + 0x395eaf89, 0x9c8df342, 0x32ff67c4, 0x972c3b0f, + 0x429e6dfe, 0xe74d3135, 0x493fa5b3, 0xececf978, + 0x54dcfc65, 0xf10fa0ae, 0x5f7d3428, 0xfaae68e3, + 0x821b4416, 0x27c818dd, 0x89ba8c5b, 0x2c69d090, + 0x9459d58d, 0x318a8946, 0x9ff81dc0, 0x3a2b410b, + 0xef9917fa, 0x4a4a4b31, 0xe438dfb7, 0x41eb837c, + 0xf9db8661, 0x5c08daaa, 0xf27a4e2c, 0x57a912e7, + 0x19199215, 0xbccacede, 0x12b85a58, 0xb76b0693, + 0x0f5b038e, 0xaa885f45, 0x04facbc3, 0xa1299708, + 0x749bc1f9, 0xd1489d32, 0x7f3a09b4, 0xdae9557f, + 0x62d95062, 0xc70a0ca9, 0x6978982f, 0xccabc4e4 + },{ + 0x00000000, 0xb40b77a6, 0x29119f97, 0x9d1ae831, + 0x13244ff4, 0xa72f3852, 0x3a35d063, 0x8e3ea7c5, + 0x674eef33, 0xd3459895, 0x4e5f70a4, 0xfa540702, + 0x746aa0c7, 0xc061d761, 0x5d7b3f50, 0xe97048f6, + 0xce9cde67, 0x7a97a9c1, 0xe78d41f0, 0x53863656, + 0xddb89193, 0x69b3e635, 0xf4a90e04, 0x40a279a2, + 0xa9d23154, 0x1dd946f2, 0x80c3aec3, 0x34c8d965, + 0xbaf67ea0, 0x0efd0906, 0x93e7e137, 0x27ec9691, + 0x9c39bdcf, 0x2832ca69, 0xb5282258, 0x012355fe, + 0x8f1df23b, 0x3b16859d, 0xa60c6dac, 0x12071a0a, + 0xfb7752fc, 0x4f7c255a, 0xd266cd6b, 0x666dbacd, + 0xe8531d08, 0x5c586aae, 0xc142829f, 0x7549f539, + 0x52a563a8, 0xe6ae140e, 0x7bb4fc3f, 0xcfbf8b99, + 0x41812c5c, 0xf58a5bfa, 0x6890b3cb, 0xdc9bc46d, + 0x35eb8c9b, 0x81e0fb3d, 0x1cfa130c, 0xa8f164aa, + 0x26cfc36f, 0x92c4b4c9, 0x0fde5cf8, 0xbbd52b5e, + 0x79750b44, 0xcd7e7ce2, 0x506494d3, 0xe46fe375, + 0x6a5144b0, 0xde5a3316, 0x4340db27, 0xf74bac81, + 0x1e3be477, 0xaa3093d1, 0x372a7be0, 0x83210c46, + 0x0d1fab83, 0xb914dc25, 0x240e3414, 0x900543b2, + 0xb7e9d523, 0x03e2a285, 0x9ef84ab4, 0x2af33d12, + 0xa4cd9ad7, 0x10c6ed71, 0x8ddc0540, 0x39d772e6, + 0xd0a73a10, 0x64ac4db6, 0xf9b6a587, 0x4dbdd221, + 0xc38375e4, 0x77880242, 0xea92ea73, 0x5e999dd5, + 0xe54cb68b, 0x5147c12d, 0xcc5d291c, 0x78565eba, + 0xf668f97f, 0x42638ed9, 0xdf7966e8, 0x6b72114e, + 0x820259b8, 0x36092e1e, 0xab13c62f, 0x1f18b189, + 0x9126164c, 0x252d61ea, 0xb83789db, 0x0c3cfe7d, + 0x2bd068ec, 0x9fdb1f4a, 0x02c1f77b, 0xb6ca80dd, + 0x38f42718, 0x8cff50be, 0x11e5b88f, 0xa5eecf29, + 0x4c9e87df, 0xf895f079, 0x658f1848, 0xd1846fee, + 0x5fbac82b, 0xebb1bf8d, 0x76ab57bc, 0xc2a0201a, + 0xf2ea1688, 0x46e1612e, 0xdbfb891f, 0x6ff0feb9, + 0xe1ce597c, 0x55c52eda, 0xc8dfc6eb, 0x7cd4b14d, + 0x95a4f9bb, 0x21af8e1d, 0xbcb5662c, 0x08be118a, + 0x8680b64f, 0x328bc1e9, 0xaf9129d8, 0x1b9a5e7e, + 0x3c76c8ef, 0x887dbf49, 0x15675778, 0xa16c20de, + 0x2f52871b, 0x9b59f0bd, 0x0643188c, 0xb2486f2a, + 0x5b3827dc, 0xef33507a, 0x7229b84b, 0xc622cfed, + 0x481c6828, 0xfc171f8e, 0x610df7bf, 0xd5068019, + 0x6ed3ab47, 0xdad8dce1, 0x47c234d0, 0xf3c94376, + 0x7df7e4b3, 0xc9fc9315, 0x54e67b24, 0xe0ed0c82, + 0x099d4474, 0xbd9633d2, 0x208cdbe3, 0x9487ac45, + 0x1ab90b80, 0xaeb27c26, 0x33a89417, 0x87a3e3b1, + 0xa04f7520, 0x14440286, 0x895eeab7, 0x3d559d11, + 0xb36b3ad4, 0x07604d72, 0x9a7aa543, 0x2e71d2e5, + 0xc7019a13, 0x730aedb5, 0xee100584, 0x5a1b7222, + 0xd425d5e7, 0x602ea241, 0xfd344a70, 0x493f3dd6, + 0x8b9f1dcc, 0x3f946a6a, 0xa28e825b, 0x1685f5fd, + 0x98bb5238, 0x2cb0259e, 0xb1aacdaf, 0x05a1ba09, + 0xecd1f2ff, 0x58da8559, 0xc5c06d68, 0x71cb1ace, + 0xfff5bd0b, 0x4bfecaad, 0xd6e4229c, 0x62ef553a, + 0x4503c3ab, 0xf108b40d, 0x6c125c3c, 0xd8192b9a, + 0x56278c5f, 0xe22cfbf9, 0x7f3613c8, 0xcb3d646e, + 0x224d2c98, 0x96465b3e, 0x0b5cb30f, 0xbf57c4a9, + 0x3169636c, 0x856214ca, 0x1878fcfb, 0xac738b5d, + 0x17a6a003, 0xa3add7a5, 0x3eb73f94, 0x8abc4832, + 0x0482eff7, 0xb0899851, 0x2d937060, 0x999807c6, + 0x70e84f30, 0xc4e33896, 0x59f9d0a7, 0xedf2a701, + 0x63cc00c4, 0xd7c77762, 0x4add9f53, 0xfed6e8f5, + 0xd93a7e64, 0x6d3109c2, 0xf02be1f3, 0x44209655, + 0xca1e3190, 0x7e154636, 0xe30fae07, 0x5704d9a1, + 0xbe749157, 0x0a7fe6f1, 0x97650ec0, 0x236e7966, + 0xad50dea3, 0x195ba905, 0x84414134, 0x304a3692 + },{ + 0x00000000, 0x9e00aacc, 0x7d072542, 0xe3078f8e, + 0xfa0e4a84, 0x640ee048, 0x87096fc6, 0x1909c50a, + 0xb51be5d3, 0x2b1b4f1f, 0xc81cc091, 0x561c6a5d, + 0x4f15af57, 0xd115059b, 0x32128a15, 0xac1220d9, + 0x2b31bb7c, 0xb53111b0, 0x56369e3e, 0xc83634f2, + 0xd13ff1f8, 0x4f3f5b34, 0xac38d4ba, 0x32387e76, + 0x9e2a5eaf, 0x002af463, 0xe32d7bed, 0x7d2dd121, + 0x6424142b, 0xfa24bee7, 0x19233169, 0x87239ba5, + 0x566276f9, 0xc862dc35, 0x2b6553bb, 0xb565f977, + 0xac6c3c7d, 0x326c96b1, 0xd16b193f, 0x4f6bb3f3, + 0xe379932a, 0x7d7939e6, 0x9e7eb668, 0x007e1ca4, + 0x1977d9ae, 0x87777362, 0x6470fcec, 0xfa705620, + 0x7d53cd85, 0xe3536749, 0x0054e8c7, 0x9e54420b, + 0x875d8701, 0x195d2dcd, 0xfa5aa243, 0x645a088f, + 0xc8482856, 0x5648829a, 0xb54f0d14, 0x2b4fa7d8, + 0x324662d2, 0xac46c81e, 0x4f414790, 0xd141ed5c, + 0xedc29d29, 0x73c237e5, 0x90c5b86b, 0x0ec512a7, + 0x17ccd7ad, 0x89cc7d61, 0x6acbf2ef, 0xf4cb5823, + 0x58d978fa, 0xc6d9d236, 0x25de5db8, 0xbbdef774, + 0xa2d7327e, 0x3cd798b2, 0xdfd0173c, 0x41d0bdf0, + 0xc6f32655, 0x58f38c99, 0xbbf40317, 0x25f4a9db, + 0x3cfd6cd1, 0xa2fdc61d, 0x41fa4993, 0xdffae35f, + 0x73e8c386, 0xede8694a, 0x0eefe6c4, 0x90ef4c08, + 0x89e68902, 0x17e623ce, 0xf4e1ac40, 0x6ae1068c, + 0xbba0ebd0, 0x25a0411c, 0xc6a7ce92, 0x58a7645e, + 0x41aea154, 0xdfae0b98, 0x3ca98416, 0xa2a92eda, + 0x0ebb0e03, 0x90bba4cf, 0x73bc2b41, 0xedbc818d, + 0xf4b54487, 0x6ab5ee4b, 0x89b261c5, 0x17b2cb09, + 0x909150ac, 0x0e91fa60, 0xed9675ee, 0x7396df22, + 0x6a9f1a28, 0xf49fb0e4, 0x17983f6a, 0x899895a6, + 0x258ab57f, 0xbb8a1fb3, 0x588d903d, 0xc68d3af1, + 0xdf84fffb, 0x41845537, 0xa283dab9, 0x3c837075, + 0xda853b53, 0x4485919f, 0xa7821e11, 0x3982b4dd, + 0x208b71d7, 0xbe8bdb1b, 0x5d8c5495, 0xc38cfe59, + 0x6f9ede80, 0xf19e744c, 0x1299fbc2, 0x8c99510e, + 0x95909404, 0x0b903ec8, 0xe897b146, 0x76971b8a, + 0xf1b4802f, 0x6fb42ae3, 0x8cb3a56d, 0x12b30fa1, + 0x0bbacaab, 0x95ba6067, 0x76bdefe9, 0xe8bd4525, + 0x44af65fc, 0xdaafcf30, 0x39a840be, 0xa7a8ea72, + 0xbea12f78, 0x20a185b4, 0xc3a60a3a, 0x5da6a0f6, + 0x8ce74daa, 0x12e7e766, 0xf1e068e8, 0x6fe0c224, + 0x76e9072e, 0xe8e9ade2, 0x0bee226c, 0x95ee88a0, + 0x39fca879, 0xa7fc02b5, 0x44fb8d3b, 0xdafb27f7, + 0xc3f2e2fd, 0x5df24831, 0xbef5c7bf, 0x20f56d73, + 0xa7d6f6d6, 0x39d65c1a, 0xdad1d394, 0x44d17958, + 0x5dd8bc52, 0xc3d8169e, 0x20df9910, 0xbedf33dc, + 0x12cd1305, 0x8ccdb9c9, 0x6fca3647, 0xf1ca9c8b, + 0xe8c35981, 0x76c3f34d, 0x95c47cc3, 0x0bc4d60f, + 0x3747a67a, 0xa9470cb6, 0x4a408338, 0xd44029f4, + 0xcd49ecfe, 0x53494632, 0xb04ec9bc, 0x2e4e6370, + 0x825c43a9, 0x1c5ce965, 0xff5b66eb, 0x615bcc27, + 0x7852092d, 0xe652a3e1, 0x05552c6f, 0x9b5586a3, + 0x1c761d06, 0x8276b7ca, 0x61713844, 0xff719288, + 0xe6785782, 0x7878fd4e, 0x9b7f72c0, 0x057fd80c, + 0xa96df8d5, 0x376d5219, 0xd46add97, 0x4a6a775b, + 0x5363b251, 0xcd63189d, 0x2e649713, 0xb0643ddf, + 0x6125d083, 0xff257a4f, 0x1c22f5c1, 0x82225f0d, + 0x9b2b9a07, 0x052b30cb, 0xe62cbf45, 0x782c1589, + 0xd43e3550, 0x4a3e9f9c, 0xa9391012, 0x3739bade, + 0x2e307fd4, 0xb030d518, 0x53375a96, 0xcd37f05a, + 0x4a146bff, 0xd414c133, 0x37134ebd, 0xa913e471, + 0xb01a217b, 0x2e1a8bb7, 0xcd1d0439, 0x531daef5, + 0xff0f8e2c, 0x610f24e0, 0x8208ab6e, 0x1c0801a2, + 0x0501c4a8, 0x9b016e64, 0x7806e1ea, 0xe6064b26 + } +}; + +static const unsigned int __attribute__((aligned(128))) crc32table_be[8][256] = { + { + 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, + 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, + 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, + 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, + 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, + 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, + 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, + 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, + 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, + 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, + 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, + 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, + 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, + 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, + 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, + 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, + 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, + 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, + 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, + 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, + 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, + 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, + 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, + 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, + 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, + 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, + 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, + 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, + 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, + 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, + 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, + 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, + 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, + 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, + 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, + 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, + 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, + 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, + 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, + 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, + 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, + 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, + 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, + 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, + 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, + 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, + 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, + 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, + 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, + 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, + 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, + 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, + 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, + 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, + 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, + 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, + 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, + 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, + 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, + 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, + 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, + 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, + 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, + 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 + },{ + 0x00000000, 0xd219c1dc, 0xa0f29e0f, 0x72eb5fd3, + 0x452421a9, 0x973de075, 0xe5d6bfa6, 0x37cf7e7a, + 0x8a484352, 0x5851828e, 0x2abadd5d, 0xf8a31c81, + 0xcf6c62fb, 0x1d75a327, 0x6f9efcf4, 0xbd873d28, + 0x10519b13, 0xc2485acf, 0xb0a3051c, 0x62bac4c0, + 0x5575baba, 0x876c7b66, 0xf58724b5, 0x279ee569, + 0x9a19d841, 0x4800199d, 0x3aeb464e, 0xe8f28792, + 0xdf3df9e8, 0x0d243834, 0x7fcf67e7, 0xadd6a63b, + 0x20a33626, 0xf2baf7fa, 0x8051a829, 0x524869f5, + 0x6587178f, 0xb79ed653, 0xc5758980, 0x176c485c, + 0xaaeb7574, 0x78f2b4a8, 0x0a19eb7b, 0xd8002aa7, + 0xefcf54dd, 0x3dd69501, 0x4f3dcad2, 0x9d240b0e, + 0x30f2ad35, 0xe2eb6ce9, 0x9000333a, 0x4219f2e6, + 0x75d68c9c, 0xa7cf4d40, 0xd5241293, 0x073dd34f, + 0xbabaee67, 0x68a32fbb, 0x1a487068, 0xc851b1b4, + 0xff9ecfce, 0x2d870e12, 0x5f6c51c1, 0x8d75901d, + 0x41466c4c, 0x935fad90, 0xe1b4f243, 0x33ad339f, + 0x04624de5, 0xd67b8c39, 0xa490d3ea, 0x76891236, + 0xcb0e2f1e, 0x1917eec2, 0x6bfcb111, 0xb9e570cd, + 0x8e2a0eb7, 0x5c33cf6b, 0x2ed890b8, 0xfcc15164, + 0x5117f75f, 0x830e3683, 0xf1e56950, 0x23fca88c, + 0x1433d6f6, 0xc62a172a, 0xb4c148f9, 0x66d88925, + 0xdb5fb40d, 0x094675d1, 0x7bad2a02, 0xa9b4ebde, + 0x9e7b95a4, 0x4c625478, 0x3e890bab, 0xec90ca77, + 0x61e55a6a, 0xb3fc9bb6, 0xc117c465, 0x130e05b9, + 0x24c17bc3, 0xf6d8ba1f, 0x8433e5cc, 0x562a2410, + 0xebad1938, 0x39b4d8e4, 0x4b5f8737, 0x994646eb, + 0xae893891, 0x7c90f94d, 0x0e7ba69e, 0xdc626742, + 0x71b4c179, 0xa3ad00a5, 0xd1465f76, 0x035f9eaa, + 0x3490e0d0, 0xe689210c, 0x94627edf, 0x467bbf03, + 0xfbfc822b, 0x29e543f7, 0x5b0e1c24, 0x8917ddf8, + 0xbed8a382, 0x6cc1625e, 0x1e2a3d8d, 0xcc33fc51, + 0x828cd898, 0x50951944, 0x227e4697, 0xf067874b, + 0xc7a8f931, 0x15b138ed, 0x675a673e, 0xb543a6e2, + 0x08c49bca, 0xdadd5a16, 0xa83605c5, 0x7a2fc419, + 0x4de0ba63, 0x9ff97bbf, 0xed12246c, 0x3f0be5b0, + 0x92dd438b, 0x40c48257, 0x322fdd84, 0xe0361c58, + 0xd7f96222, 0x05e0a3fe, 0x770bfc2d, 0xa5123df1, + 0x189500d9, 0xca8cc105, 0xb8679ed6, 0x6a7e5f0a, + 0x5db12170, 0x8fa8e0ac, 0xfd43bf7f, 0x2f5a7ea3, + 0xa22feebe, 0x70362f62, 0x02dd70b1, 0xd0c4b16d, + 0xe70bcf17, 0x35120ecb, 0x47f95118, 0x95e090c4, + 0x2867adec, 0xfa7e6c30, 0x889533e3, 0x5a8cf23f, + 0x6d438c45, 0xbf5a4d99, 0xcdb1124a, 0x1fa8d396, + 0xb27e75ad, 0x6067b471, 0x128ceba2, 0xc0952a7e, + 0xf75a5404, 0x254395d8, 0x57a8ca0b, 0x85b10bd7, + 0x383636ff, 0xea2ff723, 0x98c4a8f0, 0x4add692c, + 0x7d121756, 0xaf0bd68a, 0xdde08959, 0x0ff94885, + 0xc3cab4d4, 0x11d37508, 0x63382adb, 0xb121eb07, + 0x86ee957d, 0x54f754a1, 0x261c0b72, 0xf405caae, + 0x4982f786, 0x9b9b365a, 0xe9706989, 0x3b69a855, + 0x0ca6d62f, 0xdebf17f3, 0xac544820, 0x7e4d89fc, + 0xd39b2fc7, 0x0182ee1b, 0x7369b1c8, 0xa1707014, + 0x96bf0e6e, 0x44a6cfb2, 0x364d9061, 0xe45451bd, + 0x59d36c95, 0x8bcaad49, 0xf921f29a, 0x2b383346, + 0x1cf74d3c, 0xceee8ce0, 0xbc05d333, 0x6e1c12ef, + 0xe36982f2, 0x3170432e, 0x439b1cfd, 0x9182dd21, + 0xa64da35b, 0x74546287, 0x06bf3d54, 0xd4a6fc88, + 0x6921c1a0, 0xbb38007c, 0xc9d35faf, 0x1bca9e73, + 0x2c05e009, 0xfe1c21d5, 0x8cf77e06, 0x5eeebfda, + 0xf33819e1, 0x2121d83d, 0x53ca87ee, 0x81d34632, + 0xb61c3848, 0x6405f994, 0x16eea647, 0xc4f7679b, + 0x79705ab3, 0xab699b6f, 0xd982c4bc, 0x0b9b0560, + 0x3c547b1a, 0xee4dbac6, 0x9ca6e515, 0x4ebf24c9 + },{ + 0x00000000, 0x01d8ac87, 0x03b1590e, 0x0269f589, + 0x0762b21c, 0x06ba1e9b, 0x04d3eb12, 0x050b4795, + 0x0ec56438, 0x0f1dc8bf, 0x0d743d36, 0x0cac91b1, + 0x09a7d624, 0x087f7aa3, 0x0a168f2a, 0x0bce23ad, + 0x1d8ac870, 0x1c5264f7, 0x1e3b917e, 0x1fe33df9, + 0x1ae87a6c, 0x1b30d6eb, 0x19592362, 0x18818fe5, + 0x134fac48, 0x129700cf, 0x10fef546, 0x112659c1, + 0x142d1e54, 0x15f5b2d3, 0x179c475a, 0x1644ebdd, + 0x3b1590e0, 0x3acd3c67, 0x38a4c9ee, 0x397c6569, + 0x3c7722fc, 0x3daf8e7b, 0x3fc67bf2, 0x3e1ed775, + 0x35d0f4d8, 0x3408585f, 0x3661add6, 0x37b90151, + 0x32b246c4, 0x336aea43, 0x31031fca, 0x30dbb34d, + 0x269f5890, 0x2747f417, 0x252e019e, 0x24f6ad19, + 0x21fdea8c, 0x2025460b, 0x224cb382, 0x23941f05, + 0x285a3ca8, 0x2982902f, 0x2beb65a6, 0x2a33c921, + 0x2f388eb4, 0x2ee02233, 0x2c89d7ba, 0x2d517b3d, + 0x762b21c0, 0x77f38d47, 0x759a78ce, 0x7442d449, + 0x714993dc, 0x70913f5b, 0x72f8cad2, 0x73206655, + 0x78ee45f8, 0x7936e97f, 0x7b5f1cf6, 0x7a87b071, + 0x7f8cf7e4, 0x7e545b63, 0x7c3daeea, 0x7de5026d, + 0x6ba1e9b0, 0x6a794537, 0x6810b0be, 0x69c81c39, + 0x6cc35bac, 0x6d1bf72b, 0x6f7202a2, 0x6eaaae25, + 0x65648d88, 0x64bc210f, 0x66d5d486, 0x670d7801, + 0x62063f94, 0x63de9313, 0x61b7669a, 0x606fca1d, + 0x4d3eb120, 0x4ce61da7, 0x4e8fe82e, 0x4f5744a9, + 0x4a5c033c, 0x4b84afbb, 0x49ed5a32, 0x4835f6b5, + 0x43fbd518, 0x4223799f, 0x404a8c16, 0x41922091, + 0x44996704, 0x4541cb83, 0x47283e0a, 0x46f0928d, + 0x50b47950, 0x516cd5d7, 0x5305205e, 0x52dd8cd9, + 0x57d6cb4c, 0x560e67cb, 0x54679242, 0x55bf3ec5, + 0x5e711d68, 0x5fa9b1ef, 0x5dc04466, 0x5c18e8e1, + 0x5913af74, 0x58cb03f3, 0x5aa2f67a, 0x5b7a5afd, + 0xec564380, 0xed8eef07, 0xefe71a8e, 0xee3fb609, + 0xeb34f19c, 0xeaec5d1b, 0xe885a892, 0xe95d0415, + 0xe29327b8, 0xe34b8b3f, 0xe1227eb6, 0xe0fad231, + 0xe5f195a4, 0xe4293923, 0xe640ccaa, 0xe798602d, + 0xf1dc8bf0, 0xf0042777, 0xf26dd2fe, 0xf3b57e79, + 0xf6be39ec, 0xf766956b, 0xf50f60e2, 0xf4d7cc65, + 0xff19efc8, 0xfec1434f, 0xfca8b6c6, 0xfd701a41, + 0xf87b5dd4, 0xf9a3f153, 0xfbca04da, 0xfa12a85d, + 0xd743d360, 0xd69b7fe7, 0xd4f28a6e, 0xd52a26e9, + 0xd021617c, 0xd1f9cdfb, 0xd3903872, 0xd24894f5, + 0xd986b758, 0xd85e1bdf, 0xda37ee56, 0xdbef42d1, + 0xdee40544, 0xdf3ca9c3, 0xdd555c4a, 0xdc8df0cd, + 0xcac91b10, 0xcb11b797, 0xc978421e, 0xc8a0ee99, + 0xcdaba90c, 0xcc73058b, 0xce1af002, 0xcfc25c85, + 0xc40c7f28, 0xc5d4d3af, 0xc7bd2626, 0xc6658aa1, + 0xc36ecd34, 0xc2b661b3, 0xc0df943a, 0xc10738bd, + 0x9a7d6240, 0x9ba5cec7, 0x99cc3b4e, 0x981497c9, + 0x9d1fd05c, 0x9cc77cdb, 0x9eae8952, 0x9f7625d5, + 0x94b80678, 0x9560aaff, 0x97095f76, 0x96d1f3f1, + 0x93dab464, 0x920218e3, 0x906bed6a, 0x91b341ed, + 0x87f7aa30, 0x862f06b7, 0x8446f33e, 0x859e5fb9, + 0x8095182c, 0x814db4ab, 0x83244122, 0x82fceda5, + 0x8932ce08, 0x88ea628f, 0x8a839706, 0x8b5b3b81, + 0x8e507c14, 0x8f88d093, 0x8de1251a, 0x8c39899d, + 0xa168f2a0, 0xa0b05e27, 0xa2d9abae, 0xa3010729, + 0xa60a40bc, 0xa7d2ec3b, 0xa5bb19b2, 0xa463b535, + 0xafad9698, 0xae753a1f, 0xac1ccf96, 0xadc46311, + 0xa8cf2484, 0xa9178803, 0xab7e7d8a, 0xaaa6d10d, + 0xbce23ad0, 0xbd3a9657, 0xbf5363de, 0xbe8bcf59, + 0xbb8088cc, 0xba58244b, 0xb831d1c2, 0xb9e97d45, + 0xb2275ee8, 0xb3fff26f, 0xb19607e6, 0xb04eab61, + 0xb545ecf4, 0xb49d4073, 0xb6f4b5fa, 0xb72c197d + },{ + 0x00000000, 0xdc6d9ab7, 0xbc1a28d9, 0x6077b26e, + 0x7cf54c05, 0xa098d6b2, 0xc0ef64dc, 0x1c82fe6b, + 0xf9ea980a, 0x258702bd, 0x45f0b0d3, 0x999d2a64, + 0x851fd40f, 0x59724eb8, 0x3905fcd6, 0xe5686661, + 0xf7142da3, 0x2b79b714, 0x4b0e057a, 0x97639fcd, + 0x8be161a6, 0x578cfb11, 0x37fb497f, 0xeb96d3c8, + 0x0efeb5a9, 0xd2932f1e, 0xb2e49d70, 0x6e8907c7, + 0x720bf9ac, 0xae66631b, 0xce11d175, 0x127c4bc2, + 0xeae946f1, 0x3684dc46, 0x56f36e28, 0x8a9ef49f, + 0x961c0af4, 0x4a719043, 0x2a06222d, 0xf66bb89a, + 0x1303defb, 0xcf6e444c, 0xaf19f622, 0x73746c95, + 0x6ff692fe, 0xb39b0849, 0xd3ecba27, 0x0f812090, + 0x1dfd6b52, 0xc190f1e5, 0xa1e7438b, 0x7d8ad93c, + 0x61082757, 0xbd65bde0, 0xdd120f8e, 0x017f9539, + 0xe417f358, 0x387a69ef, 0x580ddb81, 0x84604136, + 0x98e2bf5d, 0x448f25ea, 0x24f89784, 0xf8950d33, + 0xd1139055, 0x0d7e0ae2, 0x6d09b88c, 0xb164223b, + 0xade6dc50, 0x718b46e7, 0x11fcf489, 0xcd916e3e, + 0x28f9085f, 0xf49492e8, 0x94e32086, 0x488eba31, + 0x540c445a, 0x8861deed, 0xe8166c83, 0x347bf634, + 0x2607bdf6, 0xfa6a2741, 0x9a1d952f, 0x46700f98, + 0x5af2f1f3, 0x869f6b44, 0xe6e8d92a, 0x3a85439d, + 0xdfed25fc, 0x0380bf4b, 0x63f70d25, 0xbf9a9792, + 0xa31869f9, 0x7f75f34e, 0x1f024120, 0xc36fdb97, + 0x3bfad6a4, 0xe7974c13, 0x87e0fe7d, 0x5b8d64ca, + 0x470f9aa1, 0x9b620016, 0xfb15b278, 0x277828cf, + 0xc2104eae, 0x1e7dd419, 0x7e0a6677, 0xa267fcc0, + 0xbee502ab, 0x6288981c, 0x02ff2a72, 0xde92b0c5, + 0xcceefb07, 0x108361b0, 0x70f4d3de, 0xac994969, + 0xb01bb702, 0x6c762db5, 0x0c019fdb, 0xd06c056c, + 0x3504630d, 0xe969f9ba, 0x891e4bd4, 0x5573d163, + 0x49f12f08, 0x959cb5bf, 0xf5eb07d1, 0x29869d66, + 0xa6e63d1d, 0x7a8ba7aa, 0x1afc15c4, 0xc6918f73, + 0xda137118, 0x067eebaf, 0x660959c1, 0xba64c376, + 0x5f0ca517, 0x83613fa0, 0xe3168dce, 0x3f7b1779, + 0x23f9e912, 0xff9473a5, 0x9fe3c1cb, 0x438e5b7c, + 0x51f210be, 0x8d9f8a09, 0xede83867, 0x3185a2d0, + 0x2d075cbb, 0xf16ac60c, 0x911d7462, 0x4d70eed5, + 0xa81888b4, 0x74751203, 0x1402a06d, 0xc86f3ada, + 0xd4edc4b1, 0x08805e06, 0x68f7ec68, 0xb49a76df, + 0x4c0f7bec, 0x9062e15b, 0xf0155335, 0x2c78c982, + 0x30fa37e9, 0xec97ad5e, 0x8ce01f30, 0x508d8587, + 0xb5e5e3e6, 0x69887951, 0x09ffcb3f, 0xd5925188, + 0xc910afe3, 0x157d3554, 0x750a873a, 0xa9671d8d, + 0xbb1b564f, 0x6776ccf8, 0x07017e96, 0xdb6ce421, + 0xc7ee1a4a, 0x1b8380fd, 0x7bf43293, 0xa799a824, + 0x42f1ce45, 0x9e9c54f2, 0xfeebe69c, 0x22867c2b, + 0x3e048240, 0xe26918f7, 0x821eaa99, 0x5e73302e, + 0x77f5ad48, 0xab9837ff, 0xcbef8591, 0x17821f26, + 0x0b00e14d, 0xd76d7bfa, 0xb71ac994, 0x6b775323, + 0x8e1f3542, 0x5272aff5, 0x32051d9b, 0xee68872c, + 0xf2ea7947, 0x2e87e3f0, 0x4ef0519e, 0x929dcb29, + 0x80e180eb, 0x5c8c1a5c, 0x3cfba832, 0xe0963285, + 0xfc14ccee, 0x20795659, 0x400ee437, 0x9c637e80, + 0x790b18e1, 0xa5668256, 0xc5113038, 0x197caa8f, + 0x05fe54e4, 0xd993ce53, 0xb9e47c3d, 0x6589e68a, + 0x9d1cebb9, 0x4171710e, 0x2106c360, 0xfd6b59d7, + 0xe1e9a7bc, 0x3d843d0b, 0x5df38f65, 0x819e15d2, + 0x64f673b3, 0xb89be904, 0xd8ec5b6a, 0x0481c1dd, + 0x18033fb6, 0xc46ea501, 0xa419176f, 0x78748dd8, + 0x6a08c61a, 0xb6655cad, 0xd612eec3, 0x0a7f7474, + 0x16fd8a1f, 0xca9010a8, 0xaae7a2c6, 0x768a3871, + 0x93e25e10, 0x4f8fc4a7, 0x2ff876c9, 0xf395ec7e, + 0xef171215, 0x337a88a2, 0x530d3acc, 0x8f60a07b + },{ + 0x00000000, 0x490d678d, 0x921acf1a, 0xdb17a897, + 0x20f48383, 0x69f9e40e, 0xb2ee4c99, 0xfbe32b14, + 0x41e90706, 0x08e4608b, 0xd3f3c81c, 0x9afeaf91, + 0x611d8485, 0x2810e308, 0xf3074b9f, 0xba0a2c12, + 0x83d20e0c, 0xcadf6981, 0x11c8c116, 0x58c5a69b, + 0xa3268d8f, 0xea2bea02, 0x313c4295, 0x78312518, + 0xc23b090a, 0x8b366e87, 0x5021c610, 0x192ca19d, + 0xe2cf8a89, 0xabc2ed04, 0x70d54593, 0x39d8221e, + 0x036501af, 0x4a686622, 0x917fceb5, 0xd872a938, + 0x2391822c, 0x6a9ce5a1, 0xb18b4d36, 0xf8862abb, + 0x428c06a9, 0x0b816124, 0xd096c9b3, 0x999bae3e, + 0x6278852a, 0x2b75e2a7, 0xf0624a30, 0xb96f2dbd, + 0x80b70fa3, 0xc9ba682e, 0x12adc0b9, 0x5ba0a734, + 0xa0438c20, 0xe94eebad, 0x3259433a, 0x7b5424b7, + 0xc15e08a5, 0x88536f28, 0x5344c7bf, 0x1a49a032, + 0xe1aa8b26, 0xa8a7ecab, 0x73b0443c, 0x3abd23b1, + 0x06ca035e, 0x4fc764d3, 0x94d0cc44, 0xddddabc9, + 0x263e80dd, 0x6f33e750, 0xb4244fc7, 0xfd29284a, + 0x47230458, 0x0e2e63d5, 0xd539cb42, 0x9c34accf, + 0x67d787db, 0x2edae056, 0xf5cd48c1, 0xbcc02f4c, + 0x85180d52, 0xcc156adf, 0x1702c248, 0x5e0fa5c5, + 0xa5ec8ed1, 0xece1e95c, 0x37f641cb, 0x7efb2646, + 0xc4f10a54, 0x8dfc6dd9, 0x56ebc54e, 0x1fe6a2c3, + 0xe40589d7, 0xad08ee5a, 0x761f46cd, 0x3f122140, + 0x05af02f1, 0x4ca2657c, 0x97b5cdeb, 0xdeb8aa66, + 0x255b8172, 0x6c56e6ff, 0xb7414e68, 0xfe4c29e5, + 0x444605f7, 0x0d4b627a, 0xd65ccaed, 0x9f51ad60, + 0x64b28674, 0x2dbfe1f9, 0xf6a8496e, 0xbfa52ee3, + 0x867d0cfd, 0xcf706b70, 0x1467c3e7, 0x5d6aa46a, + 0xa6898f7e, 0xef84e8f3, 0x34934064, 0x7d9e27e9, + 0xc7940bfb, 0x8e996c76, 0x558ec4e1, 0x1c83a36c, + 0xe7608878, 0xae6deff5, 0x757a4762, 0x3c7720ef, + 0x0d9406bc, 0x44996131, 0x9f8ec9a6, 0xd683ae2b, + 0x2d60853f, 0x646de2b2, 0xbf7a4a25, 0xf6772da8, + 0x4c7d01ba, 0x05706637, 0xde67cea0, 0x976aa92d, + 0x6c898239, 0x2584e5b4, 0xfe934d23, 0xb79e2aae, + 0x8e4608b0, 0xc74b6f3d, 0x1c5cc7aa, 0x5551a027, + 0xaeb28b33, 0xe7bfecbe, 0x3ca84429, 0x75a523a4, + 0xcfaf0fb6, 0x86a2683b, 0x5db5c0ac, 0x14b8a721, + 0xef5b8c35, 0xa656ebb8, 0x7d41432f, 0x344c24a2, + 0x0ef10713, 0x47fc609e, 0x9cebc809, 0xd5e6af84, + 0x2e058490, 0x6708e31d, 0xbc1f4b8a, 0xf5122c07, + 0x4f180015, 0x06156798, 0xdd02cf0f, 0x940fa882, + 0x6fec8396, 0x26e1e41b, 0xfdf64c8c, 0xb4fb2b01, + 0x8d23091f, 0xc42e6e92, 0x1f39c605, 0x5634a188, + 0xadd78a9c, 0xe4daed11, 0x3fcd4586, 0x76c0220b, + 0xccca0e19, 0x85c76994, 0x5ed0c103, 0x17dda68e, + 0xec3e8d9a, 0xa533ea17, 0x7e244280, 0x3729250d, + 0x0b5e05e2, 0x4253626f, 0x9944caf8, 0xd049ad75, + 0x2baa8661, 0x62a7e1ec, 0xb9b0497b, 0xf0bd2ef6, + 0x4ab702e4, 0x03ba6569, 0xd8adcdfe, 0x91a0aa73, + 0x6a438167, 0x234ee6ea, 0xf8594e7d, 0xb15429f0, + 0x888c0bee, 0xc1816c63, 0x1a96c4f4, 0x539ba379, + 0xa878886d, 0xe175efe0, 0x3a624777, 0x736f20fa, + 0xc9650ce8, 0x80686b65, 0x5b7fc3f2, 0x1272a47f, + 0xe9918f6b, 0xa09ce8e6, 0x7b8b4071, 0x328627fc, + 0x083b044d, 0x413663c0, 0x9a21cb57, 0xd32cacda, + 0x28cf87ce, 0x61c2e043, 0xbad548d4, 0xf3d82f59, + 0x49d2034b, 0x00df64c6, 0xdbc8cc51, 0x92c5abdc, + 0x692680c8, 0x202be745, 0xfb3c4fd2, 0xb231285f, + 0x8be90a41, 0xc2e46dcc, 0x19f3c55b, 0x50fea2d6, + 0xab1d89c2, 0xe210ee4f, 0x390746d8, 0x700a2155, + 0xca000d47, 0x830d6aca, 0x581ac25d, 0x1117a5d0, + 0xeaf48ec4, 0xa3f9e949, 0x78ee41de, 0x31e32653 + },{ + 0x00000000, 0x1b280d78, 0x36501af0, 0x2d781788, + 0x6ca035e0, 0x77883898, 0x5af02f10, 0x41d82268, + 0xd9406bc0, 0xc26866b8, 0xef107130, 0xf4387c48, + 0xb5e05e20, 0xaec85358, 0x83b044d0, 0x989849a8, + 0xb641ca37, 0xad69c74f, 0x8011d0c7, 0x9b39ddbf, + 0xdae1ffd7, 0xc1c9f2af, 0xecb1e527, 0xf799e85f, + 0x6f01a1f7, 0x7429ac8f, 0x5951bb07, 0x4279b67f, + 0x03a19417, 0x1889996f, 0x35f18ee7, 0x2ed9839f, + 0x684289d9, 0x736a84a1, 0x5e129329, 0x453a9e51, + 0x04e2bc39, 0x1fcab141, 0x32b2a6c9, 0x299aabb1, + 0xb102e219, 0xaa2aef61, 0x8752f8e9, 0x9c7af591, + 0xdda2d7f9, 0xc68ada81, 0xebf2cd09, 0xf0dac071, + 0xde0343ee, 0xc52b4e96, 0xe853591e, 0xf37b5466, + 0xb2a3760e, 0xa98b7b76, 0x84f36cfe, 0x9fdb6186, + 0x0743282e, 0x1c6b2556, 0x311332de, 0x2a3b3fa6, + 0x6be31dce, 0x70cb10b6, 0x5db3073e, 0x469b0a46, + 0xd08513b2, 0xcbad1eca, 0xe6d50942, 0xfdfd043a, + 0xbc252652, 0xa70d2b2a, 0x8a753ca2, 0x915d31da, + 0x09c57872, 0x12ed750a, 0x3f956282, 0x24bd6ffa, + 0x65654d92, 0x7e4d40ea, 0x53355762, 0x481d5a1a, + 0x66c4d985, 0x7decd4fd, 0x5094c375, 0x4bbcce0d, + 0x0a64ec65, 0x114ce11d, 0x3c34f695, 0x271cfbed, + 0xbf84b245, 0xa4acbf3d, 0x89d4a8b5, 0x92fca5cd, + 0xd32487a5, 0xc80c8add, 0xe5749d55, 0xfe5c902d, + 0xb8c79a6b, 0xa3ef9713, 0x8e97809b, 0x95bf8de3, + 0xd467af8b, 0xcf4fa2f3, 0xe237b57b, 0xf91fb803, + 0x6187f1ab, 0x7aaffcd3, 0x57d7eb5b, 0x4cffe623, + 0x0d27c44b, 0x160fc933, 0x3b77debb, 0x205fd3c3, + 0x0e86505c, 0x15ae5d24, 0x38d64aac, 0x23fe47d4, + 0x622665bc, 0x790e68c4, 0x54767f4c, 0x4f5e7234, + 0xd7c63b9c, 0xccee36e4, 0xe196216c, 0xfabe2c14, + 0xbb660e7c, 0xa04e0304, 0x8d36148c, 0x961e19f4, + 0xa5cb3ad3, 0xbee337ab, 0x939b2023, 0x88b32d5b, + 0xc96b0f33, 0xd243024b, 0xff3b15c3, 0xe41318bb, + 0x7c8b5113, 0x67a35c6b, 0x4adb4be3, 0x51f3469b, + 0x102b64f3, 0x0b03698b, 0x267b7e03, 0x3d53737b, + 0x138af0e4, 0x08a2fd9c, 0x25daea14, 0x3ef2e76c, + 0x7f2ac504, 0x6402c87c, 0x497adff4, 0x5252d28c, + 0xcaca9b24, 0xd1e2965c, 0xfc9a81d4, 0xe7b28cac, + 0xa66aaec4, 0xbd42a3bc, 0x903ab434, 0x8b12b94c, + 0xcd89b30a, 0xd6a1be72, 0xfbd9a9fa, 0xe0f1a482, + 0xa12986ea, 0xba018b92, 0x97799c1a, 0x8c519162, + 0x14c9d8ca, 0x0fe1d5b2, 0x2299c23a, 0x39b1cf42, + 0x7869ed2a, 0x6341e052, 0x4e39f7da, 0x5511faa2, + 0x7bc8793d, 0x60e07445, 0x4d9863cd, 0x56b06eb5, + 0x17684cdd, 0x0c4041a5, 0x2138562d, 0x3a105b55, + 0xa28812fd, 0xb9a01f85, 0x94d8080d, 0x8ff00575, + 0xce28271d, 0xd5002a65, 0xf8783ded, 0xe3503095, + 0x754e2961, 0x6e662419, 0x431e3391, 0x58363ee9, + 0x19ee1c81, 0x02c611f9, 0x2fbe0671, 0x34960b09, + 0xac0e42a1, 0xb7264fd9, 0x9a5e5851, 0x81765529, + 0xc0ae7741, 0xdb867a39, 0xf6fe6db1, 0xedd660c9, + 0xc30fe356, 0xd827ee2e, 0xf55ff9a6, 0xee77f4de, + 0xafafd6b6, 0xb487dbce, 0x99ffcc46, 0x82d7c13e, + 0x1a4f8896, 0x016785ee, 0x2c1f9266, 0x37379f1e, + 0x76efbd76, 0x6dc7b00e, 0x40bfa786, 0x5b97aafe, + 0x1d0ca0b8, 0x0624adc0, 0x2b5cba48, 0x3074b730, + 0x71ac9558, 0x6a849820, 0x47fc8fa8, 0x5cd482d0, + 0xc44ccb78, 0xdf64c600, 0xf21cd188, 0xe934dcf0, + 0xa8ecfe98, 0xb3c4f3e0, 0x9ebce468, 0x8594e910, + 0xab4d6a8f, 0xb06567f7, 0x9d1d707f, 0x86357d07, + 0xc7ed5f6f, 0xdcc55217, 0xf1bd459f, 0xea9548e7, + 0x720d014f, 0x69250c37, 0x445d1bbf, 0x5f7516c7, + 0x1ead34af, 0x058539d7, 0x28fd2e5f, 0x33d52327 + },{ + 0x00000000, 0x4f576811, 0x9eaed022, 0xd1f9b833, + 0x399cbdf3, 0x76cbd5e2, 0xa7326dd1, 0xe86505c0, + 0x73397be6, 0x3c6e13f7, 0xed97abc4, 0xa2c0c3d5, + 0x4aa5c615, 0x05f2ae04, 0xd40b1637, 0x9b5c7e26, + 0xe672f7cc, 0xa9259fdd, 0x78dc27ee, 0x378b4fff, + 0xdfee4a3f, 0x90b9222e, 0x41409a1d, 0x0e17f20c, + 0x954b8c2a, 0xda1ce43b, 0x0be55c08, 0x44b23419, + 0xacd731d9, 0xe38059c8, 0x3279e1fb, 0x7d2e89ea, + 0xc824f22f, 0x87739a3e, 0x568a220d, 0x19dd4a1c, + 0xf1b84fdc, 0xbeef27cd, 0x6f169ffe, 0x2041f7ef, + 0xbb1d89c9, 0xf44ae1d8, 0x25b359eb, 0x6ae431fa, + 0x8281343a, 0xcdd65c2b, 0x1c2fe418, 0x53788c09, + 0x2e5605e3, 0x61016df2, 0xb0f8d5c1, 0xffafbdd0, + 0x17cab810, 0x589dd001, 0x89646832, 0xc6330023, + 0x5d6f7e05, 0x12381614, 0xc3c1ae27, 0x8c96c636, + 0x64f3c3f6, 0x2ba4abe7, 0xfa5d13d4, 0xb50a7bc5, + 0x9488f9e9, 0xdbdf91f8, 0x0a2629cb, 0x457141da, + 0xad14441a, 0xe2432c0b, 0x33ba9438, 0x7cedfc29, + 0xe7b1820f, 0xa8e6ea1e, 0x791f522d, 0x36483a3c, + 0xde2d3ffc, 0x917a57ed, 0x4083efde, 0x0fd487cf, + 0x72fa0e25, 0x3dad6634, 0xec54de07, 0xa303b616, + 0x4b66b3d6, 0x0431dbc7, 0xd5c863f4, 0x9a9f0be5, + 0x01c375c3, 0x4e941dd2, 0x9f6da5e1, 0xd03acdf0, + 0x385fc830, 0x7708a021, 0xa6f11812, 0xe9a67003, + 0x5cac0bc6, 0x13fb63d7, 0xc202dbe4, 0x8d55b3f5, + 0x6530b635, 0x2a67de24, 0xfb9e6617, 0xb4c90e06, + 0x2f957020, 0x60c21831, 0xb13ba002, 0xfe6cc813, + 0x1609cdd3, 0x595ea5c2, 0x88a71df1, 0xc7f075e0, + 0xbadefc0a, 0xf589941b, 0x24702c28, 0x6b274439, + 0x834241f9, 0xcc1529e8, 0x1dec91db, 0x52bbf9ca, + 0xc9e787ec, 0x86b0effd, 0x574957ce, 0x181e3fdf, + 0xf07b3a1f, 0xbf2c520e, 0x6ed5ea3d, 0x2182822c, + 0x2dd0ee65, 0x62878674, 0xb37e3e47, 0xfc295656, + 0x144c5396, 0x5b1b3b87, 0x8ae283b4, 0xc5b5eba5, + 0x5ee99583, 0x11befd92, 0xc04745a1, 0x8f102db0, + 0x67752870, 0x28224061, 0xf9dbf852, 0xb68c9043, + 0xcba219a9, 0x84f571b8, 0x550cc98b, 0x1a5ba19a, + 0xf23ea45a, 0xbd69cc4b, 0x6c907478, 0x23c71c69, + 0xb89b624f, 0xf7cc0a5e, 0x2635b26d, 0x6962da7c, + 0x8107dfbc, 0xce50b7ad, 0x1fa90f9e, 0x50fe678f, + 0xe5f41c4a, 0xaaa3745b, 0x7b5acc68, 0x340da479, + 0xdc68a1b9, 0x933fc9a8, 0x42c6719b, 0x0d91198a, + 0x96cd67ac, 0xd99a0fbd, 0x0863b78e, 0x4734df9f, + 0xaf51da5f, 0xe006b24e, 0x31ff0a7d, 0x7ea8626c, + 0x0386eb86, 0x4cd18397, 0x9d283ba4, 0xd27f53b5, + 0x3a1a5675, 0x754d3e64, 0xa4b48657, 0xebe3ee46, + 0x70bf9060, 0x3fe8f871, 0xee114042, 0xa1462853, + 0x49232d93, 0x06744582, 0xd78dfdb1, 0x98da95a0, + 0xb958178c, 0xf60f7f9d, 0x27f6c7ae, 0x68a1afbf, + 0x80c4aa7f, 0xcf93c26e, 0x1e6a7a5d, 0x513d124c, + 0xca616c6a, 0x8536047b, 0x54cfbc48, 0x1b98d459, + 0xf3fdd199, 0xbcaab988, 0x6d5301bb, 0x220469aa, + 0x5f2ae040, 0x107d8851, 0xc1843062, 0x8ed35873, + 0x66b65db3, 0x29e135a2, 0xf8188d91, 0xb74fe580, + 0x2c139ba6, 0x6344f3b7, 0xb2bd4b84, 0xfdea2395, + 0x158f2655, 0x5ad84e44, 0x8b21f677, 0xc4769e66, + 0x717ce5a3, 0x3e2b8db2, 0xefd23581, 0xa0855d90, + 0x48e05850, 0x07b73041, 0xd64e8872, 0x9919e063, + 0x02459e45, 0x4d12f654, 0x9ceb4e67, 0xd3bc2676, + 0x3bd923b6, 0x748e4ba7, 0xa577f394, 0xea209b85, + 0x970e126f, 0xd8597a7e, 0x09a0c24d, 0x46f7aa5c, + 0xae92af9c, 0xe1c5c78d, 0x303c7fbe, 0x7f6b17af, + 0xe4376989, 0xab600198, 0x7a99b9ab, 0x35ced1ba, + 0xddabd47a, 0x92fcbc6b, 0x43050458, 0x0c526c49 + },{ + 0x00000000, 0x5ba1dcca, 0xb743b994, 0xece2655e, + 0x6a466e9f, 0x31e7b255, 0xdd05d70b, 0x86a40bc1, + 0xd48cdd3e, 0x8f2d01f4, 0x63cf64aa, 0x386eb860, + 0xbecab3a1, 0xe56b6f6b, 0x09890a35, 0x5228d6ff, + 0xadd8a7cb, 0xf6797b01, 0x1a9b1e5f, 0x413ac295, + 0xc79ec954, 0x9c3f159e, 0x70dd70c0, 0x2b7cac0a, + 0x79547af5, 0x22f5a63f, 0xce17c361, 0x95b61fab, + 0x1312146a, 0x48b3c8a0, 0xa451adfe, 0xfff07134, + 0x5f705221, 0x04d18eeb, 0xe833ebb5, 0xb392377f, + 0x35363cbe, 0x6e97e074, 0x8275852a, 0xd9d459e0, + 0x8bfc8f1f, 0xd05d53d5, 0x3cbf368b, 0x671eea41, + 0xe1bae180, 0xba1b3d4a, 0x56f95814, 0x0d5884de, + 0xf2a8f5ea, 0xa9092920, 0x45eb4c7e, 0x1e4a90b4, + 0x98ee9b75, 0xc34f47bf, 0x2fad22e1, 0x740cfe2b, + 0x262428d4, 0x7d85f41e, 0x91679140, 0xcac64d8a, + 0x4c62464b, 0x17c39a81, 0xfb21ffdf, 0xa0802315, + 0xbee0a442, 0xe5417888, 0x09a31dd6, 0x5202c11c, + 0xd4a6cadd, 0x8f071617, 0x63e57349, 0x3844af83, + 0x6a6c797c, 0x31cda5b6, 0xdd2fc0e8, 0x868e1c22, + 0x002a17e3, 0x5b8bcb29, 0xb769ae77, 0xecc872bd, + 0x13380389, 0x4899df43, 0xa47bba1d, 0xffda66d7, + 0x797e6d16, 0x22dfb1dc, 0xce3dd482, 0x959c0848, + 0xc7b4deb7, 0x9c15027d, 0x70f76723, 0x2b56bbe9, + 0xadf2b028, 0xf6536ce2, 0x1ab109bc, 0x4110d576, + 0xe190f663, 0xba312aa9, 0x56d34ff7, 0x0d72933d, + 0x8bd698fc, 0xd0774436, 0x3c952168, 0x6734fda2, + 0x351c2b5d, 0x6ebdf797, 0x825f92c9, 0xd9fe4e03, + 0x5f5a45c2, 0x04fb9908, 0xe819fc56, 0xb3b8209c, + 0x4c4851a8, 0x17e98d62, 0xfb0be83c, 0xa0aa34f6, + 0x260e3f37, 0x7dafe3fd, 0x914d86a3, 0xcaec5a69, + 0x98c48c96, 0xc365505c, 0x2f873502, 0x7426e9c8, + 0xf282e209, 0xa9233ec3, 0x45c15b9d, 0x1e608757, + 0x79005533, 0x22a189f9, 0xce43eca7, 0x95e2306d, + 0x13463bac, 0x48e7e766, 0xa4058238, 0xffa45ef2, + 0xad8c880d, 0xf62d54c7, 0x1acf3199, 0x416eed53, + 0xc7cae692, 0x9c6b3a58, 0x70895f06, 0x2b2883cc, + 0xd4d8f2f8, 0x8f792e32, 0x639b4b6c, 0x383a97a6, + 0xbe9e9c67, 0xe53f40ad, 0x09dd25f3, 0x527cf939, + 0x00542fc6, 0x5bf5f30c, 0xb7179652, 0xecb64a98, + 0x6a124159, 0x31b39d93, 0xdd51f8cd, 0x86f02407, + 0x26700712, 0x7dd1dbd8, 0x9133be86, 0xca92624c, + 0x4c36698d, 0x1797b547, 0xfb75d019, 0xa0d40cd3, + 0xf2fcda2c, 0xa95d06e6, 0x45bf63b8, 0x1e1ebf72, + 0x98bab4b3, 0xc31b6879, 0x2ff90d27, 0x7458d1ed, + 0x8ba8a0d9, 0xd0097c13, 0x3ceb194d, 0x674ac587, + 0xe1eece46, 0xba4f128c, 0x56ad77d2, 0x0d0cab18, + 0x5f247de7, 0x0485a12d, 0xe867c473, 0xb3c618b9, + 0x35621378, 0x6ec3cfb2, 0x8221aaec, 0xd9807626, + 0xc7e0f171, 0x9c412dbb, 0x70a348e5, 0x2b02942f, + 0xada69fee, 0xf6074324, 0x1ae5267a, 0x4144fab0, + 0x136c2c4f, 0x48cdf085, 0xa42f95db, 0xff8e4911, + 0x792a42d0, 0x228b9e1a, 0xce69fb44, 0x95c8278e, + 0x6a3856ba, 0x31998a70, 0xdd7bef2e, 0x86da33e4, + 0x007e3825, 0x5bdfe4ef, 0xb73d81b1, 0xec9c5d7b, + 0xbeb48b84, 0xe515574e, 0x09f73210, 0x5256eeda, + 0xd4f2e51b, 0x8f5339d1, 0x63b15c8f, 0x38108045, + 0x9890a350, 0xc3317f9a, 0x2fd31ac4, 0x7472c60e, + 0xf2d6cdcf, 0xa9771105, 0x4595745b, 0x1e34a891, + 0x4c1c7e6e, 0x17bda2a4, 0xfb5fc7fa, 0xa0fe1b30, + 0x265a10f1, 0x7dfbcc3b, 0x9119a965, 0xcab875af, + 0x3548049b, 0x6ee9d851, 0x820bbd0f, 0xd9aa61c5, + 0x5f0e6a04, 0x04afb6ce, 0xe84dd390, 0xb3ec0f5a, + 0xe1c4d9a5, 0xba65056f, 0x56876031, 0x0d26bcfb, + 0x8b82b73a, 0xd0236bf0, 0x3cc10eae, 0x6760d264 + } +}; + +static const unsigned int __attribute__((aligned(128))) crc32ctable_le[8][256] = { + { + 0x00000000, 0x03836bf2, 0xf7703be1, 0xf4f35013, + 0x1f979ac7, 0x1c14f135, 0xe8e7a126, 0xeb64cad4, + 0xcf58d98a, 0xccdbb278, 0x3828e26b, 0x3bab8999, + 0xd0cf434d, 0xd34c28bf, 0x27bf78ac, 0x243c135e, + 0x6fc75e10, 0x6c4435e2, 0x98b765f1, 0x9b340e03, + 0x7050c4d7, 0x73d3af25, 0x8720ff36, 0x84a394c4, + 0xa09f879a, 0xa31cec68, 0x57efbc7b, 0x546cd789, + 0xbf081d5d, 0xbc8b76af, 0x487826bc, 0x4bfb4d4e, + 0xde8ebd20, 0xdd0dd6d2, 0x29fe86c1, 0x2a7ded33, + 0xc11927e7, 0xc29a4c15, 0x36691c06, 0x35ea77f4, + 0x11d664aa, 0x12550f58, 0xe6a65f4b, 0xe52534b9, + 0x0e41fe6d, 0x0dc2959f, 0xf931c58c, 0xfab2ae7e, + 0xb149e330, 0xb2ca88c2, 0x4639d8d1, 0x45bab323, + 0xaede79f7, 0xad5d1205, 0x59ae4216, 0x5a2d29e4, + 0x7e113aba, 0x7d925148, 0x8961015b, 0x8ae26aa9, + 0x6186a07d, 0x6205cb8f, 0x96f69b9c, 0x9575f06e, + 0xbc1d7b41, 0xbf9e10b3, 0x4b6d40a0, 0x48ee2b52, + 0xa38ae186, 0xa0098a74, 0x54fada67, 0x5779b195, + 0x7345a2cb, 0x70c6c939, 0x8435992a, 0x87b6f2d8, + 0x6cd2380c, 0x6f5153fe, 0x9ba203ed, 0x9821681f, + 0xd3da2551, 0xd0594ea3, 0x24aa1eb0, 0x27297542, + 0xcc4dbf96, 0xcfced464, 0x3b3d8477, 0x38beef85, + 0x1c82fcdb, 0x1f019729, 0xebf2c73a, 0xe871acc8, + 0x0315661c, 0x00960dee, 0xf4655dfd, 0xf7e6360f, + 0x6293c661, 0x6110ad93, 0x95e3fd80, 0x96609672, + 0x7d045ca6, 0x7e873754, 0x8a746747, 0x89f70cb5, + 0xadcb1feb, 0xae487419, 0x5abb240a, 0x59384ff8, + 0xb25c852c, 0xb1dfeede, 0x452cbecd, 0x46afd53f, + 0x0d549871, 0x0ed7f383, 0xfa24a390, 0xf9a7c862, + 0x12c302b6, 0x11406944, 0xe5b33957, 0xe63052a5, + 0xc20c41fb, 0xc18f2a09, 0x357c7a1a, 0x36ff11e8, + 0xdd9bdb3c, 0xde18b0ce, 0x2aebe0dd, 0x29688b2f, + 0x783bf682, 0x7bb89d70, 0x8f4bcd63, 0x8cc8a691, + 0x67ac6c45, 0x642f07b7, 0x90dc57a4, 0x935f3c56, + 0xb7632f08, 0xb4e044fa, 0x401314e9, 0x43907f1b, + 0xa8f4b5cf, 0xab77de3d, 0x5f848e2e, 0x5c07e5dc, + 0x17fca892, 0x147fc360, 0xe08c9373, 0xe30ff881, + 0x086b3255, 0x0be859a7, 0xff1b09b4, 0xfc986246, + 0xd8a47118, 0xdb271aea, 0x2fd44af9, 0x2c57210b, + 0xc733ebdf, 0xc4b0802d, 0x3043d03e, 0x33c0bbcc, + 0xa6b54ba2, 0xa5362050, 0x51c57043, 0x52461bb1, + 0xb922d165, 0xbaa1ba97, 0x4e52ea84, 0x4dd18176, + 0x69ed9228, 0x6a6ef9da, 0x9e9da9c9, 0x9d1ec23b, + 0x767a08ef, 0x75f9631d, 0x810a330e, 0x828958fc, + 0xc97215b2, 0xcaf17e40, 0x3e022e53, 0x3d8145a1, + 0xd6e58f75, 0xd566e487, 0x2195b494, 0x2216df66, + 0x062acc38, 0x05a9a7ca, 0xf15af7d9, 0xf2d99c2b, + 0x19bd56ff, 0x1a3e3d0d, 0xeecd6d1e, 0xed4e06ec, + 0xc4268dc3, 0xc7a5e631, 0x3356b622, 0x30d5ddd0, + 0xdbb11704, 0xd8327cf6, 0x2cc12ce5, 0x2f424717, + 0x0b7e5449, 0x08fd3fbb, 0xfc0e6fa8, 0xff8d045a, + 0x14e9ce8e, 0x176aa57c, 0xe399f56f, 0xe01a9e9d, + 0xabe1d3d3, 0xa862b821, 0x5c91e832, 0x5f1283c0, + 0xb4764914, 0xb7f522e6, 0x430672f5, 0x40851907, + 0x64b90a59, 0x673a61ab, 0x93c931b8, 0x904a5a4a, + 0x7b2e909e, 0x78adfb6c, 0x8c5eab7f, 0x8fddc08d, + 0x1aa830e3, 0x192b5b11, 0xedd80b02, 0xee5b60f0, + 0x053faa24, 0x06bcc1d6, 0xf24f91c5, 0xf1ccfa37, + 0xd5f0e969, 0xd673829b, 0x2280d288, 0x2103b97a, + 0xca6773ae, 0xc9e4185c, 0x3d17484f, 0x3e9423bd, + 0x756f6ef3, 0x76ec0501, 0x821f5512, 0x819c3ee0, + 0x6af8f434, 0x697b9fc6, 0x9d88cfd5, 0x9e0ba427, + 0xba37b779, 0xb9b4dc8b, 0x4d478c98, 0x4ec4e76a, + 0xa5a02dbe, 0xa623464c, 0x52d0165f, 0x51537dad + },{ + 0x00000000, 0x7798a213, 0xee304527, 0x99a8e734, + 0xdc618a4e, 0xabf9285d, 0x3251cf69, 0x45c96d7a, + 0xb8c3149d, 0xcf5bb68e, 0x56f351ba, 0x216bf3a9, + 0x64a29ed3, 0x133a3cc0, 0x8a92dbf4, 0xfd0a79e7, + 0x81f1c53f, 0xf669672c, 0x6fc18018, 0x1859220b, + 0x5d904f71, 0x2a08ed62, 0xb3a00a56, 0xc438a845, + 0x3932d1a2, 0x4eaa73b1, 0xd7029485, 0xa09a3696, + 0xe5535bec, 0x92cbf9ff, 0x0b631ecb, 0x7cfbbcd8, + 0x02e38b7f, 0x757b296c, 0xecd3ce58, 0x9b4b6c4b, + 0xde820131, 0xa91aa322, 0x30b24416, 0x472ae605, + 0xba209fe2, 0xcdb83df1, 0x5410dac5, 0x238878d6, + 0x664115ac, 0x11d9b7bf, 0x8871508b, 0xffe9f298, + 0x83124e40, 0xf48aec53, 0x6d220b67, 0x1abaa974, + 0x5f73c40e, 0x28eb661d, 0xb1438129, 0xc6db233a, + 0x3bd15add, 0x4c49f8ce, 0xd5e11ffa, 0xa279bde9, + 0xe7b0d093, 0x90287280, 0x098095b4, 0x7e1837a7, + 0x04c617ff, 0x735eb5ec, 0xeaf652d8, 0x9d6ef0cb, + 0xd8a79db1, 0xaf3f3fa2, 0x3697d896, 0x410f7a85, + 0xbc050362, 0xcb9da171, 0x52354645, 0x25ade456, + 0x6064892c, 0x17fc2b3f, 0x8e54cc0b, 0xf9cc6e18, + 0x8537d2c0, 0xf2af70d3, 0x6b0797e7, 0x1c9f35f4, + 0x5956588e, 0x2ecefa9d, 0xb7661da9, 0xc0febfba, + 0x3df4c65d, 0x4a6c644e, 0xd3c4837a, 0xa45c2169, + 0xe1954c13, 0x960dee00, 0x0fa50934, 0x783dab27, + 0x06259c80, 0x71bd3e93, 0xe815d9a7, 0x9f8d7bb4, + 0xda4416ce, 0xaddcb4dd, 0x347453e9, 0x43ecf1fa, + 0xbee6881d, 0xc97e2a0e, 0x50d6cd3a, 0x274e6f29, + 0x62870253, 0x151fa040, 0x8cb74774, 0xfb2fe567, + 0x87d459bf, 0xf04cfbac, 0x69e41c98, 0x1e7cbe8b, + 0x5bb5d3f1, 0x2c2d71e2, 0xb58596d6, 0xc21d34c5, + 0x3f174d22, 0x488fef31, 0xd1270805, 0xa6bfaa16, + 0xe376c76c, 0x94ee657f, 0x0d46824b, 0x7ade2058, + 0xf9fac3fb, 0x8e6261e8, 0x17ca86dc, 0x605224cf, + 0x259b49b5, 0x5203eba6, 0xcbab0c92, 0xbc33ae81, + 0x4139d766, 0x36a17575, 0xaf099241, 0xd8913052, + 0x9d585d28, 0xeac0ff3b, 0x7368180f, 0x04f0ba1c, + 0x780b06c4, 0x0f93a4d7, 0x963b43e3, 0xe1a3e1f0, + 0xa46a8c8a, 0xd3f22e99, 0x4a5ac9ad, 0x3dc26bbe, + 0xc0c81259, 0xb750b04a, 0x2ef8577e, 0x5960f56d, + 0x1ca99817, 0x6b313a04, 0xf299dd30, 0x85017f23, + 0xfb194884, 0x8c81ea97, 0x15290da3, 0x62b1afb0, + 0x2778c2ca, 0x50e060d9, 0xc94887ed, 0xbed025fe, + 0x43da5c19, 0x3442fe0a, 0xadea193e, 0xda72bb2d, + 0x9fbbd657, 0xe8237444, 0x718b9370, 0x06133163, + 0x7ae88dbb, 0x0d702fa8, 0x94d8c89c, 0xe3406a8f, + 0xa68907f5, 0xd111a5e6, 0x48b942d2, 0x3f21e0c1, + 0xc22b9926, 0xb5b33b35, 0x2c1bdc01, 0x5b837e12, + 0x1e4a1368, 0x69d2b17b, 0xf07a564f, 0x87e2f45c, + 0xfd3cd404, 0x8aa47617, 0x130c9123, 0x64943330, + 0x215d5e4a, 0x56c5fc59, 0xcf6d1b6d, 0xb8f5b97e, + 0x45ffc099, 0x3267628a, 0xabcf85be, 0xdc5727ad, + 0x999e4ad7, 0xee06e8c4, 0x77ae0ff0, 0x0036ade3, + 0x7ccd113b, 0x0b55b328, 0x92fd541c, 0xe565f60f, + 0xa0ac9b75, 0xd7343966, 0x4e9cde52, 0x39047c41, + 0xc40e05a6, 0xb396a7b5, 0x2a3e4081, 0x5da6e292, + 0x186f8fe8, 0x6ff72dfb, 0xf65fcacf, 0x81c768dc, + 0xffdf5f7b, 0x8847fd68, 0x11ef1a5c, 0x6677b84f, + 0x23bed535, 0x54267726, 0xcd8e9012, 0xba163201, + 0x471c4be6, 0x3084e9f5, 0xa92c0ec1, 0xdeb4acd2, + 0x9b7dc1a8, 0xece563bb, 0x754d848f, 0x02d5269c, + 0x7e2e9a44, 0x09b63857, 0x901edf63, 0xe7867d70, + 0xa24f100a, 0xd5d7b219, 0x4c7f552d, 0x3be7f73e, + 0xc6ed8ed9, 0xb1752cca, 0x28ddcbfe, 0x5f4569ed, + 0x1a8c0497, 0x6d14a684, 0xf4bc41b0, 0x8324e3a3 + },{ + 0x00000000, 0x7e9241a5, 0x0d526f4f, 0x73c02eea, + 0x1aa4de9e, 0x64369f3b, 0x17f6b1d1, 0x6964f074, + 0xc53e5138, 0xbbac109d, 0xc86c3e77, 0xb6fe7fd2, + 0xdf9a8fa6, 0xa108ce03, 0xd2c8e0e9, 0xac5aa14c, + 0x8a7da270, 0xf4efe3d5, 0x872fcd3f, 0xf9bd8c9a, + 0x90d97cee, 0xee4b3d4b, 0x9d8b13a1, 0xe3195204, + 0x4f43f348, 0x31d1b2ed, 0x42119c07, 0x3c83dda2, + 0x55e72dd6, 0x2b756c73, 0x58b54299, 0x2627033c, + 0x14fb44e1, 0x6a690544, 0x19a92bae, 0x673b6a0b, + 0x0e5f9a7f, 0x70cddbda, 0x030df530, 0x7d9fb495, + 0xd1c515d9, 0xaf57547c, 0xdc977a96, 0xa2053b33, + 0xcb61cb47, 0xb5f38ae2, 0xc633a408, 0xb8a1e5ad, + 0x9e86e691, 0xe014a734, 0x93d489de, 0xed46c87b, + 0x8422380f, 0xfab079aa, 0x89705740, 0xf7e216e5, + 0x5bb8b7a9, 0x252af60c, 0x56ead8e6, 0x28789943, + 0x411c6937, 0x3f8e2892, 0x4c4e0678, 0x32dc47dd, + 0xd98065c7, 0xa7122462, 0xd4d20a88, 0xaa404b2d, + 0xc324bb59, 0xbdb6fafc, 0xce76d416, 0xb0e495b3, + 0x1cbe34ff, 0x622c755a, 0x11ec5bb0, 0x6f7e1a15, + 0x061aea61, 0x7888abc4, 0x0b48852e, 0x75dac48b, + 0x53fdc7b7, 0x2d6f8612, 0x5eafa8f8, 0x203de95d, + 0x49591929, 0x37cb588c, 0x440b7666, 0x3a9937c3, + 0x96c3968f, 0xe851d72a, 0x9b91f9c0, 0xe503b865, + 0x8c674811, 0xf2f509b4, 0x8135275e, 0xffa766fb, + 0xcd7b2126, 0xb3e96083, 0xc0294e69, 0xbebb0fcc, + 0xd7dfffb8, 0xa94dbe1d, 0xda8d90f7, 0xa41fd152, + 0x0845701e, 0x76d731bb, 0x05171f51, 0x7b855ef4, + 0x12e1ae80, 0x6c73ef25, 0x1fb3c1cf, 0x6121806a, + 0x47068356, 0x3994c2f3, 0x4a54ec19, 0x34c6adbc, + 0x5da25dc8, 0x23301c6d, 0x50f03287, 0x2e627322, + 0x8238d26e, 0xfcaa93cb, 0x8f6abd21, 0xf1f8fc84, + 0x989c0cf0, 0xe60e4d55, 0x95ce63bf, 0xeb5c221a, + 0x4377278b, 0x3de5662e, 0x4e2548c4, 0x30b70961, + 0x59d3f915, 0x2741b8b0, 0x5481965a, 0x2a13d7ff, + 0x864976b3, 0xf8db3716, 0x8b1b19fc, 0xf5895859, + 0x9ceda82d, 0xe27fe988, 0x91bfc762, 0xef2d86c7, + 0xc90a85fb, 0xb798c45e, 0xc458eab4, 0xbacaab11, + 0xd3ae5b65, 0xad3c1ac0, 0xdefc342a, 0xa06e758f, + 0x0c34d4c3, 0x72a69566, 0x0166bb8c, 0x7ff4fa29, + 0x16900a5d, 0x68024bf8, 0x1bc26512, 0x655024b7, + 0x578c636a, 0x291e22cf, 0x5ade0c25, 0x244c4d80, + 0x4d28bdf4, 0x33bafc51, 0x407ad2bb, 0x3ee8931e, + 0x92b23252, 0xec2073f7, 0x9fe05d1d, 0xe1721cb8, + 0x8816eccc, 0xf684ad69, 0x85448383, 0xfbd6c226, + 0xddf1c11a, 0xa36380bf, 0xd0a3ae55, 0xae31eff0, + 0xc7551f84, 0xb9c75e21, 0xca0770cb, 0xb495316e, + 0x18cf9022, 0x665dd187, 0x159dff6d, 0x6b0fbec8, + 0x026b4ebc, 0x7cf90f19, 0x0f3921f3, 0x71ab6056, + 0x9af7424c, 0xe46503e9, 0x97a52d03, 0xe9376ca6, + 0x80539cd2, 0xfec1dd77, 0x8d01f39d, 0xf393b238, + 0x5fc91374, 0x215b52d1, 0x529b7c3b, 0x2c093d9e, + 0x456dcdea, 0x3bff8c4f, 0x483fa2a5, 0x36ade300, + 0x108ae03c, 0x6e18a199, 0x1dd88f73, 0x634aced6, + 0x0a2e3ea2, 0x74bc7f07, 0x077c51ed, 0x79ee1048, + 0xd5b4b104, 0xab26f0a1, 0xd8e6de4b, 0xa6749fee, + 0xcf106f9a, 0xb1822e3f, 0xc24200d5, 0xbcd04170, + 0x8e0c06ad, 0xf09e4708, 0x835e69e2, 0xfdcc2847, + 0x94a8d833, 0xea3a9996, 0x99fab77c, 0xe768f6d9, + 0x4b325795, 0x35a01630, 0x466038da, 0x38f2797f, + 0x5196890b, 0x2f04c8ae, 0x5cc4e644, 0x2256a7e1, + 0x0471a4dd, 0x7ae3e578, 0x0923cb92, 0x77b18a37, + 0x1ed57a43, 0x60473be6, 0x1387150c, 0x6d1554a9, + 0xc14ff5e5, 0xbfddb440, 0xcc1d9aaa, 0xb28fdb0f, + 0xdbeb2b7b, 0xa5796ade, 0xd6b94434, 0xa82b0591 + },{ + 0x00000000, 0xb8aa45dd, 0x812367bf, 0x39892262, + 0xf331227b, 0x4b9b67a6, 0x721245c4, 0xcab80019, + 0xe66344f6, 0x5ec9012b, 0x67402349, 0xdfea6694, + 0x1552668d, 0xadf82350, 0x94710132, 0x2cdb44ef, + 0x3db164e9, 0x851b2134, 0xbc920356, 0x0438468b, + 0xce804692, 0x762a034f, 0x4fa3212d, 0xf70964f0, + 0xdbd2201f, 0x637865c2, 0x5af147a0, 0xe25b027d, + 0x28e30264, 0x904947b9, 0xa9c065db, 0x116a2006, + 0x8b1425d7, 0x33be600a, 0x0a374268, 0xb29d07b5, + 0x782507ac, 0xc08f4271, 0xf9066013, 0x41ac25ce, + 0x6d776121, 0xd5dd24fc, 0xec54069e, 0x54fe4343, + 0x9e46435a, 0x26ec0687, 0x1f6524e5, 0xa7cf6138, + 0xb6a5413e, 0x0e0f04e3, 0x37862681, 0x8f2c635c, + 0x45946345, 0xfd3e2698, 0xc4b704fa, 0x7c1d4127, + 0x50c605c8, 0xe86c4015, 0xd1e56277, 0x694f27aa, + 0xa3f727b3, 0x1b5d626e, 0x22d4400c, 0x9a7e05d1, + 0xe75fa6ab, 0x5ff5e376, 0x667cc114, 0xded684c9, + 0x146e84d0, 0xacc4c10d, 0x954de36f, 0x2de7a6b2, + 0x013ce25d, 0xb996a780, 0x801f85e2, 0x38b5c03f, + 0xf20dc026, 0x4aa785fb, 0x732ea799, 0xcb84e244, + 0xdaeec242, 0x6244879f, 0x5bcda5fd, 0xe367e020, + 0x29dfe039, 0x9175a5e4, 0xa8fc8786, 0x1056c25b, + 0x3c8d86b4, 0x8427c369, 0xbdaee10b, 0x0504a4d6, + 0xcfbca4cf, 0x7716e112, 0x4e9fc370, 0xf63586ad, + 0x6c4b837c, 0xd4e1c6a1, 0xed68e4c3, 0x55c2a11e, + 0x9f7aa107, 0x27d0e4da, 0x1e59c6b8, 0xa6f38365, + 0x8a28c78a, 0x32828257, 0x0b0ba035, 0xb3a1e5e8, + 0x7919e5f1, 0xc1b3a02c, 0xf83a824e, 0x4090c793, + 0x51fae795, 0xe950a248, 0xd0d9802a, 0x6873c5f7, + 0xa2cbc5ee, 0x1a618033, 0x23e8a251, 0x9b42e78c, + 0xb799a363, 0x0f33e6be, 0x36bac4dc, 0x8e108101, + 0x44a88118, 0xfc02c4c5, 0xc58be6a7, 0x7d21a37a, + 0x3fc9a052, 0x8763e58f, 0xbeeac7ed, 0x06408230, + 0xccf88229, 0x7452c7f4, 0x4ddbe596, 0xf571a04b, + 0xd9aae4a4, 0x6100a179, 0x5889831b, 0xe023c6c6, + 0x2a9bc6df, 0x92318302, 0xabb8a160, 0x1312e4bd, + 0x0278c4bb, 0xbad28166, 0x835ba304, 0x3bf1e6d9, + 0xf149e6c0, 0x49e3a31d, 0x706a817f, 0xc8c0c4a2, + 0xe41b804d, 0x5cb1c590, 0x6538e7f2, 0xdd92a22f, + 0x172aa236, 0xaf80e7eb, 0x9609c589, 0x2ea38054, + 0xb4dd8585, 0x0c77c058, 0x35fee23a, 0x8d54a7e7, + 0x47eca7fe, 0xff46e223, 0xc6cfc041, 0x7e65859c, + 0x52bec173, 0xea1484ae, 0xd39da6cc, 0x6b37e311, + 0xa18fe308, 0x1925a6d5, 0x20ac84b7, 0x9806c16a, + 0x896ce16c, 0x31c6a4b1, 0x084f86d3, 0xb0e5c30e, + 0x7a5dc317, 0xc2f786ca, 0xfb7ea4a8, 0x43d4e175, + 0x6f0fa59a, 0xd7a5e047, 0xee2cc225, 0x568687f8, + 0x9c3e87e1, 0x2494c23c, 0x1d1de05e, 0xa5b7a583, + 0xd89606f9, 0x603c4324, 0x59b56146, 0xe11f249b, + 0x2ba72482, 0x930d615f, 0xaa84433d, 0x122e06e0, + 0x3ef5420f, 0x865f07d2, 0xbfd625b0, 0x077c606d, + 0xcdc46074, 0x756e25a9, 0x4ce707cb, 0xf44d4216, + 0xe5276210, 0x5d8d27cd, 0x640405af, 0xdcae4072, + 0x1616406b, 0xaebc05b6, 0x973527d4, 0x2f9f6209, + 0x034426e6, 0xbbee633b, 0x82674159, 0x3acd0484, + 0xf075049d, 0x48df4140, 0x71566322, 0xc9fc26ff, + 0x5382232e, 0xeb2866f3, 0xd2a14491, 0x6a0b014c, + 0xa0b30155, 0x18194488, 0x219066ea, 0x993a2337, + 0xb5e167d8, 0x0d4b2205, 0x34c20067, 0x8c6845ba, + 0x46d045a3, 0xfe7a007e, 0xc7f3221c, 0x7f5967c1, + 0x6e3347c7, 0xd699021a, 0xef102078, 0x57ba65a5, + 0x9d0265bc, 0x25a82061, 0x1c210203, 0xa48b47de, + 0x88500331, 0x30fa46ec, 0x0973648e, 0xb1d92153, + 0x7b61214a, 0xc3cb6497, 0xfa4246f5, 0x42e80328 + },{ + 0x00000000, 0xac6f1138, 0x58df2270, 0xf4b03348, + 0xb0be45e0, 0x1cd154d8, 0xe8616790, 0x440e76a8, + 0x910b67c5, 0x3d6476fd, 0xc9d445b5, 0x65bb548d, + 0x21b52225, 0x8dda331d, 0x796a0055, 0xd505116d, + 0xd361228f, 0x7f0e33b7, 0x8bbe00ff, 0x27d111c7, + 0x63df676f, 0xcfb07657, 0x3b00451f, 0x976f5427, + 0x426a454a, 0xee055472, 0x1ab5673a, 0xb6da7602, + 0xf2d400aa, 0x5ebb1192, 0xaa0b22da, 0x066433e2, + 0x57b5a81b, 0xfbdab923, 0x0f6a8a6b, 0xa3059b53, + 0xe70bedfb, 0x4b64fcc3, 0xbfd4cf8b, 0x13bbdeb3, + 0xc6becfde, 0x6ad1dee6, 0x9e61edae, 0x320efc96, + 0x76008a3e, 0xda6f9b06, 0x2edfa84e, 0x82b0b976, + 0x84d48a94, 0x28bb9bac, 0xdc0ba8e4, 0x7064b9dc, + 0x346acf74, 0x9805de4c, 0x6cb5ed04, 0xc0dafc3c, + 0x15dfed51, 0xb9b0fc69, 0x4d00cf21, 0xe16fde19, + 0xa561a8b1, 0x090eb989, 0xfdbe8ac1, 0x51d19bf9, + 0xae6a5137, 0x0205400f, 0xf6b57347, 0x5ada627f, + 0x1ed414d7, 0xb2bb05ef, 0x460b36a7, 0xea64279f, + 0x3f6136f2, 0x930e27ca, 0x67be1482, 0xcbd105ba, + 0x8fdf7312, 0x23b0622a, 0xd7005162, 0x7b6f405a, + 0x7d0b73b8, 0xd1646280, 0x25d451c8, 0x89bb40f0, + 0xcdb53658, 0x61da2760, 0x956a1428, 0x39050510, + 0xec00147d, 0x406f0545, 0xb4df360d, 0x18b02735, + 0x5cbe519d, 0xf0d140a5, 0x046173ed, 0xa80e62d5, + 0xf9dff92c, 0x55b0e814, 0xa100db5c, 0x0d6fca64, + 0x4961bccc, 0xe50eadf4, 0x11be9ebc, 0xbdd18f84, + 0x68d49ee9, 0xc4bb8fd1, 0x300bbc99, 0x9c64ada1, + 0xd86adb09, 0x7405ca31, 0x80b5f979, 0x2cdae841, + 0x2abedba3, 0x86d1ca9b, 0x7261f9d3, 0xde0ee8eb, + 0x9a009e43, 0x366f8f7b, 0xc2dfbc33, 0x6eb0ad0b, + 0xbbb5bc66, 0x17daad5e, 0xe36a9e16, 0x4f058f2e, + 0x0b0bf986, 0xa764e8be, 0x53d4dbf6, 0xffbbcace, + 0x5cd5a26e, 0xf0bab356, 0x040a801e, 0xa8659126, + 0xec6be78e, 0x4004f6b6, 0xb4b4c5fe, 0x18dbd4c6, + 0xcddec5ab, 0x61b1d493, 0x9501e7db, 0x396ef6e3, + 0x7d60804b, 0xd10f9173, 0x25bfa23b, 0x89d0b303, + 0x8fb480e1, 0x23db91d9, 0xd76ba291, 0x7b04b3a9, + 0x3f0ac501, 0x9365d439, 0x67d5e771, 0xcbbaf649, + 0x1ebfe724, 0xb2d0f61c, 0x4660c554, 0xea0fd46c, + 0xae01a2c4, 0x026eb3fc, 0xf6de80b4, 0x5ab1918c, + 0x0b600a75, 0xa70f1b4d, 0x53bf2805, 0xffd0393d, + 0xbbde4f95, 0x17b15ead, 0xe3016de5, 0x4f6e7cdd, + 0x9a6b6db0, 0x36047c88, 0xc2b44fc0, 0x6edb5ef8, + 0x2ad52850, 0x86ba3968, 0x720a0a20, 0xde651b18, + 0xd80128fa, 0x746e39c2, 0x80de0a8a, 0x2cb11bb2, + 0x68bf6d1a, 0xc4d07c22, 0x30604f6a, 0x9c0f5e52, + 0x490a4f3f, 0xe5655e07, 0x11d56d4f, 0xbdba7c77, + 0xf9b40adf, 0x55db1be7, 0xa16b28af, 0x0d043997, + 0xf2bff359, 0x5ed0e261, 0xaa60d129, 0x060fc011, + 0x4201b6b9, 0xee6ea781, 0x1ade94c9, 0xb6b185f1, + 0x63b4949c, 0xcfdb85a4, 0x3b6bb6ec, 0x9704a7d4, + 0xd30ad17c, 0x7f65c044, 0x8bd5f30c, 0x27bae234, + 0x21ded1d6, 0x8db1c0ee, 0x7901f3a6, 0xd56ee29e, + 0x91609436, 0x3d0f850e, 0xc9bfb646, 0x65d0a77e, + 0xb0d5b613, 0x1cbaa72b, 0xe80a9463, 0x4465855b, + 0x006bf3f3, 0xac04e2cb, 0x58b4d183, 0xf4dbc0bb, + 0xa50a5b42, 0x09654a7a, 0xfdd57932, 0x51ba680a, + 0x15b41ea2, 0xb9db0f9a, 0x4d6b3cd2, 0xe1042dea, + 0x34013c87, 0x986e2dbf, 0x6cde1ef7, 0xc0b10fcf, + 0x84bf7967, 0x28d0685f, 0xdc605b17, 0x700f4a2f, + 0x766b79cd, 0xda0468f5, 0x2eb45bbd, 0x82db4a85, + 0xc6d53c2d, 0x6aba2d15, 0x9e0a1e5d, 0x32650f65, + 0xe7601e08, 0x4b0f0f30, 0xbfbf3c78, 0x13d02d40, + 0x57de5be8, 0xfbb14ad0, 0x0f017998, 0xa36e68a0 + },{ + 0x00000000, 0x196b30ef, 0xc3a08cdb, 0xdacbbc34, + 0x7737f5b2, 0x6e5cc55d, 0xb4977969, 0xadfc4986, + 0x1f180660, 0x0673368f, 0xdcb88abb, 0xc5d3ba54, + 0x682ff3d2, 0x7144c33d, 0xab8f7f09, 0xb2e44fe6, + 0x3e300cc0, 0x275b3c2f, 0xfd90801b, 0xe4fbb0f4, + 0x4907f972, 0x506cc99d, 0x8aa775a9, 0x93cc4546, + 0x21280aa0, 0x38433a4f, 0xe288867b, 0xfbe3b694, + 0x561fff12, 0x4f74cffd, 0x95bf73c9, 0x8cd44326, + 0x8d16f485, 0x947dc46a, 0x4eb6785e, 0x57dd48b1, + 0xfa210137, 0xe34a31d8, 0x39818dec, 0x20eabd03, + 0x920ef2e5, 0x8b65c20a, 0x51ae7e3e, 0x48c54ed1, + 0xe5390757, 0xfc5237b8, 0x26998b8c, 0x3ff2bb63, + 0xb326f845, 0xaa4dc8aa, 0x7086749e, 0x69ed4471, + 0xc4110df7, 0xdd7a3d18, 0x07b1812c, 0x1edab1c3, + 0xac3efe25, 0xb555ceca, 0x6f9e72fe, 0x76f54211, + 0xdb090b97, 0xc2623b78, 0x18a9874c, 0x01c2b7a3, + 0xeb5b040e, 0xf23034e1, 0x28fb88d5, 0x3190b83a, + 0x9c6cf1bc, 0x8507c153, 0x5fcc7d67, 0x46a74d88, + 0xf443026e, 0xed283281, 0x37e38eb5, 0x2e88be5a, + 0x8374f7dc, 0x9a1fc733, 0x40d47b07, 0x59bf4be8, + 0xd56b08ce, 0xcc003821, 0x16cb8415, 0x0fa0b4fa, + 0xa25cfd7c, 0xbb37cd93, 0x61fc71a7, 0x78974148, + 0xca730eae, 0xd3183e41, 0x09d38275, 0x10b8b29a, + 0xbd44fb1c, 0xa42fcbf3, 0x7ee477c7, 0x678f4728, + 0x664df08b, 0x7f26c064, 0xa5ed7c50, 0xbc864cbf, + 0x117a0539, 0x081135d6, 0xd2da89e2, 0xcbb1b90d, + 0x7955f6eb, 0x603ec604, 0xbaf57a30, 0xa39e4adf, + 0x0e620359, 0x170933b6, 0xcdc28f82, 0xd4a9bf6d, + 0x587dfc4b, 0x4116cca4, 0x9bdd7090, 0x82b6407f, + 0x2f4a09f9, 0x36213916, 0xecea8522, 0xf581b5cd, + 0x4765fa2b, 0x5e0ecac4, 0x84c576f0, 0x9dae461f, + 0x30520f99, 0x29393f76, 0xf3f28342, 0xea99b3ad, + 0xd6b7081c, 0xcfdc38f3, 0x151784c7, 0x0c7cb428, + 0xa180fdae, 0xb8ebcd41, 0x62207175, 0x7b4b419a, + 0xc9af0e7c, 0xd0c43e93, 0x0a0f82a7, 0x1364b248, + 0xbe98fbce, 0xa7f3cb21, 0x7d387715, 0x645347fa, + 0xe88704dc, 0xf1ec3433, 0x2b278807, 0x324cb8e8, + 0x9fb0f16e, 0x86dbc181, 0x5c107db5, 0x457b4d5a, + 0xf79f02bc, 0xeef43253, 0x343f8e67, 0x2d54be88, + 0x80a8f70e, 0x99c3c7e1, 0x43087bd5, 0x5a634b3a, + 0x5ba1fc99, 0x42cacc76, 0x98017042, 0x816a40ad, + 0x2c96092b, 0x35fd39c4, 0xef3685f0, 0xf65db51f, + 0x44b9faf9, 0x5dd2ca16, 0x87197622, 0x9e7246cd, + 0x338e0f4b, 0x2ae53fa4, 0xf02e8390, 0xe945b37f, + 0x6591f059, 0x7cfac0b6, 0xa6317c82, 0xbf5a4c6d, + 0x12a605eb, 0x0bcd3504, 0xd1068930, 0xc86db9df, + 0x7a89f639, 0x63e2c6d6, 0xb9297ae2, 0xa0424a0d, + 0x0dbe038b, 0x14d53364, 0xce1e8f50, 0xd775bfbf, + 0x3dec0c12, 0x24873cfd, 0xfe4c80c9, 0xe727b026, + 0x4adbf9a0, 0x53b0c94f, 0x897b757b, 0x90104594, + 0x22f40a72, 0x3b9f3a9d, 0xe15486a9, 0xf83fb646, + 0x55c3ffc0, 0x4ca8cf2f, 0x9663731b, 0x8f0843f4, + 0x03dc00d2, 0x1ab7303d, 0xc07c8c09, 0xd917bce6, + 0x74ebf560, 0x6d80c58f, 0xb74b79bb, 0xae204954, + 0x1cc406b2, 0x05af365d, 0xdf648a69, 0xc60fba86, + 0x6bf3f300, 0x7298c3ef, 0xa8537fdb, 0xb1384f34, + 0xb0faf897, 0xa991c878, 0x735a744c, 0x6a3144a3, + 0xc7cd0d25, 0xdea63dca, 0x046d81fe, 0x1d06b111, + 0xafe2fef7, 0xb689ce18, 0x6c42722c, 0x752942c3, + 0xd8d50b45, 0xc1be3baa, 0x1b75879e, 0x021eb771, + 0x8ecaf457, 0x97a1c4b8, 0x4d6a788c, 0x54014863, + 0xf9fd01e5, 0xe096310a, 0x3a5d8d3e, 0x2336bdd1, + 0x91d2f237, 0x88b9c2d8, 0x52727eec, 0x4b194e03, + 0xe6e50785, 0xff8e376a, 0x25458b5e, 0x3c2ebbb1 + },{ + 0x00000000, 0xc82c0368, 0x905906d0, 0x587505b8, + 0xd1c5e0a5, 0x19e9e3cd, 0x419ce675, 0x89b0e51d, + 0x53fd2d4e, 0x9bd12e26, 0xc3a42b9e, 0x0b8828f6, + 0x8238cdeb, 0x4a14ce83, 0x1261cb3b, 0xda4dc853, + 0xa6fa5b9c, 0x6ed658f4, 0x36a35d4c, 0xfe8f5e24, + 0x773fbb39, 0xbf13b851, 0xe766bde9, 0x2f4abe81, + 0xf50776d2, 0x3d2b75ba, 0x655e7002, 0xad72736a, + 0x24c29677, 0xecee951f, 0xb49b90a7, 0x7cb793cf, + 0xbd835b3d, 0x75af5855, 0x2dda5ded, 0xe5f65e85, + 0x6c46bb98, 0xa46ab8f0, 0xfc1fbd48, 0x3433be20, + 0xee7e7673, 0x2652751b, 0x7e2770a3, 0xb60b73cb, + 0x3fbb96d6, 0xf79795be, 0xafe29006, 0x67ce936e, + 0x1b7900a1, 0xd35503c9, 0x8b200671, 0x430c0519, + 0xcabce004, 0x0290e36c, 0x5ae5e6d4, 0x92c9e5bc, + 0x48842def, 0x80a82e87, 0xd8dd2b3f, 0x10f12857, + 0x9941cd4a, 0x516dce22, 0x0918cb9a, 0xc134c8f2, + 0x7a07b77a, 0xb22bb412, 0xea5eb1aa, 0x2272b2c2, + 0xabc257df, 0x63ee54b7, 0x3b9b510f, 0xf3b75267, + 0x29fa9a34, 0xe1d6995c, 0xb9a39ce4, 0x718f9f8c, + 0xf83f7a91, 0x301379f9, 0x68667c41, 0xa04a7f29, + 0xdcfdece6, 0x14d1ef8e, 0x4ca4ea36, 0x8488e95e, + 0x0d380c43, 0xc5140f2b, 0x9d610a93, 0x554d09fb, + 0x8f00c1a8, 0x472cc2c0, 0x1f59c778, 0xd775c410, + 0x5ec5210d, 0x96e92265, 0xce9c27dd, 0x06b024b5, + 0xc784ec47, 0x0fa8ef2f, 0x57ddea97, 0x9ff1e9ff, + 0x16410ce2, 0xde6d0f8a, 0x86180a32, 0x4e34095a, + 0x9479c109, 0x5c55c261, 0x0420c7d9, 0xcc0cc4b1, + 0x45bc21ac, 0x8d9022c4, 0xd5e5277c, 0x1dc92414, + 0x617eb7db, 0xa952b4b3, 0xf127b10b, 0x390bb263, + 0xb0bb577e, 0x78975416, 0x20e251ae, 0xe8ce52c6, + 0x32839a95, 0xfaaf99fd, 0xa2da9c45, 0x6af69f2d, + 0xe3467a30, 0x2b6a7958, 0x731f7ce0, 0xbb337f88, + 0xf40e6ef5, 0x3c226d9d, 0x64576825, 0xac7b6b4d, + 0x25cb8e50, 0xede78d38, 0xb5928880, 0x7dbe8be8, + 0xa7f343bb, 0x6fdf40d3, 0x37aa456b, 0xff864603, + 0x7636a31e, 0xbe1aa076, 0xe66fa5ce, 0x2e43a6a6, + 0x52f43569, 0x9ad83601, 0xc2ad33b9, 0x0a8130d1, + 0x8331d5cc, 0x4b1dd6a4, 0x1368d31c, 0xdb44d074, + 0x01091827, 0xc9251b4f, 0x91501ef7, 0x597c1d9f, + 0xd0ccf882, 0x18e0fbea, 0x4095fe52, 0x88b9fd3a, + 0x498d35c8, 0x81a136a0, 0xd9d43318, 0x11f83070, + 0x9848d56d, 0x5064d605, 0x0811d3bd, 0xc03dd0d5, + 0x1a701886, 0xd25c1bee, 0x8a291e56, 0x42051d3e, + 0xcbb5f823, 0x0399fb4b, 0x5becfef3, 0x93c0fd9b, + 0xef776e54, 0x275b6d3c, 0x7f2e6884, 0xb7026bec, + 0x3eb28ef1, 0xf69e8d99, 0xaeeb8821, 0x66c78b49, + 0xbc8a431a, 0x74a64072, 0x2cd345ca, 0xe4ff46a2, + 0x6d4fa3bf, 0xa563a0d7, 0xfd16a56f, 0x353aa607, + 0x8e09d98f, 0x4625dae7, 0x1e50df5f, 0xd67cdc37, + 0x5fcc392a, 0x97e03a42, 0xcf953ffa, 0x07b93c92, + 0xddf4f4c1, 0x15d8f7a9, 0x4dadf211, 0x8581f179, + 0x0c311464, 0xc41d170c, 0x9c6812b4, 0x544411dc, + 0x28f38213, 0xe0df817b, 0xb8aa84c3, 0x708687ab, + 0xf93662b6, 0x311a61de, 0x696f6466, 0xa143670e, + 0x7b0eaf5d, 0xb322ac35, 0xeb57a98d, 0x237baae5, + 0xaacb4ff8, 0x62e74c90, 0x3a924928, 0xf2be4a40, + 0x338a82b2, 0xfba681da, 0xa3d38462, 0x6bff870a, + 0xe24f6217, 0x2a63617f, 0x721664c7, 0xba3a67af, + 0x6077affc, 0xa85bac94, 0xf02ea92c, 0x3802aa44, + 0xb1b24f59, 0x799e4c31, 0x21eb4989, 0xe9c74ae1, + 0x9570d92e, 0x5d5cda46, 0x0529dffe, 0xcd05dc96, + 0x44b5398b, 0x8c993ae3, 0xd4ec3f5b, 0x1cc03c33, + 0xc68df460, 0x0ea1f708, 0x56d4f2b0, 0x9ef8f1d8, + 0x174814c5, 0xdf6417ad, 0x87111215, 0x4f3d117d + },{ + 0x00000000, 0x277d3c49, 0x4efa7892, 0x698744db, + 0x6d821d21, 0x4aff2168, 0x237865b3, 0x040559fa, + 0xda043b42, 0xfd79070b, 0x94fe43d0, 0xb3837f99, + 0xb7862663, 0x90fb1a2a, 0xf97c5ef1, 0xde0162b8, + 0xb4097684, 0x93744acd, 0xfaf30e16, 0xdd8e325f, + 0xd98b6ba5, 0xfef657ec, 0x97711337, 0xb00c2f7e, + 0x6e0d4dc6, 0x4970718f, 0x20f73554, 0x078a091d, + 0x038f50e7, 0x24f26cae, 0x4d752875, 0x6a08143c, + 0x9965000d, 0xbe183c44, 0xd79f789f, 0xf0e244d6, + 0xf4e71d2c, 0xd39a2165, 0xba1d65be, 0x9d6059f7, + 0x43613b4f, 0x641c0706, 0x0d9b43dd, 0x2ae67f94, + 0x2ee3266e, 0x099e1a27, 0x60195efc, 0x476462b5, + 0x2d6c7689, 0x0a114ac0, 0x63960e1b, 0x44eb3252, + 0x40ee6ba8, 0x679357e1, 0x0e14133a, 0x29692f73, + 0xf7684dcb, 0xd0157182, 0xb9923559, 0x9eef0910, + 0x9aea50ea, 0xbd976ca3, 0xd4102878, 0xf36d1431, + 0x32cb001a, 0x15b63c53, 0x7c317888, 0x5b4c44c1, + 0x5f491d3b, 0x78342172, 0x11b365a9, 0x36ce59e0, + 0xe8cf3b58, 0xcfb20711, 0xa63543ca, 0x81487f83, + 0x854d2679, 0xa2301a30, 0xcbb75eeb, 0xecca62a2, + 0x86c2769e, 0xa1bf4ad7, 0xc8380e0c, 0xef453245, + 0xeb406bbf, 0xcc3d57f6, 0xa5ba132d, 0x82c72f64, + 0x5cc64ddc, 0x7bbb7195, 0x123c354e, 0x35410907, + 0x314450fd, 0x16396cb4, 0x7fbe286f, 0x58c31426, + 0xabae0017, 0x8cd33c5e, 0xe5547885, 0xc22944cc, + 0xc62c1d36, 0xe151217f, 0x88d665a4, 0xafab59ed, + 0x71aa3b55, 0x56d7071c, 0x3f5043c7, 0x182d7f8e, + 0x1c282674, 0x3b551a3d, 0x52d25ee6, 0x75af62af, + 0x1fa77693, 0x38da4ada, 0x515d0e01, 0x76203248, + 0x72256bb2, 0x555857fb, 0x3cdf1320, 0x1ba22f69, + 0xc5a34dd1, 0xe2de7198, 0x8b593543, 0xac24090a, + 0xa82150f0, 0x8f5c6cb9, 0xe6db2862, 0xc1a6142b, + 0x64960134, 0x43eb3d7d, 0x2a6c79a6, 0x0d1145ef, + 0x09141c15, 0x2e69205c, 0x47ee6487, 0x609358ce, + 0xbe923a76, 0x99ef063f, 0xf06842e4, 0xd7157ead, + 0xd3102757, 0xf46d1b1e, 0x9dea5fc5, 0xba97638c, + 0xd09f77b0, 0xf7e24bf9, 0x9e650f22, 0xb918336b, + 0xbd1d6a91, 0x9a6056d8, 0xf3e71203, 0xd49a2e4a, + 0x0a9b4cf2, 0x2de670bb, 0x44613460, 0x631c0829, + 0x671951d3, 0x40646d9a, 0x29e32941, 0x0e9e1508, + 0xfdf30139, 0xda8e3d70, 0xb30979ab, 0x947445e2, + 0x90711c18, 0xb70c2051, 0xde8b648a, 0xf9f658c3, + 0x27f73a7b, 0x008a0632, 0x690d42e9, 0x4e707ea0, + 0x4a75275a, 0x6d081b13, 0x048f5fc8, 0x23f26381, + 0x49fa77bd, 0x6e874bf4, 0x07000f2f, 0x207d3366, + 0x24786a9c, 0x030556d5, 0x6a82120e, 0x4dff2e47, + 0x93fe4cff, 0xb48370b6, 0xdd04346d, 0xfa790824, + 0xfe7c51de, 0xd9016d97, 0xb086294c, 0x97fb1505, + 0x565d012e, 0x71203d67, 0x18a779bc, 0x3fda45f5, + 0x3bdf1c0f, 0x1ca22046, 0x7525649d, 0x525858d4, + 0x8c593a6c, 0xab240625, 0xc2a342fe, 0xe5de7eb7, + 0xe1db274d, 0xc6a61b04, 0xaf215fdf, 0x885c6396, + 0xe25477aa, 0xc5294be3, 0xacae0f38, 0x8bd33371, + 0x8fd66a8b, 0xa8ab56c2, 0xc12c1219, 0xe6512e50, + 0x38504ce8, 0x1f2d70a1, 0x76aa347a, 0x51d70833, + 0x55d251c9, 0x72af6d80, 0x1b28295b, 0x3c551512, + 0xcf380123, 0xe8453d6a, 0x81c279b1, 0xa6bf45f8, + 0xa2ba1c02, 0x85c7204b, 0xec406490, 0xcb3d58d9, + 0x153c3a61, 0x32410628, 0x5bc642f3, 0x7cbb7eba, + 0x78be2740, 0x5fc31b09, 0x36445fd2, 0x1139639b, + 0x7b3177a7, 0x5c4c4bee, 0x35cb0f35, 0x12b6337c, + 0x16b36a86, 0x31ce56cf, 0x58491214, 0x7f342e5d, + 0xa1354ce5, 0x864870ac, 0xefcf3477, 0xc8b2083e, + 0xccb751c4, 0xebca6d8d, 0x824d2956, 0xa530151f + } +}; + +static const unsigned int __attribute__((aligned(128))) crc32ctable_be[8][256] = { + { + 0x00000000, 0x1edc6f41, 0x3db8de82, 0x2364b1c3, + 0x7b71bd04, 0x65add245, 0x46c96386, 0x58150cc7, + 0xf6e37a08, 0xe83f1549, 0xcb5ba48a, 0xd587cbcb, + 0x8d92c70c, 0x934ea84d, 0xb02a198e, 0xaef676cf, + 0xf31a9b51, 0xedc6f410, 0xcea245d3, 0xd07e2a92, + 0x886b2655, 0x96b74914, 0xb5d3f8d7, 0xab0f9796, + 0x05f9e159, 0x1b258e18, 0x38413fdb, 0x269d509a, + 0x7e885c5d, 0x6054331c, 0x433082df, 0x5deced9e, + 0xf8e959e3, 0xe63536a2, 0xc5518761, 0xdb8de820, + 0x8398e4e7, 0x9d448ba6, 0xbe203a65, 0xa0fc5524, + 0x0e0a23eb, 0x10d64caa, 0x33b2fd69, 0x2d6e9228, + 0x757b9eef, 0x6ba7f1ae, 0x48c3406d, 0x561f2f2c, + 0x0bf3c2b2, 0x152fadf3, 0x364b1c30, 0x28977371, + 0x70827fb6, 0x6e5e10f7, 0x4d3aa134, 0x53e6ce75, + 0xfd10b8ba, 0xe3ccd7fb, 0xc0a86638, 0xde740979, + 0x866105be, 0x98bd6aff, 0xbbd9db3c, 0xa505b47d, + 0xef0edc87, 0xf1d2b3c6, 0xd2b60205, 0xcc6a6d44, + 0x947f6183, 0x8aa30ec2, 0xa9c7bf01, 0xb71bd040, + 0x19eda68f, 0x0731c9ce, 0x2455780d, 0x3a89174c, + 0x629c1b8b, 0x7c4074ca, 0x5f24c509, 0x41f8aa48, + 0x1c1447d6, 0x02c82897, 0x21ac9954, 0x3f70f615, + 0x6765fad2, 0x79b99593, 0x5add2450, 0x44014b11, + 0xeaf73dde, 0xf42b529f, 0xd74fe35c, 0xc9938c1d, + 0x918680da, 0x8f5aef9b, 0xac3e5e58, 0xb2e23119, + 0x17e78564, 0x093bea25, 0x2a5f5be6, 0x348334a7, + 0x6c963860, 0x724a5721, 0x512ee6e2, 0x4ff289a3, + 0xe104ff6c, 0xffd8902d, 0xdcbc21ee, 0xc2604eaf, + 0x9a754268, 0x84a92d29, 0xa7cd9cea, 0xb911f3ab, + 0xe4fd1e35, 0xfa217174, 0xd945c0b7, 0xc799aff6, + 0x9f8ca331, 0x8150cc70, 0xa2347db3, 0xbce812f2, + 0x121e643d, 0x0cc20b7c, 0x2fa6babf, 0x317ad5fe, + 0x696fd939, 0x77b3b678, 0x54d707bb, 0x4a0b68fa, + 0xc0c1d64f, 0xde1db90e, 0xfd7908cd, 0xe3a5678c, + 0xbbb06b4b, 0xa56c040a, 0x8608b5c9, 0x98d4da88, + 0x3622ac47, 0x28fec306, 0x0b9a72c5, 0x15461d84, + 0x4d531143, 0x538f7e02, 0x70ebcfc1, 0x6e37a080, + 0x33db4d1e, 0x2d07225f, 0x0e63939c, 0x10bffcdd, + 0x48aaf01a, 0x56769f5b, 0x75122e98, 0x6bce41d9, + 0xc5383716, 0xdbe45857, 0xf880e994, 0xe65c86d5, + 0xbe498a12, 0xa095e553, 0x83f15490, 0x9d2d3bd1, + 0x38288fac, 0x26f4e0ed, 0x0590512e, 0x1b4c3e6f, + 0x435932a8, 0x5d855de9, 0x7ee1ec2a, 0x603d836b, + 0xcecbf5a4, 0xd0179ae5, 0xf3732b26, 0xedaf4467, + 0xb5ba48a0, 0xab6627e1, 0x88029622, 0x96def963, + 0xcb3214fd, 0xd5ee7bbc, 0xf68aca7f, 0xe856a53e, + 0xb043a9f9, 0xae9fc6b8, 0x8dfb777b, 0x9327183a, + 0x3dd16ef5, 0x230d01b4, 0x0069b077, 0x1eb5df36, + 0x46a0d3f1, 0x587cbcb0, 0x7b180d73, 0x65c46232, + 0x2fcf0ac8, 0x31136589, 0x1277d44a, 0x0cabbb0b, + 0x54beb7cc, 0x4a62d88d, 0x6906694e, 0x77da060f, + 0xd92c70c0, 0xc7f01f81, 0xe494ae42, 0xfa48c103, + 0xa25dcdc4, 0xbc81a285, 0x9fe51346, 0x81397c07, + 0xdcd59199, 0xc209fed8, 0xe16d4f1b, 0xffb1205a, + 0xa7a42c9d, 0xb97843dc, 0x9a1cf21f, 0x84c09d5e, + 0x2a36eb91, 0x34ea84d0, 0x178e3513, 0x09525a52, + 0x51475695, 0x4f9b39d4, 0x6cff8817, 0x7223e756, + 0xd726532b, 0xc9fa3c6a, 0xea9e8da9, 0xf442e2e8, + 0xac57ee2f, 0xb28b816e, 0x91ef30ad, 0x8f335fec, + 0x21c52923, 0x3f194662, 0x1c7df7a1, 0x02a198e0, + 0x5ab49427, 0x4468fb66, 0x670c4aa5, 0x79d025e4, + 0x243cc87a, 0x3ae0a73b, 0x198416f8, 0x075879b9, + 0x5f4d757e, 0x41911a3f, 0x62f5abfc, 0x7c29c4bd, + 0xd2dfb272, 0xcc03dd33, 0xef676cf0, 0xf1bb03b1, + 0xa9ae0f76, 0xb7726037, 0x9416d1f4, 0x8acabeb5 + },{ + 0x00000000, 0x9f5fc3df, 0x2063e8ff, 0xbf3c2b20, + 0x40c7d1fe, 0xdf981221, 0x60a43901, 0xfffbfade, + 0x818fa3fc, 0x1ed06023, 0xa1ec4b03, 0x3eb388dc, + 0xc1487202, 0x5e17b1dd, 0xe12b9afd, 0x7e745922, + 0x1dc328b9, 0x829ceb66, 0x3da0c046, 0xa2ff0399, + 0x5d04f947, 0xc25b3a98, 0x7d6711b8, 0xe238d267, + 0x9c4c8b45, 0x0313489a, 0xbc2f63ba, 0x2370a065, + 0xdc8b5abb, 0x43d49964, 0xfce8b244, 0x63b7719b, + 0x3b865172, 0xa4d992ad, 0x1be5b98d, 0x84ba7a52, + 0x7b41808c, 0xe41e4353, 0x5b226873, 0xc47dabac, + 0xba09f28e, 0x25563151, 0x9a6a1a71, 0x0535d9ae, + 0xface2370, 0x6591e0af, 0xdaadcb8f, 0x45f20850, + 0x264579cb, 0xb91aba14, 0x06269134, 0x997952eb, + 0x6682a835, 0xf9dd6bea, 0x46e140ca, 0xd9be8315, + 0xa7cada37, 0x389519e8, 0x87a932c8, 0x18f6f117, + 0xe70d0bc9, 0x7852c816, 0xc76ee336, 0x583120e9, + 0x770ca2e4, 0xe853613b, 0x576f4a1b, 0xc83089c4, + 0x37cb731a, 0xa894b0c5, 0x17a89be5, 0x88f7583a, + 0xf6830118, 0x69dcc2c7, 0xd6e0e9e7, 0x49bf2a38, + 0xb644d0e6, 0x291b1339, 0x96273819, 0x0978fbc6, + 0x6acf8a5d, 0xf5904982, 0x4aac62a2, 0xd5f3a17d, + 0x2a085ba3, 0xb557987c, 0x0a6bb35c, 0x95347083, + 0xeb4029a1, 0x741fea7e, 0xcb23c15e, 0x547c0281, + 0xab87f85f, 0x34d83b80, 0x8be410a0, 0x14bbd37f, + 0x4c8af396, 0xd3d53049, 0x6ce91b69, 0xf3b6d8b6, + 0x0c4d2268, 0x9312e1b7, 0x2c2eca97, 0xb3710948, + 0xcd05506a, 0x525a93b5, 0xed66b895, 0x72397b4a, + 0x8dc28194, 0x129d424b, 0xada1696b, 0x32feaab4, + 0x5149db2f, 0xce1618f0, 0x712a33d0, 0xee75f00f, + 0x118e0ad1, 0x8ed1c90e, 0x31ede22e, 0xaeb221f1, + 0xd0c678d3, 0x4f99bb0c, 0xf0a5902c, 0x6ffa53f3, + 0x9001a92d, 0x0f5e6af2, 0xb06241d2, 0x2f3d820d, + 0xee1945c8, 0x71468617, 0xce7aad37, 0x51256ee8, + 0xaede9436, 0x318157e9, 0x8ebd7cc9, 0x11e2bf16, + 0x6f96e634, 0xf0c925eb, 0x4ff50ecb, 0xd0aacd14, + 0x2f5137ca, 0xb00ef415, 0x0f32df35, 0x906d1cea, + 0xf3da6d71, 0x6c85aeae, 0xd3b9858e, 0x4ce64651, + 0xb31dbc8f, 0x2c427f50, 0x937e5470, 0x0c2197af, + 0x7255ce8d, 0xed0a0d52, 0x52362672, 0xcd69e5ad, + 0x32921f73, 0xadcddcac, 0x12f1f78c, 0x8dae3453, + 0xd59f14ba, 0x4ac0d765, 0xf5fcfc45, 0x6aa33f9a, + 0x9558c544, 0x0a07069b, 0xb53b2dbb, 0x2a64ee64, + 0x5410b746, 0xcb4f7499, 0x74735fb9, 0xeb2c9c66, + 0x14d766b8, 0x8b88a567, 0x34b48e47, 0xabeb4d98, + 0xc85c3c03, 0x5703ffdc, 0xe83fd4fc, 0x77601723, + 0x889bedfd, 0x17c42e22, 0xa8f80502, 0x37a7c6dd, + 0x49d39fff, 0xd68c5c20, 0x69b07700, 0xf6efb4df, + 0x09144e01, 0x964b8dde, 0x2977a6fe, 0xb6286521, + 0x9915e72c, 0x064a24f3, 0xb9760fd3, 0x2629cc0c, + 0xd9d236d2, 0x468df50d, 0xf9b1de2d, 0x66ee1df2, + 0x189a44d0, 0x87c5870f, 0x38f9ac2f, 0xa7a66ff0, + 0x585d952e, 0xc70256f1, 0x783e7dd1, 0xe761be0e, + 0x84d6cf95, 0x1b890c4a, 0xa4b5276a, 0x3beae4b5, + 0xc4111e6b, 0x5b4eddb4, 0xe472f694, 0x7b2d354b, + 0x05596c69, 0x9a06afb6, 0x253a8496, 0xba654749, + 0x459ebd97, 0xdac17e48, 0x65fd5568, 0xfaa296b7, + 0xa293b65e, 0x3dcc7581, 0x82f05ea1, 0x1daf9d7e, + 0xe25467a0, 0x7d0ba47f, 0xc2378f5f, 0x5d684c80, + 0x231c15a2, 0xbc43d67d, 0x037ffd5d, 0x9c203e82, + 0x63dbc45c, 0xfc840783, 0x43b82ca3, 0xdce7ef7c, + 0xbf509ee7, 0x200f5d38, 0x9f337618, 0x006cb5c7, + 0xff974f19, 0x60c88cc6, 0xdff4a7e6, 0x40ab6439, + 0x3edf3d1b, 0xa180fec4, 0x1ebcd5e4, 0x81e3163b, + 0x7e18ece5, 0xe1472f3a, 0x5e7b041a, 0xc124c7c5 + },{ + 0x00000000, 0xc2eee4d1, 0x9b01a6e3, 0x59ef4232, + 0x28df2287, 0xea31c656, 0xb3de8464, 0x713060b5, + 0x51be450e, 0x9350a1df, 0xcabfe3ed, 0x0851073c, + 0x79616789, 0xbb8f8358, 0xe260c16a, 0x208e25bb, + 0xa37c8a1c, 0x61926ecd, 0x387d2cff, 0xfa93c82e, + 0x8ba3a89b, 0x494d4c4a, 0x10a20e78, 0xd24ceaa9, + 0xf2c2cf12, 0x302c2bc3, 0x69c369f1, 0xab2d8d20, + 0xda1ded95, 0x18f30944, 0x411c4b76, 0x83f2afa7, + 0x58257b79, 0x9acb9fa8, 0xc324dd9a, 0x01ca394b, + 0x70fa59fe, 0xb214bd2f, 0xebfbff1d, 0x29151bcc, + 0x099b3e77, 0xcb75daa6, 0x929a9894, 0x50747c45, + 0x21441cf0, 0xe3aaf821, 0xba45ba13, 0x78ab5ec2, + 0xfb59f165, 0x39b715b4, 0x60585786, 0xa2b6b357, + 0xd386d3e2, 0x11683733, 0x48877501, 0x8a6991d0, + 0xaae7b46b, 0x680950ba, 0x31e61288, 0xf308f659, + 0x823896ec, 0x40d6723d, 0x1939300f, 0xdbd7d4de, + 0xb04af6f2, 0x72a41223, 0x2b4b5011, 0xe9a5b4c0, + 0x9895d475, 0x5a7b30a4, 0x03947296, 0xc17a9647, + 0xe1f4b3fc, 0x231a572d, 0x7af5151f, 0xb81bf1ce, + 0xc92b917b, 0x0bc575aa, 0x522a3798, 0x90c4d349, + 0x13367cee, 0xd1d8983f, 0x8837da0d, 0x4ad93edc, + 0x3be95e69, 0xf907bab8, 0xa0e8f88a, 0x62061c5b, + 0x428839e0, 0x8066dd31, 0xd9899f03, 0x1b677bd2, + 0x6a571b67, 0xa8b9ffb6, 0xf156bd84, 0x33b85955, + 0xe86f8d8b, 0x2a81695a, 0x736e2b68, 0xb180cfb9, + 0xc0b0af0c, 0x025e4bdd, 0x5bb109ef, 0x995fed3e, + 0xb9d1c885, 0x7b3f2c54, 0x22d06e66, 0xe03e8ab7, + 0x910eea02, 0x53e00ed3, 0x0a0f4ce1, 0xc8e1a830, + 0x4b130797, 0x89fde346, 0xd012a174, 0x12fc45a5, + 0x63cc2510, 0xa122c1c1, 0xf8cd83f3, 0x3a236722, + 0x1aad4299, 0xd843a648, 0x81ace47a, 0x434200ab, + 0x3272601e, 0xf09c84cf, 0xa973c6fd, 0x6b9d222c, + 0x7e4982a5, 0xbca76674, 0xe5482446, 0x27a6c097, + 0x5696a022, 0x947844f3, 0xcd9706c1, 0x0f79e210, + 0x2ff7c7ab, 0xed19237a, 0xb4f66148, 0x76188599, + 0x0728e52c, 0xc5c601fd, 0x9c2943cf, 0x5ec7a71e, + 0xdd3508b9, 0x1fdbec68, 0x4634ae5a, 0x84da4a8b, + 0xf5ea2a3e, 0x3704ceef, 0x6eeb8cdd, 0xac05680c, + 0x8c8b4db7, 0x4e65a966, 0x178aeb54, 0xd5640f85, + 0xa4546f30, 0x66ba8be1, 0x3f55c9d3, 0xfdbb2d02, + 0x266cf9dc, 0xe4821d0d, 0xbd6d5f3f, 0x7f83bbee, + 0x0eb3db5b, 0xcc5d3f8a, 0x95b27db8, 0x575c9969, + 0x77d2bcd2, 0xb53c5803, 0xecd31a31, 0x2e3dfee0, + 0x5f0d9e55, 0x9de37a84, 0xc40c38b6, 0x06e2dc67, + 0x851073c0, 0x47fe9711, 0x1e11d523, 0xdcff31f2, + 0xadcf5147, 0x6f21b596, 0x36cef7a4, 0xf4201375, + 0xd4ae36ce, 0x1640d21f, 0x4faf902d, 0x8d4174fc, + 0xfc711449, 0x3e9ff098, 0x6770b2aa, 0xa59e567b, + 0xce037457, 0x0ced9086, 0x5502d2b4, 0x97ec3665, + 0xe6dc56d0, 0x2432b201, 0x7dddf033, 0xbf3314e2, + 0x9fbd3159, 0x5d53d588, 0x04bc97ba, 0xc652736b, + 0xb76213de, 0x758cf70f, 0x2c63b53d, 0xee8d51ec, + 0x6d7ffe4b, 0xaf911a9a, 0xf67e58a8, 0x3490bc79, + 0x45a0dccc, 0x874e381d, 0xdea17a2f, 0x1c4f9efe, + 0x3cc1bb45, 0xfe2f5f94, 0xa7c01da6, 0x652ef977, + 0x141e99c2, 0xd6f07d13, 0x8f1f3f21, 0x4df1dbf0, + 0x96260f2e, 0x54c8ebff, 0x0d27a9cd, 0xcfc94d1c, + 0xbef92da9, 0x7c17c978, 0x25f88b4a, 0xe7166f9b, + 0xc7984a20, 0x0576aef1, 0x5c99ecc3, 0x9e770812, + 0xef4768a7, 0x2da98c76, 0x7446ce44, 0xb6a82a95, + 0x355a8532, 0xf7b461e3, 0xae5b23d1, 0x6cb5c700, + 0x1d85a7b5, 0xdf6b4364, 0x86840156, 0x446ae587, + 0x64e4c03c, 0xa60a24ed, 0xffe566df, 0x3d0b820e, + 0x4c3be2bb, 0x8ed5066a, 0xd73a4458, 0x15d4a089 + },{ + 0x00000000, 0xfc93054a, 0xe7fa65d5, 0x1b69609f, + 0xd128a4eb, 0x2dbba1a1, 0x36d2c13e, 0xca41c474, + 0xbc8d2697, 0x401e23dd, 0x5b774342, 0xa7e44608, + 0x6da5827c, 0x91368736, 0x8a5fe7a9, 0x76cce2e3, + 0x67c6226f, 0x9b552725, 0x803c47ba, 0x7caf42f0, + 0xb6ee8684, 0x4a7d83ce, 0x5114e351, 0xad87e61b, + 0xdb4b04f8, 0x27d801b2, 0x3cb1612d, 0xc0226467, + 0x0a63a013, 0xf6f0a559, 0xed99c5c6, 0x110ac08c, + 0xcf8c44de, 0x331f4194, 0x2876210b, 0xd4e52441, + 0x1ea4e035, 0xe237e57f, 0xf95e85e0, 0x05cd80aa, + 0x73016249, 0x8f926703, 0x94fb079c, 0x686802d6, + 0xa229c6a2, 0x5ebac3e8, 0x45d3a377, 0xb940a63d, + 0xa84a66b1, 0x54d963fb, 0x4fb00364, 0xb323062e, + 0x7962c25a, 0x85f1c710, 0x9e98a78f, 0x620ba2c5, + 0x14c74026, 0xe854456c, 0xf33d25f3, 0x0fae20b9, + 0xc5efe4cd, 0x397ce187, 0x22158118, 0xde868452, + 0x81c4e6fd, 0x7d57e3b7, 0x663e8328, 0x9aad8662, + 0x50ec4216, 0xac7f475c, 0xb71627c3, 0x4b852289, + 0x3d49c06a, 0xc1dac520, 0xdab3a5bf, 0x2620a0f5, + 0xec616481, 0x10f261cb, 0x0b9b0154, 0xf708041e, + 0xe602c492, 0x1a91c1d8, 0x01f8a147, 0xfd6ba40d, + 0x372a6079, 0xcbb96533, 0xd0d005ac, 0x2c4300e6, + 0x5a8fe205, 0xa61ce74f, 0xbd7587d0, 0x41e6829a, + 0x8ba746ee, 0x773443a4, 0x6c5d233b, 0x90ce2671, + 0x4e48a223, 0xb2dba769, 0xa9b2c7f6, 0x5521c2bc, + 0x9f6006c8, 0x63f30382, 0x789a631d, 0x84096657, + 0xf2c584b4, 0x0e5681fe, 0x153fe161, 0xe9ace42b, + 0x23ed205f, 0xdf7e2515, 0xc417458a, 0x388440c0, + 0x298e804c, 0xd51d8506, 0xce74e599, 0x32e7e0d3, + 0xf8a624a7, 0x043521ed, 0x1f5c4172, 0xe3cf4438, + 0x9503a6db, 0x6990a391, 0x72f9c30e, 0x8e6ac644, + 0x442b0230, 0xb8b8077a, 0xa3d167e5, 0x5f4262af, + 0x1d55a2bb, 0xe1c6a7f1, 0xfaafc76e, 0x063cc224, + 0xcc7d0650, 0x30ee031a, 0x2b876385, 0xd71466cf, + 0xa1d8842c, 0x5d4b8166, 0x4622e1f9, 0xbab1e4b3, + 0x70f020c7, 0x8c63258d, 0x970a4512, 0x6b994058, + 0x7a9380d4, 0x8600859e, 0x9d69e501, 0x61fae04b, + 0xabbb243f, 0x57282175, 0x4c4141ea, 0xb0d244a0, + 0xc61ea643, 0x3a8da309, 0x21e4c396, 0xdd77c6dc, + 0x173602a8, 0xeba507e2, 0xf0cc677d, 0x0c5f6237, + 0xd2d9e665, 0x2e4ae32f, 0x352383b0, 0xc9b086fa, + 0x03f1428e, 0xff6247c4, 0xe40b275b, 0x18982211, + 0x6e54c0f2, 0x92c7c5b8, 0x89aea527, 0x753da06d, + 0xbf7c6419, 0x43ef6153, 0x588601cc, 0xa4150486, + 0xb51fc40a, 0x498cc140, 0x52e5a1df, 0xae76a495, + 0x643760e1, 0x98a465ab, 0x83cd0534, 0x7f5e007e, + 0x0992e29d, 0xf501e7d7, 0xee688748, 0x12fb8202, + 0xd8ba4676, 0x2429433c, 0x3f4023a3, 0xc3d326e9, + 0x9c914446, 0x6002410c, 0x7b6b2193, 0x87f824d9, + 0x4db9e0ad, 0xb12ae5e7, 0xaa438578, 0x56d08032, + 0x201c62d1, 0xdc8f679b, 0xc7e60704, 0x3b75024e, + 0xf134c63a, 0x0da7c370, 0x16cea3ef, 0xea5da6a5, + 0xfb576629, 0x07c46363, 0x1cad03fc, 0xe03e06b6, + 0x2a7fc2c2, 0xd6ecc788, 0xcd85a717, 0x3116a25d, + 0x47da40be, 0xbb4945f4, 0xa020256b, 0x5cb32021, + 0x96f2e455, 0x6a61e11f, 0x71088180, 0x8d9b84ca, + 0x531d0098, 0xaf8e05d2, 0xb4e7654d, 0x48746007, + 0x8235a473, 0x7ea6a139, 0x65cfc1a6, 0x995cc4ec, + 0xef90260f, 0x13032345, 0x086a43da, 0xf4f94690, + 0x3eb882e4, 0xc22b87ae, 0xd942e731, 0x25d1e27b, + 0x34db22f7, 0xc84827bd, 0xd3214722, 0x2fb24268, + 0xe5f3861c, 0x19608356, 0x0209e3c9, 0xfe9ae683, + 0x88560460, 0x74c5012a, 0x6fac61b5, 0x933f64ff, + 0x597ea08b, 0xa5eda5c1, 0xbe84c55e, 0x4217c014 + },{ + 0x00000000, 0x3aab4576, 0x75568aec, 0x4ffdcf9a, + 0xeaad15d8, 0xd00650ae, 0x9ffb9f34, 0xa550da42, + 0xcb8644f1, 0xf12d0187, 0xbed0ce1d, 0x847b8b6b, + 0x212b5129, 0x1b80145f, 0x547ddbc5, 0x6ed69eb3, + 0x89d0e6a3, 0xb37ba3d5, 0xfc866c4f, 0xc62d2939, + 0x637df37b, 0x59d6b60d, 0x162b7997, 0x2c803ce1, + 0x4256a252, 0x78fde724, 0x370028be, 0x0dab6dc8, + 0xa8fbb78a, 0x9250f2fc, 0xddad3d66, 0xe7067810, + 0x0d7da207, 0x37d6e771, 0x782b28eb, 0x42806d9d, + 0xe7d0b7df, 0xdd7bf2a9, 0x92863d33, 0xa82d7845, + 0xc6fbe6f6, 0xfc50a380, 0xb3ad6c1a, 0x8906296c, + 0x2c56f32e, 0x16fdb658, 0x590079c2, 0x63ab3cb4, + 0x84ad44a4, 0xbe0601d2, 0xf1fbce48, 0xcb508b3e, + 0x6e00517c, 0x54ab140a, 0x1b56db90, 0x21fd9ee6, + 0x4f2b0055, 0x75804523, 0x3a7d8ab9, 0x00d6cfcf, + 0xa586158d, 0x9f2d50fb, 0xd0d09f61, 0xea7bda17, + 0x1afb440e, 0x20500178, 0x6fadcee2, 0x55068b94, + 0xf05651d6, 0xcafd14a0, 0x8500db3a, 0xbfab9e4c, + 0xd17d00ff, 0xebd64589, 0xa42b8a13, 0x9e80cf65, + 0x3bd01527, 0x017b5051, 0x4e869fcb, 0x742ddabd, + 0x932ba2ad, 0xa980e7db, 0xe67d2841, 0xdcd66d37, + 0x7986b775, 0x432df203, 0x0cd03d99, 0x367b78ef, + 0x58ade65c, 0x6206a32a, 0x2dfb6cb0, 0x175029c6, + 0xb200f384, 0x88abb6f2, 0xc7567968, 0xfdfd3c1e, + 0x1786e609, 0x2d2da37f, 0x62d06ce5, 0x587b2993, + 0xfd2bf3d1, 0xc780b6a7, 0x887d793d, 0xb2d63c4b, + 0xdc00a2f8, 0xe6abe78e, 0xa9562814, 0x93fd6d62, + 0x36adb720, 0x0c06f256, 0x43fb3dcc, 0x795078ba, + 0x9e5600aa, 0xa4fd45dc, 0xeb008a46, 0xd1abcf30, + 0x74fb1572, 0x4e505004, 0x01ad9f9e, 0x3b06dae8, + 0x55d0445b, 0x6f7b012d, 0x2086ceb7, 0x1a2d8bc1, + 0xbf7d5183, 0x85d614f5, 0xca2bdb6f, 0xf0809e19, + 0x35f6881c, 0x0f5dcd6a, 0x40a002f0, 0x7a0b4786, + 0xdf5b9dc4, 0xe5f0d8b2, 0xaa0d1728, 0x90a6525e, + 0xfe70cced, 0xc4db899b, 0x8b264601, 0xb18d0377, + 0x14ddd935, 0x2e769c43, 0x618b53d9, 0x5b2016af, + 0xbc266ebf, 0x868d2bc9, 0xc970e453, 0xf3dba125, + 0x568b7b67, 0x6c203e11, 0x23ddf18b, 0x1976b4fd, + 0x77a02a4e, 0x4d0b6f38, 0x02f6a0a2, 0x385de5d4, + 0x9d0d3f96, 0xa7a67ae0, 0xe85bb57a, 0xd2f0f00c, + 0x388b2a1b, 0x02206f6d, 0x4ddda0f7, 0x7776e581, + 0xd2263fc3, 0xe88d7ab5, 0xa770b52f, 0x9ddbf059, + 0xf30d6eea, 0xc9a62b9c, 0x865be406, 0xbcf0a170, + 0x19a07b32, 0x230b3e44, 0x6cf6f1de, 0x565db4a8, + 0xb15bccb8, 0x8bf089ce, 0xc40d4654, 0xfea60322, + 0x5bf6d960, 0x615d9c16, 0x2ea0538c, 0x140b16fa, + 0x7add8849, 0x4076cd3f, 0x0f8b02a5, 0x352047d3, + 0x90709d91, 0xaadbd8e7, 0xe526177d, 0xdf8d520b, + 0x2f0dcc12, 0x15a68964, 0x5a5b46fe, 0x60f00388, + 0xc5a0d9ca, 0xff0b9cbc, 0xb0f65326, 0x8a5d1650, + 0xe48b88e3, 0xde20cd95, 0x91dd020f, 0xab764779, + 0x0e269d3b, 0x348dd84d, 0x7b7017d7, 0x41db52a1, + 0xa6dd2ab1, 0x9c766fc7, 0xd38ba05d, 0xe920e52b, + 0x4c703f69, 0x76db7a1f, 0x3926b585, 0x038df0f3, + 0x6d5b6e40, 0x57f02b36, 0x180de4ac, 0x22a6a1da, + 0x87f67b98, 0xbd5d3eee, 0xf2a0f174, 0xc80bb402, + 0x22706e15, 0x18db2b63, 0x5726e4f9, 0x6d8da18f, + 0xc8dd7bcd, 0xf2763ebb, 0xbd8bf121, 0x8720b457, + 0xe9f62ae4, 0xd35d6f92, 0x9ca0a008, 0xa60be57e, + 0x035b3f3c, 0x39f07a4a, 0x760db5d0, 0x4ca6f0a6, + 0xaba088b6, 0x910bcdc0, 0xdef6025a, 0xe45d472c, + 0x410d9d6e, 0x7ba6d818, 0x345b1782, 0x0ef052f4, + 0x6026cc47, 0x5a8d8931, 0x157046ab, 0x2fdb03dd, + 0x8a8bd99f, 0xb0209ce9, 0xffdd5373, 0xc5761605 + },{ + 0x00000000, 0x6bed1038, 0xd7da2070, 0xbc373048, + 0xb1682fa1, 0xda853f99, 0x66b20fd1, 0x0d5f1fe9, + 0x7c0c3003, 0x17e1203b, 0xabd61073, 0xc03b004b, + 0xcd641fa2, 0xa6890f9a, 0x1abe3fd2, 0x71532fea, + 0xf8186006, 0x93f5703e, 0x2fc24076, 0x442f504e, + 0x49704fa7, 0x229d5f9f, 0x9eaa6fd7, 0xf5477fef, + 0x84145005, 0xeff9403d, 0x53ce7075, 0x3823604d, + 0x357c7fa4, 0x5e916f9c, 0xe2a65fd4, 0x894b4fec, + 0xeeecaf4d, 0x8501bf75, 0x39368f3d, 0x52db9f05, + 0x5f8480ec, 0x346990d4, 0x885ea09c, 0xe3b3b0a4, + 0x92e09f4e, 0xf90d8f76, 0x453abf3e, 0x2ed7af06, + 0x2388b0ef, 0x4865a0d7, 0xf452909f, 0x9fbf80a7, + 0x16f4cf4b, 0x7d19df73, 0xc12eef3b, 0xaac3ff03, + 0xa79ce0ea, 0xcc71f0d2, 0x7046c09a, 0x1babd0a2, + 0x6af8ff48, 0x0115ef70, 0xbd22df38, 0xd6cfcf00, + 0xdb90d0e9, 0xb07dc0d1, 0x0c4af099, 0x67a7e0a1, + 0xc30531db, 0xa8e821e3, 0x14df11ab, 0x7f320193, + 0x726d1e7a, 0x19800e42, 0xa5b73e0a, 0xce5a2e32, + 0xbf0901d8, 0xd4e411e0, 0x68d321a8, 0x033e3190, + 0x0e612e79, 0x658c3e41, 0xd9bb0e09, 0xb2561e31, + 0x3b1d51dd, 0x50f041e5, 0xecc771ad, 0x872a6195, + 0x8a757e7c, 0xe1986e44, 0x5daf5e0c, 0x36424e34, + 0x471161de, 0x2cfc71e6, 0x90cb41ae, 0xfb265196, + 0xf6794e7f, 0x9d945e47, 0x21a36e0f, 0x4a4e7e37, + 0x2de99e96, 0x46048eae, 0xfa33bee6, 0x91deaede, + 0x9c81b137, 0xf76ca10f, 0x4b5b9147, 0x20b6817f, + 0x51e5ae95, 0x3a08bead, 0x863f8ee5, 0xedd29edd, + 0xe08d8134, 0x8b60910c, 0x3757a144, 0x5cbab17c, + 0xd5f1fe90, 0xbe1ceea8, 0x022bdee0, 0x69c6ced8, + 0x6499d131, 0x0f74c109, 0xb343f141, 0xd8aee179, + 0xa9fdce93, 0xc210deab, 0x7e27eee3, 0x15cafedb, + 0x1895e132, 0x7378f10a, 0xcf4fc142, 0xa4a2d17a, + 0x98d60cf7, 0xf33b1ccf, 0x4f0c2c87, 0x24e13cbf, + 0x29be2356, 0x4253336e, 0xfe640326, 0x9589131e, + 0xe4da3cf4, 0x8f372ccc, 0x33001c84, 0x58ed0cbc, + 0x55b21355, 0x3e5f036d, 0x82683325, 0xe985231d, + 0x60ce6cf1, 0x0b237cc9, 0xb7144c81, 0xdcf95cb9, + 0xd1a64350, 0xba4b5368, 0x067c6320, 0x6d917318, + 0x1cc25cf2, 0x772f4cca, 0xcb187c82, 0xa0f56cba, + 0xadaa7353, 0xc647636b, 0x7a705323, 0x119d431b, + 0x763aa3ba, 0x1dd7b382, 0xa1e083ca, 0xca0d93f2, + 0xc7528c1b, 0xacbf9c23, 0x1088ac6b, 0x7b65bc53, + 0x0a3693b9, 0x61db8381, 0xddecb3c9, 0xb601a3f1, + 0xbb5ebc18, 0xd0b3ac20, 0x6c849c68, 0x07698c50, + 0x8e22c3bc, 0xe5cfd384, 0x59f8e3cc, 0x3215f3f4, + 0x3f4aec1d, 0x54a7fc25, 0xe890cc6d, 0x837ddc55, + 0xf22ef3bf, 0x99c3e387, 0x25f4d3cf, 0x4e19c3f7, + 0x4346dc1e, 0x28abcc26, 0x949cfc6e, 0xff71ec56, + 0x5bd33d2c, 0x303e2d14, 0x8c091d5c, 0xe7e40d64, + 0xeabb128d, 0x815602b5, 0x3d6132fd, 0x568c22c5, + 0x27df0d2f, 0x4c321d17, 0xf0052d5f, 0x9be83d67, + 0x96b7228e, 0xfd5a32b6, 0x416d02fe, 0x2a8012c6, + 0xa3cb5d2a, 0xc8264d12, 0x74117d5a, 0x1ffc6d62, + 0x12a3728b, 0x794e62b3, 0xc57952fb, 0xae9442c3, + 0xdfc76d29, 0xb42a7d11, 0x081d4d59, 0x63f05d61, + 0x6eaf4288, 0x054252b0, 0xb97562f8, 0xd29872c0, + 0xb53f9261, 0xded28259, 0x62e5b211, 0x0908a229, + 0x0457bdc0, 0x6fbaadf8, 0xd38d9db0, 0xb8608d88, + 0xc933a262, 0xa2deb25a, 0x1ee98212, 0x7504922a, + 0x785b8dc3, 0x13b69dfb, 0xaf81adb3, 0xc46cbd8b, + 0x4d27f267, 0x26cae25f, 0x9afdd217, 0xf110c22f, + 0xfc4fddc6, 0x97a2cdfe, 0x2b95fdb6, 0x4078ed8e, + 0x312bc264, 0x5ac6d25c, 0xe6f1e214, 0x8d1cf22c, + 0x8043edc5, 0xebaefdfd, 0x5799cdb5, 0x3c74dd8d + },{ + 0x00000000, 0x2f7076af, 0x5ee0ed5e, 0x71909bf1, + 0xbdc1dabc, 0x92b1ac13, 0xe32137e2, 0xcc51414d, + 0x655fda39, 0x4a2fac96, 0x3bbf3767, 0x14cf41c8, + 0xd89e0085, 0xf7ee762a, 0x867eeddb, 0xa90e9b74, + 0xcabfb472, 0xe5cfc2dd, 0x945f592c, 0xbb2f2f83, + 0x777e6ece, 0x580e1861, 0x299e8390, 0x06eef53f, + 0xafe06e4b, 0x809018e4, 0xf1008315, 0xde70f5ba, + 0x1221b4f7, 0x3d51c258, 0x4cc159a9, 0x63b12f06, + 0x8ba307a5, 0xa4d3710a, 0xd543eafb, 0xfa339c54, + 0x3662dd19, 0x1912abb6, 0x68823047, 0x47f246e8, + 0xeefcdd9c, 0xc18cab33, 0xb01c30c2, 0x9f6c466d, + 0x533d0720, 0x7c4d718f, 0x0dddea7e, 0x22ad9cd1, + 0x411cb3d7, 0x6e6cc578, 0x1ffc5e89, 0x308c2826, + 0xfcdd696b, 0xd3ad1fc4, 0xa23d8435, 0x8d4df29a, + 0x244369ee, 0x0b331f41, 0x7aa384b0, 0x55d3f21f, + 0x9982b352, 0xb6f2c5fd, 0xc7625e0c, 0xe81228a3, + 0x099a600b, 0x26ea16a4, 0x577a8d55, 0x780afbfa, + 0xb45bbab7, 0x9b2bcc18, 0xeabb57e9, 0xc5cb2146, + 0x6cc5ba32, 0x43b5cc9d, 0x3225576c, 0x1d5521c3, + 0xd104608e, 0xfe741621, 0x8fe48dd0, 0xa094fb7f, + 0xc325d479, 0xec55a2d6, 0x9dc53927, 0xb2b54f88, + 0x7ee40ec5, 0x5194786a, 0x2004e39b, 0x0f749534, + 0xa67a0e40, 0x890a78ef, 0xf89ae31e, 0xd7ea95b1, + 0x1bbbd4fc, 0x34cba253, 0x455b39a2, 0x6a2b4f0d, + 0x823967ae, 0xad491101, 0xdcd98af0, 0xf3a9fc5f, + 0x3ff8bd12, 0x1088cbbd, 0x6118504c, 0x4e6826e3, + 0xe766bd97, 0xc816cb38, 0xb98650c9, 0x96f62666, + 0x5aa7672b, 0x75d71184, 0x04478a75, 0x2b37fcda, + 0x4886d3dc, 0x67f6a573, 0x16663e82, 0x3916482d, + 0xf5470960, 0xda377fcf, 0xaba7e43e, 0x84d79291, + 0x2dd909e5, 0x02a97f4a, 0x7339e4bb, 0x5c499214, + 0x9018d359, 0xbf68a5f6, 0xcef83e07, 0xe18848a8, + 0x1334c016, 0x3c44b6b9, 0x4dd42d48, 0x62a45be7, + 0xaef51aaa, 0x81856c05, 0xf015f7f4, 0xdf65815b, + 0x766b1a2f, 0x591b6c80, 0x288bf771, 0x07fb81de, + 0xcbaac093, 0xe4dab63c, 0x954a2dcd, 0xba3a5b62, + 0xd98b7464, 0xf6fb02cb, 0x876b993a, 0xa81bef95, + 0x644aaed8, 0x4b3ad877, 0x3aaa4386, 0x15da3529, + 0xbcd4ae5d, 0x93a4d8f2, 0xe2344303, 0xcd4435ac, + 0x011574e1, 0x2e65024e, 0x5ff599bf, 0x7085ef10, + 0x9897c7b3, 0xb7e7b11c, 0xc6772aed, 0xe9075c42, + 0x25561d0f, 0x0a266ba0, 0x7bb6f051, 0x54c686fe, + 0xfdc81d8a, 0xd2b86b25, 0xa328f0d4, 0x8c58867b, + 0x4009c736, 0x6f79b199, 0x1ee92a68, 0x31995cc7, + 0x522873c1, 0x7d58056e, 0x0cc89e9f, 0x23b8e830, + 0xefe9a97d, 0xc099dfd2, 0xb1094423, 0x9e79328c, + 0x3777a9f8, 0x1807df57, 0x699744a6, 0x46e73209, + 0x8ab67344, 0xa5c605eb, 0xd4569e1a, 0xfb26e8b5, + 0x1aaea01d, 0x35ded6b2, 0x444e4d43, 0x6b3e3bec, + 0xa76f7aa1, 0x881f0c0e, 0xf98f97ff, 0xd6ffe150, + 0x7ff17a24, 0x50810c8b, 0x2111977a, 0x0e61e1d5, + 0xc230a098, 0xed40d637, 0x9cd04dc6, 0xb3a03b69, + 0xd011146f, 0xff6162c0, 0x8ef1f931, 0xa1818f9e, + 0x6dd0ced3, 0x42a0b87c, 0x3330238d, 0x1c405522, + 0xb54ece56, 0x9a3eb8f9, 0xebae2308, 0xc4de55a7, + 0x088f14ea, 0x27ff6245, 0x566ff9b4, 0x791f8f1b, + 0x910da7b8, 0xbe7dd117, 0xcfed4ae6, 0xe09d3c49, + 0x2ccc7d04, 0x03bc0bab, 0x722c905a, 0x5d5ce6f5, + 0xf4527d81, 0xdb220b2e, 0xaab290df, 0x85c2e670, + 0x4993a73d, 0x66e3d192, 0x17734a63, 0x38033ccc, + 0x5bb213ca, 0x74c26565, 0x0552fe94, 0x2a22883b, + 0xe673c976, 0xc903bfd9, 0xb8932428, 0x97e35287, + 0x3eedc9f3, 0x119dbf5c, 0x600d24ad, 0x4f7d5202, + 0x832c134f, 0xac5c65e0, 0xddccfe11, 0xf2bc88be + },{ + 0x00000000, 0x2669802c, 0x4cd30058, 0x6aba8074, + 0x99a600b0, 0xbfcf809c, 0xd57500e8, 0xf31c80c4, + 0x2d906e21, 0x0bf9ee0d, 0x61436e79, 0x472aee55, + 0xb4366e91, 0x925feebd, 0xf8e56ec9, 0xde8ceee5, + 0x5b20dc42, 0x7d495c6e, 0x17f3dc1a, 0x319a5c36, + 0xc286dcf2, 0xe4ef5cde, 0x8e55dcaa, 0xa83c5c86, + 0x76b0b263, 0x50d9324f, 0x3a63b23b, 0x1c0a3217, + 0xef16b2d3, 0xc97f32ff, 0xa3c5b28b, 0x85ac32a7, + 0xb641b884, 0x902838a8, 0xfa92b8dc, 0xdcfb38f0, + 0x2fe7b834, 0x098e3818, 0x6334b86c, 0x455d3840, + 0x9bd1d6a5, 0xbdb85689, 0xd702d6fd, 0xf16b56d1, + 0x0277d615, 0x241e5639, 0x4ea4d64d, 0x68cd5661, + 0xed6164c6, 0xcb08e4ea, 0xa1b2649e, 0x87dbe4b2, + 0x74c76476, 0x52aee45a, 0x3814642e, 0x1e7de402, + 0xc0f10ae7, 0xe6988acb, 0x8c220abf, 0xaa4b8a93, + 0x59570a57, 0x7f3e8a7b, 0x15840a0f, 0x33ed8a23, + 0x725f1e49, 0x54369e65, 0x3e8c1e11, 0x18e59e3d, + 0xebf91ef9, 0xcd909ed5, 0xa72a1ea1, 0x81439e8d, + 0x5fcf7068, 0x79a6f044, 0x131c7030, 0x3575f01c, + 0xc66970d8, 0xe000f0f4, 0x8aba7080, 0xacd3f0ac, + 0x297fc20b, 0x0f164227, 0x65acc253, 0x43c5427f, + 0xb0d9c2bb, 0x96b04297, 0xfc0ac2e3, 0xda6342cf, + 0x04efac2a, 0x22862c06, 0x483cac72, 0x6e552c5e, + 0x9d49ac9a, 0xbb202cb6, 0xd19aacc2, 0xf7f32cee, + 0xc41ea6cd, 0xe27726e1, 0x88cda695, 0xaea426b9, + 0x5db8a67d, 0x7bd12651, 0x116ba625, 0x37022609, + 0xe98ec8ec, 0xcfe748c0, 0xa55dc8b4, 0x83344898, + 0x7028c85c, 0x56414870, 0x3cfbc804, 0x1a924828, + 0x9f3e7a8f, 0xb957faa3, 0xd3ed7ad7, 0xf584fafb, + 0x06987a3f, 0x20f1fa13, 0x4a4b7a67, 0x6c22fa4b, + 0xb2ae14ae, 0x94c79482, 0xfe7d14f6, 0xd81494da, + 0x2b08141e, 0x0d619432, 0x67db1446, 0x41b2946a, + 0xe4be3c92, 0xc2d7bcbe, 0xa86d3cca, 0x8e04bce6, + 0x7d183c22, 0x5b71bc0e, 0x31cb3c7a, 0x17a2bc56, + 0xc92e52b3, 0xef47d29f, 0x85fd52eb, 0xa394d2c7, + 0x50885203, 0x76e1d22f, 0x1c5b525b, 0x3a32d277, + 0xbf9ee0d0, 0x99f760fc, 0xf34de088, 0xd52460a4, + 0x2638e060, 0x0051604c, 0x6aebe038, 0x4c826014, + 0x920e8ef1, 0xb4670edd, 0xdedd8ea9, 0xf8b40e85, + 0x0ba88e41, 0x2dc10e6d, 0x477b8e19, 0x61120e35, + 0x52ff8416, 0x7496043a, 0x1e2c844e, 0x38450462, + 0xcb5984a6, 0xed30048a, 0x878a84fe, 0xa1e304d2, + 0x7f6fea37, 0x59066a1b, 0x33bcea6f, 0x15d56a43, + 0xe6c9ea87, 0xc0a06aab, 0xaa1aeadf, 0x8c736af3, + 0x09df5854, 0x2fb6d878, 0x450c580c, 0x6365d820, + 0x907958e4, 0xb610d8c8, 0xdcaa58bc, 0xfac3d890, + 0x244f3675, 0x0226b659, 0x689c362d, 0x4ef5b601, + 0xbde936c5, 0x9b80b6e9, 0xf13a369d, 0xd753b6b1, + 0x96e122db, 0xb088a2f7, 0xda322283, 0xfc5ba2af, + 0x0f47226b, 0x292ea247, 0x43942233, 0x65fda21f, + 0xbb714cfa, 0x9d18ccd6, 0xf7a24ca2, 0xd1cbcc8e, + 0x22d74c4a, 0x04becc66, 0x6e044c12, 0x486dcc3e, + 0xcdc1fe99, 0xeba87eb5, 0x8112fec1, 0xa77b7eed, + 0x5467fe29, 0x720e7e05, 0x18b4fe71, 0x3edd7e5d, + 0xe05190b8, 0xc6381094, 0xac8290e0, 0x8aeb10cc, + 0x79f79008, 0x5f9e1024, 0x35249050, 0x134d107c, + 0x20a09a5f, 0x06c91a73, 0x6c739a07, 0x4a1a1a2b, + 0xb9069aef, 0x9f6f1ac3, 0xf5d59ab7, 0xd3bc1a9b, + 0x0d30f47e, 0x2b597452, 0x41e3f426, 0x678a740a, + 0x9496f4ce, 0xb2ff74e2, 0xd845f496, 0xfe2c74ba, + 0x7b80461d, 0x5de9c631, 0x37534645, 0x113ac669, + 0xe22646ad, 0xc44fc681, 0xaef546f5, 0x889cc6d9, + 0x5610283c, 0x7079a810, 0x1ac32864, 0x3caaa848, + 0xcfb6288c, 0xe9dfa8a0, 0x836528d4, 0xa50ca8f8 + } +}; diff --git a/src/third_party/wiredtiger/src/checksum/zseries/vx-insn.h b/src/third_party/wiredtiger/src/checksum/zseries/vx-insn.h new file mode 100644 index 00000000000..4c78290b58b --- /dev/null +++ b/src/third_party/wiredtiger/src/checksum/zseries/vx-insn.h @@ -0,0 +1,480 @@ +/* + * Support for Vector Instructions + * + * Assembler macros to generate .byte/.word code for particular + * vector instructions that are supported by recent binutils (>= 2.26) only. + * + * Copyright IBM Corp. 2015 + * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> + */ + +#ifndef __ASM_S390_VX_INSN_H +#define __ASM_S390_VX_INSN_H + +/* Boilerplate for function entry points */ +#define WT_CRC32_ENTRY(name) \ +.globl name; \ +.align 4, 0x90; \ +name: + +/* Macros to generate vector instruction byte code */ + +#define REG_NUM_INVALID 255 + +/* GR_NUM - Retrieve general-purpose register number + * + * @opd: Operand to store register number + * @r64: String designation register in the format "%rN" + */ +.macro GR_NUM opd gr + \opd = REG_NUM_INVALID + .ifc \gr,%r0 + \opd = 0 + .endif + .ifc \gr,%r1 + \opd = 1 + .endif + .ifc \gr,%r2 + \opd = 2 + .endif + .ifc \gr,%r3 + \opd = 3 + .endif + .ifc \gr,%r4 + \opd = 4 + .endif + .ifc \gr,%r5 + \opd = 5 + .endif + .ifc \gr,%r6 + \opd = 6 + .endif + .ifc \gr,%r7 + \opd = 7 + .endif + .ifc \gr,%r8 + \opd = 8 + .endif + .ifc \gr,%r9 + \opd = 9 + .endif + .ifc \gr,%r10 + \opd = 10 + .endif + .ifc \gr,%r11 + \opd = 11 + .endif + .ifc \gr,%r12 + \opd = 12 + .endif + .ifc \gr,%r13 + \opd = 13 + .endif + .ifc \gr,%r14 + \opd = 14 + .endif + .ifc \gr,%r15 + \opd = 15 + .endif + .if \opd == REG_NUM_INVALID + .error "Invalid general-purpose register designation: \gr" + .endif +.endm + +/* VX_R() - Macro to encode the VX_NUM into the instruction */ +#define VX_R(v) (v & 0x0F) + +/* VX_NUM - Retrieve vector register number + * + * @opd: Operand to store register number + * @vxr: String designation register in the format "%vN" + * + * The vector register number is used for as input number to the + * instruction and, as well as, to compute the RXB field of the + * instruction. To encode the particular vector register number, + * use the VX_R(v) macro to extract the instruction opcode. + */ +.macro VX_NUM opd vxr + \opd = REG_NUM_INVALID + .ifc \vxr,%v0 + \opd = 0 + .endif + .ifc \vxr,%v1 + \opd = 1 + .endif + .ifc \vxr,%v2 + \opd = 2 + .endif + .ifc \vxr,%v3 + \opd = 3 + .endif + .ifc \vxr,%v4 + \opd = 4 + .endif + .ifc \vxr,%v5 + \opd = 5 + .endif + .ifc \vxr,%v6 + \opd = 6 + .endif + .ifc \vxr,%v7 + \opd = 7 + .endif + .ifc \vxr,%v8 + \opd = 8 + .endif + .ifc \vxr,%v9 + \opd = 9 + .endif + .ifc \vxr,%v10 + \opd = 10 + .endif + .ifc \vxr,%v11 + \opd = 11 + .endif + .ifc \vxr,%v12 + \opd = 12 + .endif + .ifc \vxr,%v13 + \opd = 13 + .endif + .ifc \vxr,%v14 + \opd = 14 + .endif + .ifc \vxr,%v15 + \opd = 15 + .endif + .ifc \vxr,%v16 + \opd = 16 + .endif + .ifc \vxr,%v17 + \opd = 17 + .endif + .ifc \vxr,%v18 + \opd = 18 + .endif + .ifc \vxr,%v19 + \opd = 19 + .endif + .ifc \vxr,%v20 + \opd = 20 + .endif + .ifc \vxr,%v21 + \opd = 21 + .endif + .ifc \vxr,%v22 + \opd = 22 + .endif + .ifc \vxr,%v23 + \opd = 23 + .endif + .ifc \vxr,%v24 + \opd = 24 + .endif + .ifc \vxr,%v25 + \opd = 25 + .endif + .ifc \vxr,%v26 + \opd = 26 + .endif + .ifc \vxr,%v27 + \opd = 27 + .endif + .ifc \vxr,%v28 + \opd = 28 + .endif + .ifc \vxr,%v29 + \opd = 29 + .endif + .ifc \vxr,%v30 + \opd = 30 + .endif + .ifc \vxr,%v31 + \opd = 31 + .endif + .if \opd == REG_NUM_INVALID + .error "Invalid vector register designation: \vxr" + .endif +.endm + +/* RXB - Compute most significant bit used vector registers + * + * @rxb: Operand to store computed RXB value + * @v1: First vector register designated operand + * @v2: Second vector register designated operand + * @v3: Third vector register designated operand + * @v4: Fourth vector register designated operand + */ +.macro RXB rxb v1 v2=0 v3=0 v4=0 + \rxb = 0 + .if \v1 & 0x10 + \rxb = \rxb | 0x08 + .endif + .if \v2 & 0x10 + \rxb = \rxb | 0x04 + .endif + .if \v3 & 0x10 + \rxb = \rxb | 0x02 + .endif + .if \v4 & 0x10 + \rxb = \rxb | 0x01 + .endif +.endm + +/* MRXB - Generate Element Size Control and RXB value + * + * @m: Element size control + * @v1: First vector register designated operand (for RXB) + * @v2: Second vector register designated operand (for RXB) + * @v3: Third vector register designated operand (for RXB) + * @v4: Fourth vector register designated operand (for RXB) + */ +.macro MRXB m v1 v2=0 v3=0 v4=0 + rxb = 0 + RXB rxb, \v1, \v2, \v3, \v4 + .byte (\m << 4) | rxb +.endm + +/* MRXBOPC - Generate Element Size Control, RXB, and final Opcode fields + * + * @m: Element size control + * @opc: Opcode + * @v1: First vector register designated operand (for RXB) + * @v2: Second vector register designated operand (for RXB) + * @v3: Third vector register designated operand (for RXB) + * @v4: Fourth vector register designated operand (for RXB) + */ +.macro MRXBOPC m opc v1 v2=0 v3=0 v4=0 + MRXB \m, \v1, \v2, \v3, \v4 + .byte \opc +.endm + +/* Vector support instructions */ + +/* VECTOR GENERATE BYTE MASK */ +.macro VGBM vr imm2 + VX_NUM v1, \vr + .word (0xE700 | (VX_R(v1) << 4)) + .word \imm2 + MRXBOPC 0, 0x44, v1 +.endm +.macro VZERO vxr + VGBM \vxr, 0 +.endm +.macro VONE vxr + VGBM \vxr, 0xFFFF +.endm + +/* VECTOR LOAD VR ELEMENT FROM GR */ +.macro VLVG v, gr, disp, m + VX_NUM v1, \v + GR_NUM b2, "%r0" + GR_NUM r3, \gr + .word 0xE700 | (VX_R(v1) << 4) | r3 + .word (b2 << 12) | (\disp) + MRXBOPC \m, 0x22, v1 +.endm +.macro VLVGB v, gr, index, base + VLVG \v, \gr, \index, \base, 0 +.endm +.macro VLVGH v, gr, index + VLVG \v, \gr, \index, 1 +.endm +.macro VLVGF v, gr, index + VLVG \v, \gr, \index, 2 +.endm +.macro VLVGG v, gr, index + VLVG \v, \gr, \index, 3 +.endm + +/* VECTOR LOAD */ +.macro VL v, disp, index="%r0", base + VX_NUM v1, \v + GR_NUM x2, \index + GR_NUM b2, \base + .word 0xE700 | (VX_R(v1) << 4) | x2 + .word (b2 << 12) | (\disp) + MRXBOPC 0, 0x06, v1 +.endm + +/* VECTOR LOAD ELEMENT */ +.macro VLEx vr1, disp, index="%r0", base, m3, opc + VX_NUM v1, \vr1 + GR_NUM x2, \index + GR_NUM b2, \base + .word 0xE700 | (VX_R(v1) << 4) | x2 + .word (b2 << 12) | (\disp) + MRXBOPC \m3, \opc, v1 +.endm +.macro VLEB vr1, disp, index="%r0", base, m3 + VLEx \vr1, \disp, \index, \base, \m3, 0x00 +.endm +.macro VLEH vr1, disp, index="%r0", base, m3 + VLEx \vr1, \disp, \index, \base, \m3, 0x01 +.endm +.macro VLEF vr1, disp, index="%r0", base, m3 + VLEx \vr1, \disp, \index, \base, \m3, 0x03 +.endm +.macro VLEG vr1, disp, index="%r0", base, m3 + VLEx \vr1, \disp, \index, \base, \m3, 0x02 +.endm + +/* VECTOR LOAD ELEMENT IMMEDIATE */ +.macro VLEIx vr1, imm2, m3, opc + VX_NUM v1, \vr1 + .word 0xE700 | (VX_R(v1) << 4) + .word \imm2 + MRXBOPC \m3, \opc, v1 +.endm +.macro VLEIB vr1, imm2, index + VLEIx \vr1, \imm2, \index, 0x40 +.endm +.macro VLEIH vr1, imm2, index + VLEIx \vr1, \imm2, \index, 0x41 +.endm +.macro VLEIF vr1, imm2, index + VLEIx \vr1, \imm2, \index, 0x43 +.endm +.macro VLEIG vr1, imm2, index + VLEIx \vr1, \imm2, \index, 0x42 +.endm + +/* VECTOR LOAD GR FROM VR ELEMENT */ +.macro VLGV gr, vr, disp, base="%r0", m + GR_NUM r1, \gr + GR_NUM b2, \base + VX_NUM v3, \vr + .word 0xE700 | (r1 << 4) | VX_R(v3) + .word (b2 << 12) | (\disp) + MRXBOPC \m, 0x21, v3 +.endm +.macro VLGVB gr, vr, disp, base="%r0" + VLGV \gr, \vr, \disp, \base, 0 +.endm +.macro VLGVH gr, vr, disp, base="%r0" + VLGV \gr, \vr, \disp, \base, 1 +.endm +.macro VLGVF gr, vr, disp, base="%r0" + VLGV \gr, \vr, \disp, \base, 2 +.endm +.macro VLGVG gr, vr, disp, base="%r0" + VLGV \gr, \vr, \disp, \base, 3 +.endm + +/* VECTOR LOAD MULTIPLE */ +.macro VLM vfrom, vto, disp, base + VX_NUM v1, \vfrom + VX_NUM v3, \vto + GR_NUM b2, \base /* Base register */ + .word 0xE700 | (VX_R(v1) << 4) | VX_R(v3) + .word (b2 << 12) | (\disp) + MRXBOPC 0, 0x36, v1, v3 +.endm + +/* VECTOR STORE MULTIPLE */ +.macro VSTM vfrom, vto, disp, base + VX_NUM v1, \vfrom + VX_NUM v3, \vto + GR_NUM b2, \base /* Base register */ + .word 0xE700 | (VX_R(v1) << 4) | VX_R(v3) + .word (b2 << 12) | (\disp) + MRXBOPC 0, 0x3E, v1, v3 +.endm + +/* VECTOR PERMUTE */ +.macro VPERM vr1, vr2, vr3, vr4 + VX_NUM v1, \vr1 + VX_NUM v2, \vr2 + VX_NUM v3, \vr3 + VX_NUM v4, \vr4 + .word 0xE700 | (VX_R(v1) << 4) | VX_R(v2) + .word (VX_R(v3) << 12) + MRXBOPC VX_R(v4), 0x8C, v1, v2, v3, v4 +.endm + +/* VECTOR UNPACK LOGICAL LOW */ +.macro VUPLL vr1, vr2, m3 + VX_NUM v1, \vr1 + VX_NUM v2, \vr2 + .word 0xE700 | (VX_R(v1) << 4) | VX_R(v2) + .word 0x0000 + MRXBOPC \m3, 0xD4, v1, v2 +.endm +.macro VUPLLB vr1, vr2 + VUPLL \vr1, \vr2, 0 +.endm +.macro VUPLLH vr1, vr2 + VUPLL \vr1, \vr2, 1 +.endm +.macro VUPLLF vr1, vr2 + VUPLL \vr1, \vr2, 2 +.endm + +/* Vector integer instructions */ + +/* VECTOR EXCLUSIVE OR */ +.macro VX vr1, vr2, vr3 + VX_NUM v1, \vr1 + VX_NUM v2, \vr2 + VX_NUM v3, \vr3 + .word 0xE700 | (VX_R(v1) << 4) | VX_R(v2) + .word (VX_R(v3) << 12) + MRXBOPC 0, 0x6D, v1, v2, v3 +.endm + +/* VECTOR GALOIS FIELD MULTIPLY SUM */ +.macro VGFM vr1, vr2, vr3, m4 + VX_NUM v1, \vr1 + VX_NUM v2, \vr2 + VX_NUM v3, \vr3 + .word 0xE700 | (VX_R(v1) << 4) | VX_R(v2) + .word (VX_R(v3) << 12) + MRXBOPC \m4, 0xB4, v1, v2, v3 +.endm +.macro VGFMB vr1, vr2, vr3 + VGFM \vr1, \vr2, \vr3, 0 +.endm +.macro VGFMH vr1, vr2, vr3 + VGFM \vr1, \vr2, \vr3, 1 +.endm +.macro VGFMF vr1, vr2, vr3 + VGFM \vr1, \vr2, \vr3, 2 +.endm +.macro VGFMG vr1, vr2, vr3 + VGFM \vr1, \vr2, \vr3, 3 +.endm + +/* VECTOR GALOIS FIELD MULTIPLY SUM AND ACCUMULATE */ +.macro VGFMA vr1, vr2, vr3, vr4, m5 + VX_NUM v1, \vr1 + VX_NUM v2, \vr2 + VX_NUM v3, \vr3 + VX_NUM v4, \vr4 + .word 0xE700 | (VX_R(v1) << 4) | VX_R(v2) + .word (VX_R(v3) << 12) | (\m5 << 8) + MRXBOPC VX_R(v4), 0xBC, v1, v2, v3, v4 +.endm +.macro VGFMAB vr1, vr2, vr3, vr4 + VGFMA \vr1, \vr2, \vr3, \vr4, 0 +.endm +.macro VGFMAH vr1, vr2, vr3, vr4 + VGFMA \vr1, \vr2, \vr3, \vr4, 1 +.endm +.macro VGFMAF vr1, vr2, vr3, vr4 + VGFMA \vr1, \vr2, \vr3, \vr4, 2 +.endm +.macro VGFMAG vr1, vr2, vr3, vr4 + VGFMA \vr1, \vr2, \vr3, \vr4, 3 +.endm + +/* VECTOR SHIFT RIGHT LOGICAL BY BYTE */ +.macro VSRLB vr1, vr2, vr3 + VX_NUM v1, \vr1 + VX_NUM v2, \vr2 + VX_NUM v3, \vr3 + .word 0xE700 | (VX_R(v1) << 4) | VX_R(v2) + .word (VX_R(v3) << 12) + MRXBOPC 0, 0x7D, v1, v2, v3 +.endm + +#endif /* __ASM_S390_VX_INSN_H */ diff --git a/src/third_party/wiredtiger/src/config/config_def.c b/src/third_party/wiredtiger/src/config/config_def.c index 192b80bb359..1aff2b47cc5 100644 --- a/src/third_party/wiredtiger/src/config/config_def.c +++ b/src/third_party/wiredtiger/src/config/config_def.c @@ -145,8 +145,8 @@ static const WT_CONFIG_CHECK confchk_WT_CONNECTION_reconfigure[] = { "\"evict\",\"evictserver\",\"fileops\",\"handleops\",\"log\"," "\"lsm\",\"lsm_manager\",\"metadata\",\"mutex\",\"overflow\"," "\"read\",\"rebalance\",\"reconcile\",\"recovery\",\"salvage\"," - "\"shared_cache\",\"split\",\"temporary\",\"transaction\"," - "\"verify\",\"version\",\"write\"]", + "\"shared_cache\",\"split\",\"temporary\",\"thread_group\"," + "\"transaction\",\"verify\",\"version\",\"write\"]", NULL, 0 }, { NULL, NULL, NULL, NULL, NULL, 0 } }; @@ -706,8 +706,8 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open[] = { "\"evict\",\"evictserver\",\"fileops\",\"handleops\",\"log\"," "\"lsm\",\"lsm_manager\",\"metadata\",\"mutex\",\"overflow\"," "\"read\",\"rebalance\",\"reconcile\",\"recovery\",\"salvage\"," - "\"shared_cache\",\"split\",\"temporary\",\"transaction\"," - "\"verify\",\"version\",\"write\"]", + "\"shared_cache\",\"split\",\"temporary\",\"thread_group\"," + "\"transaction\",\"verify\",\"version\",\"write\"]", NULL, 0 }, { "write_through", "list", NULL, "choices=[\"data\",\"log\"]", @@ -787,8 +787,8 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_all[] = { "\"evict\",\"evictserver\",\"fileops\",\"handleops\",\"log\"," "\"lsm\",\"lsm_manager\",\"metadata\",\"mutex\",\"overflow\"," "\"read\",\"rebalance\",\"reconcile\",\"recovery\",\"salvage\"," - "\"shared_cache\",\"split\",\"temporary\",\"transaction\"," - "\"verify\",\"version\",\"write\"]", + "\"shared_cache\",\"split\",\"temporary\",\"thread_group\"," + "\"transaction\",\"verify\",\"version\",\"write\"]", NULL, 0 }, { "version", "string", NULL, NULL, NULL, 0 }, { "write_through", "list", @@ -863,8 +863,8 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_basecfg[] = { "\"evict\",\"evictserver\",\"fileops\",\"handleops\",\"log\"," "\"lsm\",\"lsm_manager\",\"metadata\",\"mutex\",\"overflow\"," "\"read\",\"rebalance\",\"reconcile\",\"recovery\",\"salvage\"," - "\"shared_cache\",\"split\",\"temporary\",\"transaction\"," - "\"verify\",\"version\",\"write\"]", + "\"shared_cache\",\"split\",\"temporary\",\"thread_group\"," + "\"transaction\",\"verify\",\"version\",\"write\"]", NULL, 0 }, { "version", "string", NULL, NULL, NULL, 0 }, { "write_through", "list", @@ -939,8 +939,8 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_usercfg[] = { "\"evict\",\"evictserver\",\"fileops\",\"handleops\",\"log\"," "\"lsm\",\"lsm_manager\",\"metadata\",\"mutex\",\"overflow\"," "\"read\",\"rebalance\",\"reconcile\",\"recovery\",\"salvage\"," - "\"shared_cache\",\"split\",\"temporary\",\"transaction\"," - "\"verify\",\"version\",\"write\"]", + "\"shared_cache\",\"split\",\"temporary\",\"thread_group\"," + "\"transaction\",\"verify\",\"version\",\"write\"]", NULL, 0 }, { "write_through", "list", NULL, "choices=[\"data\",\"log\"]", @@ -970,15 +970,15 @@ static const WT_CONFIG_ENTRY config_entries[] = { NULL, 0 }, { "WT_CONNECTION.async_new_op", - "append=0,overwrite=,raw=0,timeout=1200", + "append=false,overwrite=true,raw=false,timeout=1200", confchk_WT_CONNECTION_async_new_op, 4 }, { "WT_CONNECTION.close", - "leak_memory=0", + "leak_memory=false", confchk_WT_CONNECTION_close, 1 }, { "WT_CONNECTION.load_extension", - "config=,early_load=0,entry=wiredtiger_extension_init," + "config=,early_load=false,entry=wiredtiger_extension_init," "terminate=wiredtiger_extension_terminate", confchk_WT_CONNECTION_load_extension, 4 }, @@ -987,16 +987,17 @@ static const WT_CONFIG_ENTRY config_entries[] = { confchk_WT_CONNECTION_open_session, 1 }, { "WT_CONNECTION.reconfigure", - "async=(enabled=0,ops_max=1024,threads=2),cache_overhead=8," + "async=(enabled=false,ops_max=1024,threads=2),cache_overhead=8," "cache_size=100MB,checkpoint=(log_size=0,wait=0),error_prefix=," "eviction=(threads_max=1,threads_min=1),eviction_dirty_target=5," "eviction_dirty_trigger=20,eviction_target=80,eviction_trigger=95" ",file_manager=(close_handle_minimum=250,close_idle_time=30," - "close_scan_interval=10),log=(archive=,prealloc=,zero_fill=0)," - "lsm_manager=(merge=,worker_thread_max=4),lsm_merge=," - "shared_cache=(chunk=10MB,name=,quota=0,reserve=0,size=500MB)," - "statistics=none,statistics_log=(json=0,on_close=0,sources=," - "timestamp=\"%b %d %H:%M:%S\",wait=0),verbose=", + "close_scan_interval=10),log=(archive=true,prealloc=true," + "zero_fill=false),lsm_manager=(merge=true,worker_thread_max=4)," + "lsm_merge=true,shared_cache=(chunk=10MB,name=,quota=0,reserve=0," + "size=500MB),statistics=none,statistics_log=(json=false," + "on_close=false,sources=,timestamp=\"%b %d %H:%M:%S\",wait=0)," + "verbose=", confchk_WT_CONNECTION_reconfigure, 18 }, { "WT_CONNECTION.set_file_system", @@ -1008,7 +1009,7 @@ static const WT_CONFIG_ENTRY config_entries[] = { NULL, 0 }, { "WT_CURSOR.reconfigure", - "append=0,overwrite=", + "append=false,overwrite=true", confchk_WT_CURSOR_reconfigure, 2 }, { "WT_SESSION.begin_transaction", @@ -1016,7 +1017,7 @@ static const WT_CONFIG_ENTRY config_entries[] = { confchk_WT_SESSION_begin_transaction, 5 }, { "WT_SESSION.checkpoint", - "drop=,force=0,name=,target=", + "drop=,force=false,name=,target=", confchk_WT_SESSION_checkpoint, 4 }, { "WT_SESSION.close", @@ -1033,24 +1034,25 @@ static const WT_CONFIG_ENTRY config_entries[] = { }, { "WT_SESSION.create", "allocation_size=4KB,app_metadata=,block_allocation=best," - "block_compressor=,cache_resident=0,checksum=uncompressed," + "block_compressor=,cache_resident=false,checksum=uncompressed," "colgroups=,collator=,columns=,dictionary=0,encryption=(keyid=," - "name=),exclusive=0,extractor=,format=btree,huffman_key=," - "huffman_value=,immutable=0,internal_item_max=0," - "internal_key_max=0,internal_key_truncate=,internal_page_max=4KB," - "key_format=u,key_gap=10,leaf_item_max=0,leaf_key_max=0," - "leaf_page_max=32KB,leaf_value_max=0,log=(enabled=)," - "lsm=(auto_throttle=,bloom=,bloom_bit_count=16,bloom_config=," - "bloom_hash_count=8,bloom_oldest=0,chunk_count_limit=0," - "chunk_max=5GB,chunk_size=10MB,merge_max=15,merge_min=0)," - "memory_page_max=5MB,os_cache_dirty_max=0,os_cache_max=0," - "prefix_compression=0,prefix_compression_min=4,source=," - "split_deepen_min_child=0,split_deepen_per_child=0,split_pct=75," - "type=file,value_format=u", + "name=),exclusive=false,extractor=,format=btree,huffman_key=," + "huffman_value=,immutable=false,internal_item_max=0," + "internal_key_max=0,internal_key_truncate=true," + "internal_page_max=4KB,key_format=u,key_gap=10,leaf_item_max=0," + "leaf_key_max=0,leaf_page_max=32KB,leaf_value_max=0," + "log=(enabled=true),lsm=(auto_throttle=true,bloom=true," + "bloom_bit_count=16,bloom_config=,bloom_hash_count=8," + "bloom_oldest=false,chunk_count_limit=0,chunk_max=5GB," + "chunk_size=10MB,merge_max=15,merge_min=0),memory_page_max=5MB," + "os_cache_dirty_max=0,os_cache_max=0,prefix_compression=false," + "prefix_compression_min=4,source=,split_deepen_min_child=0," + "split_deepen_per_child=0,split_pct=75,type=file,value_format=u", confchk_WT_SESSION_create, 40 }, { "WT_SESSION.drop", - "checkpoint_wait=,force=0,lock_wait=,remove_files=", + "checkpoint_wait=true,force=false,lock_wait=true," + "remove_files=true", confchk_WT_SESSION_drop, 4 }, { "WT_SESSION.join", @@ -1067,9 +1069,10 @@ static const WT_CONFIG_ENTRY config_entries[] = { NULL, 0 }, { "WT_SESSION.open_cursor", - "append=0,bulk=0,checkpoint=,checkpoint_wait=,dump=,next_random=0" - ",next_random_sample_size=0,overwrite=,raw=0,readonly=0," - "skip_sort_check=0,statistics=,target=", + "append=false,bulk=false,checkpoint=,checkpoint_wait=true,dump=," + "next_random=false,next_random_sample_size=0,overwrite=true," + "raw=false,readonly=false,skip_sort_check=false,statistics=," + "target=", confchk_WT_SESSION_open_cursor, 13 }, { "WT_SESSION.rebalance", @@ -1093,11 +1096,11 @@ static const WT_CONFIG_ENTRY config_entries[] = { NULL, 0 }, { "WT_SESSION.salvage", - "force=0", + "force=false", confchk_WT_SESSION_salvage, 1 }, { "WT_SESSION.snapshot", - "drop=(all=0,before=,names=,to=),name=", + "drop=(all=false,before=,names=,to=),name=", confchk_WT_SESSION_snapshot, 2 }, { "WT_SESSION.strerror", @@ -1117,8 +1120,8 @@ static const WT_CONFIG_ENTRY config_entries[] = { NULL, 0 }, { "WT_SESSION.verify", - "dump_address=0,dump_blocks=0,dump_layout=0,dump_offsets=," - "dump_pages=0,strict=0", + "dump_address=false,dump_blocks=false,dump_layout=false," + "dump_offsets=,dump_pages=false,strict=false", confchk_WT_SESSION_verify, 6 }, { "colgroup.meta", @@ -1127,53 +1130,54 @@ static const WT_CONFIG_ENTRY config_entries[] = { }, { "file.config", "allocation_size=4KB,app_metadata=,block_allocation=best," - "block_compressor=,cache_resident=0,checksum=uncompressed," + "block_compressor=,cache_resident=false,checksum=uncompressed," "collator=,columns=,dictionary=0,encryption=(keyid=,name=)," "format=btree,huffman_key=,huffman_value=,internal_item_max=0," - "internal_key_max=0,internal_key_truncate=,internal_page_max=4KB," - "key_format=u,key_gap=10,leaf_item_max=0,leaf_key_max=0," - "leaf_page_max=32KB,leaf_value_max=0,log=(enabled=)," - "memory_page_max=5MB,os_cache_dirty_max=0,os_cache_max=0," - "prefix_compression=0,prefix_compression_min=4," - "split_deepen_min_child=0,split_deepen_per_child=0,split_pct=75," + "internal_key_max=0,internal_key_truncate=true," + "internal_page_max=4KB,key_format=u,key_gap=10,leaf_item_max=0," + "leaf_key_max=0,leaf_page_max=32KB,leaf_value_max=0," + "log=(enabled=true),memory_page_max=5MB,os_cache_dirty_max=0," + "os_cache_max=0,prefix_compression=false,prefix_compression_min=4" + ",split_deepen_min_child=0,split_deepen_per_child=0,split_pct=75," "value_format=u", confchk_file_config, 33 }, { "file.meta", "allocation_size=4KB,app_metadata=,block_allocation=best," - "block_compressor=,cache_resident=0,checkpoint=,checkpoint_lsn=," - "checksum=uncompressed,collator=,columns=,dictionary=0," - "encryption=(keyid=,name=),format=btree,huffman_key=," - "huffman_value=,id=,internal_item_max=0,internal_key_max=0," - "internal_key_truncate=,internal_page_max=4KB,key_format=u," + "block_compressor=,cache_resident=false,checkpoint=," + "checkpoint_lsn=,checksum=uncompressed,collator=,columns=," + "dictionary=0,encryption=(keyid=,name=),format=btree,huffman_key=" + ",huffman_value=,id=,internal_item_max=0,internal_key_max=0," + "internal_key_truncate=true,internal_page_max=4KB,key_format=u," "key_gap=10,leaf_item_max=0,leaf_key_max=0,leaf_page_max=32KB," - "leaf_value_max=0,log=(enabled=),memory_page_max=5MB," - "os_cache_dirty_max=0,os_cache_max=0,prefix_compression=0," + "leaf_value_max=0,log=(enabled=true),memory_page_max=5MB," + "os_cache_dirty_max=0,os_cache_max=0,prefix_compression=false," "prefix_compression_min=4,split_deepen_min_child=0," "split_deepen_per_child=0,split_pct=75,value_format=u," "version=(major=0,minor=0)", confchk_file_meta, 37 }, { "index.meta", - "app_metadata=,collator=,columns=,extractor=,immutable=0," + "app_metadata=,collator=,columns=,extractor=,immutable=false," "index_key_columns=,key_format=u,source=,type=file,value_format=u", confchk_index_meta, 10 }, { "lsm.meta", "allocation_size=4KB,app_metadata=,block_allocation=best," - "block_compressor=,cache_resident=0,checksum=uncompressed,chunks=" - ",collator=,columns=,dictionary=0,encryption=(keyid=,name=)," - "format=btree,huffman_key=,huffman_value=,internal_item_max=0," - "internal_key_max=0,internal_key_truncate=,internal_page_max=4KB," - "key_format=u,key_gap=10,last=,leaf_item_max=0,leaf_key_max=0," - "leaf_page_max=32KB,leaf_value_max=0,log=(enabled=)," - "lsm=(auto_throttle=,bloom=,bloom_bit_count=16,bloom_config=," - "bloom_hash_count=8,bloom_oldest=0,chunk_count_limit=0," - "chunk_max=5GB,chunk_size=10MB,merge_max=15,merge_min=0)," - "memory_page_max=5MB,old_chunks=,os_cache_dirty_max=0," - "os_cache_max=0,prefix_compression=0,prefix_compression_min=4," - "split_deepen_min_child=0,split_deepen_per_child=0,split_pct=75," - "value_format=u", + "block_compressor=,cache_resident=false,checksum=uncompressed," + "chunks=,collator=,columns=,dictionary=0,encryption=(keyid=," + "name=),format=btree,huffman_key=,huffman_value=," + "internal_item_max=0,internal_key_max=0," + "internal_key_truncate=true,internal_page_max=4KB,key_format=u," + "key_gap=10,last=,leaf_item_max=0,leaf_key_max=0," + "leaf_page_max=32KB,leaf_value_max=0,log=(enabled=true)," + "lsm=(auto_throttle=true,bloom=true,bloom_bit_count=16," + "bloom_config=,bloom_hash_count=8,bloom_oldest=false," + "chunk_count_limit=0,chunk_max=5GB,chunk_size=10MB,merge_max=15," + "merge_min=0),memory_page_max=5MB,old_chunks=," + "os_cache_dirty_max=0,os_cache_max=0,prefix_compression=false," + "prefix_compression_min=4,split_deepen_min_child=0," + "split_deepen_per_child=0,split_pct=75,value_format=u", confchk_lsm_meta, 37 }, { "table.meta", @@ -1182,82 +1186,86 @@ static const WT_CONFIG_ENTRY config_entries[] = { confchk_table_meta, 6 }, { "wiredtiger_open", - "async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1," - "cache_overhead=8,cache_size=100MB,checkpoint=(log_size=0,wait=0)" - ",checkpoint_sync=,config_base=,create=0,direct_io=," - "encryption=(keyid=,name=,secretkey=),error_prefix=," + "async=(enabled=false,ops_max=1024,threads=2),buffer_alignment=-1" + ",cache_overhead=8,cache_size=100MB,checkpoint=(log_size=0," + "wait=0),checkpoint_sync=true,config_base=true,create=false," + "direct_io=,encryption=(keyid=,name=,secretkey=),error_prefix=," "eviction=(threads_max=1,threads_min=1),eviction_dirty_target=5," "eviction_dirty_trigger=20,eviction_target=80,eviction_trigger=95" - ",exclusive=0,extensions=,file_extend=," + ",exclusive=false,extensions=,file_extend=," "file_manager=(close_handle_minimum=250,close_idle_time=30," - "close_scan_interval=10),hazard_max=1000,in_memory=0," - "log=(archive=,compressor=,enabled=0,file_max=100MB,path=\".\"," - "prealloc=,recover=on,zero_fill=0),lsm_manager=(merge=," - "worker_thread_max=4),lsm_merge=,mmap=,multiprocess=0,readonly=0," - "session_max=100,session_scratch_max=2MB,shared_cache=(chunk=10MB" - ",name=,quota=0,reserve=0,size=500MB),statistics=none," - "statistics_log=(json=0,on_close=0,path=\".\",sources=," - "timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0" - ",method=fsync),use_environment=,use_environment_priv=0,verbose=," + "close_scan_interval=10),hazard_max=1000,in_memory=false," + "log=(archive=true,compressor=,enabled=false,file_max=100MB," + "path=\".\",prealloc=true,recover=on,zero_fill=false)," + "lsm_manager=(merge=true,worker_thread_max=4),lsm_merge=true," + "mmap=true,multiprocess=false,readonly=false,session_max=100," + "session_scratch_max=2MB,shared_cache=(chunk=10MB,name=,quota=0," + "reserve=0,size=500MB),statistics=none,statistics_log=(json=false" + ",on_close=false,path=\".\",sources=,timestamp=\"%b %d %H:%M:%S\"" + ",wait=0),transaction_sync=(enabled=false,method=fsync)," + "use_environment=true,use_environment_priv=false,verbose=," "write_through=", confchk_wiredtiger_open, 38 }, { "wiredtiger_open_all", - "async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1," - "cache_overhead=8,cache_size=100MB,checkpoint=(log_size=0,wait=0)" - ",checkpoint_sync=,config_base=,create=0,direct_io=," - "encryption=(keyid=,name=,secretkey=),error_prefix=," + "async=(enabled=false,ops_max=1024,threads=2),buffer_alignment=-1" + ",cache_overhead=8,cache_size=100MB,checkpoint=(log_size=0," + "wait=0),checkpoint_sync=true,config_base=true,create=false," + "direct_io=,encryption=(keyid=,name=,secretkey=),error_prefix=," "eviction=(threads_max=1,threads_min=1),eviction_dirty_target=5," "eviction_dirty_trigger=20,eviction_target=80,eviction_trigger=95" - ",exclusive=0,extensions=,file_extend=," + ",exclusive=false,extensions=,file_extend=," "file_manager=(close_handle_minimum=250,close_idle_time=30," - "close_scan_interval=10),hazard_max=1000,in_memory=0," - "log=(archive=,compressor=,enabled=0,file_max=100MB,path=\".\"," - "prealloc=,recover=on,zero_fill=0),lsm_manager=(merge=," - "worker_thread_max=4),lsm_merge=,mmap=,multiprocess=0,readonly=0," - "session_max=100,session_scratch_max=2MB,shared_cache=(chunk=10MB" - ",name=,quota=0,reserve=0,size=500MB),statistics=none," - "statistics_log=(json=0,on_close=0,path=\".\",sources=," - "timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0" - ",method=fsync),use_environment=,use_environment_priv=0,verbose=," + "close_scan_interval=10),hazard_max=1000,in_memory=false," + "log=(archive=true,compressor=,enabled=false,file_max=100MB," + "path=\".\",prealloc=true,recover=on,zero_fill=false)," + "lsm_manager=(merge=true,worker_thread_max=4),lsm_merge=true," + "mmap=true,multiprocess=false,readonly=false,session_max=100," + "session_scratch_max=2MB,shared_cache=(chunk=10MB,name=,quota=0," + "reserve=0,size=500MB),statistics=none,statistics_log=(json=false" + ",on_close=false,path=\".\",sources=,timestamp=\"%b %d %H:%M:%S\"" + ",wait=0),transaction_sync=(enabled=false,method=fsync)," + "use_environment=true,use_environment_priv=false,verbose=," "version=(major=0,minor=0),write_through=", confchk_wiredtiger_open_all, 39 }, { "wiredtiger_open_basecfg", - "async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1," - "cache_overhead=8,cache_size=100MB,checkpoint=(log_size=0,wait=0)" - ",checkpoint_sync=,direct_io=,encryption=(keyid=,name=," - "secretkey=),error_prefix=,eviction=(threads_max=1,threads_min=1)" - ",eviction_dirty_target=5,eviction_dirty_trigger=20," - "eviction_target=80,eviction_trigger=95,extensions=,file_extend=," - "file_manager=(close_handle_minimum=250,close_idle_time=30," - "close_scan_interval=10),hazard_max=1000,log=(archive=," - "compressor=,enabled=0,file_max=100MB,path=\".\",prealloc=," - "recover=on,zero_fill=0),lsm_manager=(merge=,worker_thread_max=4)" - ",lsm_merge=,mmap=,multiprocess=0,readonly=0,session_max=100," + "async=(enabled=false,ops_max=1024,threads=2),buffer_alignment=-1" + ",cache_overhead=8,cache_size=100MB,checkpoint=(log_size=0," + "wait=0),checkpoint_sync=true,direct_io=,encryption=(keyid=,name=" + ",secretkey=),error_prefix=,eviction=(threads_max=1," + "threads_min=1),eviction_dirty_target=5,eviction_dirty_trigger=20" + ",eviction_target=80,eviction_trigger=95,extensions=,file_extend=" + ",file_manager=(close_handle_minimum=250,close_idle_time=30," + "close_scan_interval=10),hazard_max=1000,log=(archive=true," + "compressor=,enabled=false,file_max=100MB,path=\".\"," + "prealloc=true,recover=on,zero_fill=false)," + "lsm_manager=(merge=true,worker_thread_max=4),lsm_merge=true," + "mmap=true,multiprocess=false,readonly=false,session_max=100," "session_scratch_max=2MB,shared_cache=(chunk=10MB,name=,quota=0," - "reserve=0,size=500MB),statistics=none,statistics_log=(json=0," - "on_close=0,path=\".\",sources=,timestamp=\"%b %d %H:%M:%S\"," - "wait=0),transaction_sync=(enabled=0,method=fsync),verbose=," + "reserve=0,size=500MB),statistics=none,statistics_log=(json=false" + ",on_close=false,path=\".\",sources=,timestamp=\"%b %d %H:%M:%S\"" + ",wait=0),transaction_sync=(enabled=false,method=fsync),verbose=," "version=(major=0,minor=0),write_through=", confchk_wiredtiger_open_basecfg, 33 }, { "wiredtiger_open_usercfg", - "async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1," - "cache_overhead=8,cache_size=100MB,checkpoint=(log_size=0,wait=0)" - ",checkpoint_sync=,direct_io=,encryption=(keyid=,name=," - "secretkey=),error_prefix=,eviction=(threads_max=1,threads_min=1)" - ",eviction_dirty_target=5,eviction_dirty_trigger=20," - "eviction_target=80,eviction_trigger=95,extensions=,file_extend=," - "file_manager=(close_handle_minimum=250,close_idle_time=30," - "close_scan_interval=10),hazard_max=1000,log=(archive=," - "compressor=,enabled=0,file_max=100MB,path=\".\",prealloc=," - "recover=on,zero_fill=0),lsm_manager=(merge=,worker_thread_max=4)" - ",lsm_merge=,mmap=,multiprocess=0,readonly=0,session_max=100," + "async=(enabled=false,ops_max=1024,threads=2),buffer_alignment=-1" + ",cache_overhead=8,cache_size=100MB,checkpoint=(log_size=0," + "wait=0),checkpoint_sync=true,direct_io=,encryption=(keyid=,name=" + ",secretkey=),error_prefix=,eviction=(threads_max=1," + "threads_min=1),eviction_dirty_target=5,eviction_dirty_trigger=20" + ",eviction_target=80,eviction_trigger=95,extensions=,file_extend=" + ",file_manager=(close_handle_minimum=250,close_idle_time=30," + "close_scan_interval=10),hazard_max=1000,log=(archive=true," + "compressor=,enabled=false,file_max=100MB,path=\".\"," + "prealloc=true,recover=on,zero_fill=false)," + "lsm_manager=(merge=true,worker_thread_max=4),lsm_merge=true," + "mmap=true,multiprocess=false,readonly=false,session_max=100," "session_scratch_max=2MB,shared_cache=(chunk=10MB,name=,quota=0," - "reserve=0,size=500MB),statistics=none,statistics_log=(json=0," - "on_close=0,path=\".\",sources=,timestamp=\"%b %d %H:%M:%S\"," - "wait=0),transaction_sync=(enabled=0,method=fsync),verbose=," + "reserve=0,size=500MB),statistics=none,statistics_log=(json=false" + ",on_close=false,path=\".\",sources=,timestamp=\"%b %d %H:%M:%S\"" + ",wait=0),transaction_sync=(enabled=false,method=fsync),verbose=," "write_through=", confchk_wiredtiger_open_usercfg, 32 }, diff --git a/src/third_party/wiredtiger/src/conn/conn_api.c b/src/third_party/wiredtiger/src/conn/conn_api.c index 1c6b0c2b500..ab7657c3a89 100644 --- a/src/third_party/wiredtiger/src/conn/conn_api.c +++ b/src/third_party/wiredtiger/src/conn/conn_api.c @@ -1727,6 +1727,7 @@ __wt_verbose_config(WT_SESSION_IMPL *session, const char *cfg[]) { "shared_cache", WT_VERB_SHARED_CACHE }, { "split", WT_VERB_SPLIT }, { "temporary", WT_VERB_TEMPORARY }, + { "thread_group", WT_VERB_THREAD_GROUP }, { "transaction", WT_VERB_TRANSACTION }, { "verify", WT_VERB_VERIFY }, { "version", WT_VERB_VERSION }, @@ -2270,8 +2271,7 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, conn->page_size = __wt_get_vm_pagesize(); /* Now that we know if verbose is configured, output the version. */ - WT_ERR(__wt_verbose( - session, WT_VERB_VERSION, "%s", WIREDTIGER_VERSION_STRING)); + __wt_verbose(session, WT_VERB_VERSION, "%s", WIREDTIGER_VERSION_STRING); /* * Open the connection, then reset the local session as the real one diff --git a/src/third_party/wiredtiger/src/conn/conn_cache.c b/src/third_party/wiredtiger/src/conn/conn_cache.c index e8bb7187418..ba1e0210334 100644 --- a/src/third_party/wiredtiger/src/conn/conn_cache.c +++ b/src/third_party/wiredtiger/src/conn/conn_cache.c @@ -18,7 +18,7 @@ __cache_config_local(WT_SESSION_IMPL *session, bool shared, const char *cfg[]) WT_CACHE *cache; WT_CONFIG_ITEM cval; WT_CONNECTION_IMPL *conn; - uint32_t evict_workers_max, evict_workers_min; + uint32_t evict_threads_max, evict_threads_min; conn = S2C(session); cache = conn->cache; @@ -48,25 +48,20 @@ __cache_config_local(WT_SESSION_IMPL *session, bool shared, const char *cfg[]) WT_RET(__wt_config_gets(session, cfg, "eviction_dirty_trigger", &cval)); cache->eviction_dirty_trigger = (u_int)cval.val; - /* - * The eviction thread configuration options include the main eviction - * thread and workers. Our implementation splits them out. Adjust for - * the difference when parsing the configuration. - */ WT_RET(__wt_config_gets(session, cfg, "eviction.threads_max", &cval)); WT_ASSERT(session, cval.val > 0); - evict_workers_max = (uint32_t)cval.val - 1; + evict_threads_max = (uint32_t)cval.val; WT_RET(__wt_config_gets(session, cfg, "eviction.threads_min", &cval)); WT_ASSERT(session, cval.val > 0); - evict_workers_min = (uint32_t)cval.val - 1; + evict_threads_min = (uint32_t)cval.val; - if (evict_workers_min > evict_workers_max) + if (evict_threads_min > evict_threads_max) WT_RET_MSG(session, EINVAL, "eviction=(threads_min) cannot be greater than " "eviction=(threads_max)"); - conn->evict_workers_max = evict_workers_max; - conn->evict_workers_min = evict_workers_min; + conn->evict_threads_max = evict_threads_max; + conn->evict_threads_min = evict_threads_min; return (0); } @@ -114,6 +109,16 @@ __wt_cache_config(WT_SESSION_IMPL *session, bool reconfigure, const char *cfg[]) WT_RET(__wt_conn_cache_pool_open(session)); } + /* + * Resize the thread group if reconfiguring, otherwise the thread group + * will be initialized as part of creating the cache. + */ + if (reconfigure) + WT_RET(__wt_thread_group_resize( + session, &conn->evict_threads, + conn->evict_threads_min, conn->evict_threads_max, + WT_THREAD_CAN_WAIT | WT_THREAD_PANIC_FAIL)); + return (0); } @@ -156,8 +161,6 @@ __wt_cache_create(WT_SESSION_IMPL *session, const char *cfg[]) WT_ERR(__wt_cond_auto_alloc(session, "cache eviction server", false, 10000, WT_MILLION, &cache->evict_cond)); - WT_ERR(__wt_cond_alloc(session, - "eviction waiters", false, &cache->evict_waiter_cond)); WT_ERR(__wt_spin_init(session, &cache->evict_pass_lock, "evict pass")); WT_ERR(__wt_spin_init(session, &cache->evict_queue_lock, "cache eviction queue")); @@ -176,9 +179,11 @@ __wt_cache_create(WT_SESSION_IMPL *session, const char *cfg[]) &cache->evict_queues[i].evict_lock, "cache eviction")); } - /* Ensure there is always a non-NULL current queue. */ - cache->evict_current_queue = - &cache->evict_queues[WT_EVICT_URGENT_QUEUE + 1]; + /* Ensure there are always non-NULL queues. */ + cache->evict_current_queue = cache->evict_fill_queue = + &cache->evict_queues[0]; + cache->evict_other_queue = &cache->evict_queues[1]; + cache->evict_urgent_queue = &cache->evict_queues[WT_EVICT_URGENT_QUEUE]; /* * We get/set some values in the cache statistics (rather than have @@ -240,7 +245,7 @@ __wt_cache_stats_update(WT_SESSION_IMPL *session) * The number of files with active walks ~= number of hazard pointers * in the walk session. Note: reading without locking. */ - if (conn->evict_session != NULL) + if (conn->evict_server_running) WT_STAT_SET(session, stats, cache_eviction_walks_active, cache->walk_session->nhazard); } @@ -283,7 +288,6 @@ __wt_cache_destroy(WT_SESSION_IMPL *session) cache->pages_dirty_intl + cache->pages_dirty_leaf); WT_TRET(__wt_cond_auto_destroy(session, &cache->evict_cond)); - WT_TRET(__wt_cond_destroy(session, &cache->evict_waiter_cond)); __wt_spin_destroy(session, &cache->evict_pass_lock); __wt_spin_destroy(session, &cache->evict_queue_lock); __wt_spin_destroy(session, &cache->evict_walk_lock); diff --git a/src/third_party/wiredtiger/src/conn/conn_cache_pool.c b/src/third_party/wiredtiger/src/conn/conn_cache_pool.c index 75ecb6b3b4a..15517f37b6a 100644 --- a/src/third_party/wiredtiger/src/conn/conn_cache_pool.c +++ b/src/third_party/wiredtiger/src/conn/conn_cache_pool.c @@ -108,8 +108,8 @@ __wt_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg) "cache pool server", false, &cp->cache_pool_cond)); __wt_process.cache_pool = cp; - WT_ERR(__wt_verbose(session, - WT_VERB_SHARED_CACHE, "Created cache pool %s", cp->name)); + __wt_verbose(session, + WT_VERB_SHARED_CACHE, "Created cache pool %s", cp->name); } else if (!updating && strcmp(__wt_process.cache_pool->name, pool_name) != 0) /* Only a single cache pool is supported. */ @@ -212,12 +212,12 @@ __wt_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg) /* Wake up the cache pool server so any changes are noticed. */ if (updating) - WT_ERR(__wt_cond_signal( - session, __wt_process.cache_pool->cache_pool_cond)); + __wt_cond_signal( + session, __wt_process.cache_pool->cache_pool_cond); - WT_ERR(__wt_verbose(session, WT_VERB_SHARED_CACHE, + __wt_verbose(session, WT_VERB_SHARED_CACHE, "Configured cache pool %s. Size: %" PRIu64 - ", chunk size: %" PRIu64, cp->name, cp->size, cp->chunk)); + ", chunk size: %" PRIu64, cp->name, cp->size, cp->chunk); F_SET(conn, WT_CONN_CACHE_POOL); err: __wt_spin_unlock(session, &__wt_process.spinlock); @@ -267,8 +267,8 @@ __wt_conn_cache_pool_open(WT_SESSION_IMPL *session) TAILQ_INSERT_TAIL(&cp->cache_pool_qh, conn, cpq); __wt_spin_unlock(session, &cp->cache_pool_lock); - WT_RET(__wt_verbose(session, WT_VERB_SHARED_CACHE, - "Added %s to cache pool %s", conn->home, cp->name)); + __wt_verbose(session, WT_VERB_SHARED_CACHE, + "Added %s to cache pool %s", conn->home, cp->name); /* * Each connection participating in the cache pool starts a manager @@ -282,7 +282,7 @@ __wt_conn_cache_pool_open(WT_SESSION_IMPL *session) __wt_cache_pool_server, cache->cp_session)); /* Wake up the cache pool server to get our initial chunk. */ - WT_RET(__wt_cond_signal(session, cp->cache_pool_cond)); + __wt_cond_signal(session, cp->cache_pool_cond); return (0); } @@ -324,8 +324,8 @@ __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session) * queue. We did increment the reference count, so proceed regardless. */ if (found) { - WT_TRET(__wt_verbose(session, WT_VERB_SHARED_CACHE, - "Removing %s from cache pool", entry->home)); + __wt_verbose(session, WT_VERB_SHARED_CACHE, + "Removing %s from cache pool", entry->home); TAILQ_REMOVE(&cp->cache_pool_qh, entry, cpq); /* Give the connection's resources back to the pool. */ @@ -341,7 +341,7 @@ __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session) cp_locked = false; F_CLR(cache, WT_CACHE_POOL_RUN); - WT_TRET(__wt_cond_signal(session, cp->cache_pool_cond)); + __wt_cond_signal(session, cp->cache_pool_cond); WT_TRET(__wt_thread_join(session, cache->cp_tid)); wt_session = &cache->cp_session->iface; @@ -372,8 +372,8 @@ __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session) } if (!F_ISSET(cp, WT_CACHE_POOL_ACTIVE)) { - WT_TRET(__wt_verbose( - session, WT_VERB_SHARED_CACHE, "Destroying cache pool")); + __wt_verbose( + session, WT_VERB_SHARED_CACHE, "Destroying cache pool"); __wt_spin_lock(session, &__wt_process.spinlock); /* * We have been holding the pool lock - no connections could @@ -401,8 +401,8 @@ __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session) /* Notify other participants if we were managing */ if (F_ISSET(cache, WT_CACHE_POOL_MANAGER)) { cp->pool_managed = 0; - WT_TRET(__wt_verbose(session, WT_VERB_SHARED_CACHE, - "Shutting down shared cache manager connection")); + __wt_verbose(session, WT_VERB_SHARED_CACHE, + "Shutting down shared cache manager connection"); } } @@ -538,14 +538,14 @@ __cache_pool_assess(WT_SESSION_IMPL *session, uint64_t *phighest) if (cache->cp_pass_pressure > highest) highest = cache->cp_pass_pressure; - WT_RET(__wt_verbose(session, WT_VERB_SHARED_CACHE, + __wt_verbose(session, WT_VERB_SHARED_CACHE, "Assess entry. reads: %" PRIu64 ", app evicts: %" PRIu64 ", app waits: %" PRIu64 ", pressure: %" PRIu64, - reads, app_evicts, app_waits, cache->cp_pass_pressure)); + reads, app_evicts, app_waits, cache->cp_pass_pressure); } - WT_RET(__wt_verbose(session, WT_VERB_SHARED_CACHE, + __wt_verbose(session, WT_VERB_SHARED_CACHE, "Highest eviction count: %" PRIu64 ", entries: %" PRIu64, - highest, entries)); + highest, entries); *phighest = highest; return (0); @@ -577,10 +577,10 @@ __cache_pool_adjust(WT_SESSION_IMPL *session, highest_percentile = (highest / 100) + 1; if (WT_VERBOSE_ISSET(session, WT_VERB_SHARED_CACHE)) { - WT_RET(__wt_verbose(session, - WT_VERB_SHARED_CACHE, "Cache pool distribution: ")); - WT_RET(__wt_verbose(session, WT_VERB_SHARED_CACHE, - "\t" "cache (MB), pressure, skips, busy, %% full:")); + __wt_verbose(session, + WT_VERB_SHARED_CACHE, "Cache pool distribution: "); + __wt_verbose(session, WT_VERB_SHARED_CACHE, + "\t" "cache (MB), pressure, skips, busy, %% full:"); } for (entry = forward ? TAILQ_FIRST(&cp->cache_pool_qh) : @@ -602,10 +602,10 @@ __cache_pool_adjust(WT_SESSION_IMPL *session, pressure = cache->cp_pass_pressure / highest_percentile; busy = __wt_eviction_needed(entry->default_session, &pct_full); - WT_RET(__wt_verbose(session, WT_VERB_SHARED_CACHE, + __wt_verbose(session, WT_VERB_SHARED_CACHE, "\t%5" PRIu64 ", %3" PRIu64 ", %2" PRIu32 ", %d, %2u", entry->cache_size >> 20, pressure, cache->cp_skip_count, - busy, pct_full)); + busy, pct_full); /* Allow to stabilize after changes. */ if (cache->cp_skip_count > 0 && --cache->cp_skip_count > 0) @@ -699,9 +699,9 @@ __cache_pool_adjust(WT_SESSION_IMPL *session, entry->cache_size -= adjustment; cp->currently_used -= adjustment; } - WT_RET(__wt_verbose(session, WT_VERB_SHARED_CACHE, + __wt_verbose(session, WT_VERB_SHARED_CACHE, "Allocated %s%" PRId64 " to %s", - grow ? "" : "-", adjustment, entry->home)); + grow ? "" : "-", adjustment, entry->home); /* * TODO: Add a loop waiting for connection to give up @@ -721,7 +721,6 @@ __wt_cache_pool_server(void *arg) { WT_CACHE *cache; WT_CACHE_POOL *cp; - WT_DECL_RET; WT_SESSION_IMPL *session; bool forward; @@ -734,8 +733,8 @@ __wt_cache_pool_server(void *arg) while (F_ISSET(cp, WT_CACHE_POOL_ACTIVE) && F_ISSET(cache, WT_CACHE_POOL_RUN)) { if (cp->currently_used <= cp->size) - WT_ERR(__wt_cond_wait(session, - cp->cache_pool_cond, WT_MILLION)); + __wt_cond_wait( + session, cp->cache_pool_cond, WT_MILLION); /* * Re-check pool run flag - since we want to avoid getting the @@ -748,8 +747,8 @@ __wt_cache_pool_server(void *arg) /* Try to become the managing thread */ if (__wt_atomic_cas8(&cp->pool_managed, 0, 1)) { F_SET(cache, WT_CACHE_POOL_MANAGER); - WT_ERR(__wt_verbose(session, WT_VERB_SHARED_CACHE, - "Cache pool switched manager thread")); + __wt_verbose(session, WT_VERB_SHARED_CACHE, + "Cache pool switched manager thread"); } /* @@ -762,8 +761,5 @@ __wt_cache_pool_server(void *arg) } } - if (0) { -err: WT_PANIC_MSG(session, ret, "cache pool manager server error"); - } return (WT_THREAD_RET_VALUE); } diff --git a/src/third_party/wiredtiger/src/conn/conn_ckpt.c b/src/third_party/wiredtiger/src/conn/conn_ckpt.c index d54c65c4767..5e9d8f70193 100644 --- a/src/third_party/wiredtiger/src/conn/conn_ckpt.c +++ b/src/third_party/wiredtiger/src/conn/conn_ckpt.c @@ -38,6 +38,15 @@ __ckpt_server_config(WT_SESSION_IMPL *session, const char **cfg, bool *startp) if (conn->ckpt_usecs != 0 || (conn->ckpt_logsize != 0 && FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED))) { + /* + * If checkpointing based on log data, use a minimum of the + * log file size. The logging subsystem has already been + * initialized. + */ + if (conn->ckpt_logsize != 0 && + FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED)) + conn->ckpt_logsize = WT_MAX( + conn->ckpt_logsize, conn->log_file_max); /* Checkpoints are incompatible with in-memory configuration */ WT_RET(__wt_config_gets(session, cfg, "in_memory", &cval)); if (cval.val != 0) @@ -76,8 +85,7 @@ __ckpt_server(void *arg) * NOTE: If the user only configured logsize, then usecs * will be 0 and this wait won't return until signalled. */ - WT_ERR( - __wt_cond_wait(session, conn->ckpt_cond, conn->ckpt_usecs)); + __wt_cond_wait(session, conn->ckpt_cond, conn->ckpt_usecs); /* Checkpoint the database. */ WT_ERR(wt_session->checkpoint(wt_session, NULL)); @@ -93,7 +101,7 @@ __ckpt_server(void *arg) * signalled, do a tiny wait to clear it so we don't do * another checkpoint immediately. */ - WT_ERR(__wt_cond_wait(session, conn->ckpt_cond, 1)); + __wt_cond_wait(session, conn->ckpt_cond, 1); } } @@ -191,7 +199,7 @@ __wt_checkpoint_server_destroy(WT_SESSION_IMPL *session) F_CLR(conn, WT_CONN_SERVER_CHECKPOINT); if (conn->ckpt_tid_set) { - WT_TRET(__wt_cond_signal(session, conn->ckpt_cond)); + __wt_cond_signal(session, conn->ckpt_cond); WT_TRET(__wt_thread_join(session, conn->ckpt_tid)); conn->ckpt_tid_set = false; } @@ -228,7 +236,7 @@ __wt_checkpoint_signal(WT_SESSION_IMPL *session, wt_off_t logsize) conn = S2C(session); WT_ASSERT(session, WT_CKPT_LOGSIZE(conn)); if (logsize >= conn->ckpt_logsize && !conn->ckpt_signalled) { - WT_RET(__wt_cond_signal(session, conn->ckpt_cond)); + __wt_cond_signal(session, conn->ckpt_cond); conn->ckpt_signalled = 1; } return (0); diff --git a/src/third_party/wiredtiger/src/conn/conn_dhandle.c b/src/third_party/wiredtiger/src/conn/conn_dhandle.c index f52fccc7d1c..9eb4d4a7746 100644 --- a/src/third_party/wiredtiger/src/conn/conn_dhandle.c +++ b/src/third_party/wiredtiger/src/conn/conn_dhandle.c @@ -12,19 +12,15 @@ * __conn_dhandle_destroy -- * Destroy a data handle. */ -static int +static void __conn_dhandle_destroy(WT_SESSION_IMPL *session, WT_DATA_HANDLE *dhandle) { - WT_DECL_RET; - - ret = __wt_rwlock_destroy(session, &dhandle->rwlock); + __wt_rwlock_destroy(session, &dhandle->rwlock); __wt_free(session, dhandle->name); __wt_free(session, dhandle->checkpoint); __wt_free(session, dhandle->handle); __wt_spin_destroy(session, &dhandle->close_lock); __wt_overwrite_and_free(session, dhandle); - - return (ret); } /* @@ -83,7 +79,7 @@ __conn_dhandle_alloc(WT_SESSION_IMPL *session, *dhandlep = dhandle; return (0); -err: WT_TRET(__conn_dhandle_destroy(session, dhandle)); +err: __conn_dhandle_destroy(session, dhandle); return (ret); } @@ -576,14 +572,14 @@ __wt_conn_dhandle_discard_single( set_pass_intr = false; if (!F_ISSET(session, WT_SESSION_LOCKED_HANDLE_LIST)) { set_pass_intr = true; - (void)__wt_atomic_add32(&S2C(session)->cache->pass_intr, 1); + (void)__wt_atomic_addv32(&S2C(session)->cache->pass_intr, 1); } /* Try to remove the handle, protected by the data handle lock. */ WT_WITH_HANDLE_LIST_LOCK(session, tret = __conn_dhandle_remove(session, final)); if (set_pass_intr) - (void)__wt_atomic_sub32(&S2C(session)->cache->pass_intr, 1); + (void)__wt_atomic_subv32(&S2C(session)->cache->pass_intr, 1); WT_TRET(tret); /* @@ -591,7 +587,7 @@ __wt_conn_dhandle_discard_single( */ if (ret == 0 || final) { __conn_btree_config_clear(session); - WT_TRET(__conn_dhandle_destroy(session, dhandle)); + __conn_dhandle_destroy(session, dhandle); session->dhandle = NULL; } diff --git a/src/third_party/wiredtiger/src/conn/conn_handle.c b/src/third_party/wiredtiger/src/conn/conn_handle.c index 509966793e5..5ff8b7f798b 100644 --- a/src/third_party/wiredtiger/src/conn/conn_handle.c +++ b/src/third_party/wiredtiger/src/conn/conn_handle.c @@ -138,7 +138,7 @@ __wt_connection_destroy(WT_CONNECTION_IMPL *conn) __wt_spin_destroy(session, &conn->dhandle_lock); __wt_spin_destroy(session, &conn->encryptor_lock); __wt_spin_destroy(session, &conn->fh_lock); - WT_TRET(__wt_rwlock_destroy(session, &conn->hot_backup_lock)); + __wt_rwlock_destroy(session, &conn->hot_backup_lock); __wt_spin_destroy(session, &conn->las_lock); __wt_spin_destroy(session, &conn->metadata_lock); __wt_spin_destroy(session, &conn->reconfig_lock); diff --git a/src/third_party/wiredtiger/src/conn/conn_log.c b/src/third_party/wiredtiger/src/conn/conn_log.c index 18ed71e4688..6c05376f9ce 100644 --- a/src/third_party/wiredtiger/src/conn/conn_log.c +++ b/src/third_party/wiredtiger/src/conn/conn_log.c @@ -173,7 +173,7 @@ __logmgr_config( WT_RET(__logmgr_sync_cfg(session, cfg)); if (conn->log_cond != NULL) - WT_RET(__wt_cond_auto_signal(session, conn->log_cond)); + __wt_cond_auto_signal(session, conn->log_cond); return (0); } @@ -222,8 +222,8 @@ __log_archive_once(WT_SESSION_IMPL *session, uint32_t backup_file) else min_lognum = WT_MIN( log->ckpt_lsn.l.file, log->sync_lsn.l.file); - WT_RET(__wt_verbose(session, WT_VERB_LOG, - "log_archive: archive to log number %" PRIu32, min_lognum)); + __wt_verbose(session, WT_VERB_LOG, + "log_archive: archive to log number %" PRIu32, min_lognum); /* * Main archive code. Get the list of all log files and @@ -236,7 +236,7 @@ __log_archive_once(WT_SESSION_IMPL *session, uint32_t backup_file) * We can only archive files if a hot backup is not in progress or * if we are the backup. */ - WT_ERR(__wt_readlock(session, conn->hot_backup_lock)); + __wt_readlock(session, conn->hot_backup_lock); locked = true; if (!conn->hot_backup || backup_file != 0) { for (i = 0; i < logcount; i++) { @@ -247,7 +247,7 @@ __log_archive_once(WT_SESSION_IMPL *session, uint32_t backup_file) session, WT_LOG_FILENAME, lognum)); } } - WT_ERR(__wt_readunlock(session, conn->hot_backup_lock)); + __wt_readunlock(session, conn->hot_backup_lock); locked = false; /* @@ -259,7 +259,7 @@ __log_archive_once(WT_SESSION_IMPL *session, uint32_t backup_file) if (0) err: __wt_err(session, ret, "log archive server error"); if (locked) - WT_TRET(__wt_readunlock(session, conn->hot_backup_lock)); + __wt_readunlock(session, conn->hot_backup_lock); WT_TRET(__wt_fs_directory_list_free(session, &logfiles, logcount)); return (ret); } @@ -295,9 +295,9 @@ __log_prealloc_once(WT_SESSION_IMPL *session) */ if (log->prep_missed > 0) { conn->log_prealloc += log->prep_missed; - WT_ERR(__wt_verbose(session, WT_VERB_LOG, + __wt_verbose(session, WT_VERB_LOG, "Missed %" PRIu32 ". Now pre-allocating up to %" PRIu32, - log->prep_missed, conn->log_prealloc)); + log->prep_missed, conn->log_prealloc); } WT_STAT_FAST_CONN_SET(session, log_prealloc_max, conn->log_prealloc); /* @@ -335,7 +335,6 @@ __wt_log_truncate_files( WT_DECL_RET; WT_LOG *log; uint32_t backup_file; - bool locked; WT_UNUSED(cfg); conn = S2C(session); @@ -352,18 +351,12 @@ __wt_log_truncate_files( if (cursor != NULL) backup_file = WT_CURSOR_BACKUP_ID(cursor); WT_ASSERT(session, backup_file <= log->alloc_lsn.l.file); - WT_RET(__wt_verbose(session, WT_VERB_LOG, - "log_truncate_files: Archive once up to %" PRIu32, - backup_file)); + __wt_verbose(session, WT_VERB_LOG, + "log_truncate_files: Archive once up to %" PRIu32, backup_file); - WT_RET(__wt_writelock(session, log->log_archive_lock)); - locked = true; - WT_ERR(__log_archive_once(session, backup_file)); - WT_ERR(__wt_writeunlock(session, log->log_archive_lock)); - locked = false; -err: - if (locked) - WT_RET(__wt_writeunlock(session, log->log_archive_lock)); + __wt_writelock(session, log->log_archive_lock); + ret = __log_archive_once(session, backup_file); + __wt_writeunlock(session, log->log_archive_lock); return (ret); } @@ -429,12 +422,14 @@ __log_file_server(void *arg) */ WT_ERR(__wt_fsync(session, close_fh, true)); /* - * We want to make sure the file size reflects - * actual data and has minimal pre-allocated - * zeroed space. + * We want to have the file size reflect actual + * data with minimal pre-allocated zeroed space. + * The underlying file system may not support + * truncate, which is OK, it's just more work + * during cursor traversal. */ - WT_ERR(__wt_ftruncate(session, - close_fh, close_end_lsn.l.offset)); + WT_ERR_ERROR_OK(__wt_ftruncate(session, + close_fh, close_end_lsn.l.offset), ENOTSUP); WT_SET_LSN(&close_end_lsn, close_end_lsn.l.file + 1, 0); __wt_spin_lock(session, &log->log_sync_lock); @@ -443,8 +438,7 @@ __log_file_server(void *arg) WT_ASSERT(session, __wt_log_cmp( &close_end_lsn, &log->sync_lsn) >= 0); log->sync_lsn = close_end_lsn; - WT_ERR(__wt_cond_signal( - session, log->log_sync_cond)); + __wt_cond_signal(session, log->log_sync_cond); locked = false; __wt_spin_unlock(session, &log->log_sync_lock); } @@ -492,14 +486,14 @@ __log_file_server(void *arg) min_lsn.l.file == log->sync_lsn.l.file); log->sync_lsn = min_lsn; - WT_ERR(__wt_cond_signal( - session, log->log_sync_cond)); + __wt_cond_signal( + session, log->log_sync_cond); } locked = false; __wt_spin_unlock(session, &log->log_sync_lock); } else { - WT_ERR(__wt_cond_auto_signal( - session, conn->log_wrlsn_cond)); + __wt_cond_auto_signal( + session, conn->log_wrlsn_cond); /* * We do not want to wait potentially a second * to process this. Yield to give the wrlsn @@ -511,8 +505,7 @@ __log_file_server(void *arg) } } /* Wait until the next event. */ - WT_ERR(__wt_cond_wait( - session, conn->log_file_cond, WT_MILLION / 10)); + __wt_cond_wait(session, conn->log_file_cond, WT_MILLION / 10); } if (0) { @@ -546,11 +539,10 @@ typedef struct { * are contiguous. The purpose of this function is to advance the * write_lsn in LSN order after the buffer is written to the log file. */ -int +void __wt_log_wrlsn(WT_SESSION_IMPL *session, int *yield) { WT_CONNECTION_IMPL *conn; - WT_DECL_RET; WT_LOG *log; WT_LOG_WRLSN_ENTRY written[WT_SLOT_POOL]; WT_LOGSLOT *coalescing, *slot; @@ -669,21 +661,19 @@ restart: (uint32_t)slot->slot_last_offset; log->write_start_lsn = slot->slot_start_lsn; log->write_lsn = slot->slot_end_lsn; - WT_ERR(__wt_cond_signal( - session, log->log_write_cond)); + __wt_cond_signal(session, log->log_write_cond); WT_STAT_FAST_CONN_INCR(session, log_write_lsn); /* * Signal the close thread if needed. */ if (F_ISSET(slot, WT_SLOT_CLOSEFH)) - WT_ERR(__wt_cond_signal( - session, conn->log_file_cond)); + __wt_cond_signal( + session, conn->log_file_cond); } __wt_log_slot_free(session, slot); } } -err: __wt_spin_unlock(session, &log->log_writelsn_lock); - return (ret); + __wt_spin_unlock(session, &log->log_writelsn_lock); } /* @@ -716,7 +706,7 @@ __log_wrlsn_server(void *arg) */ if (__wt_log_cmp(&prev, &log->alloc_lsn) != 0 || __wt_log_cmp(&log->write_lsn, &log->alloc_lsn) != 0) - WT_ERR(__wt_log_wrlsn(session, &yield)); + __wt_log_wrlsn(session, &yield); else WT_STAT_FAST_CONN_INCR(session, log_write_lsn_skip); prev = log->alloc_lsn; @@ -732,15 +722,15 @@ __log_wrlsn_server(void *arg) * Send in false because if we did any work we would * not be on this path. */ - WT_ERR(__wt_cond_auto_wait( - session, conn->log_wrlsn_cond, did_work)); + __wt_cond_auto_wait( + session, conn->log_wrlsn_cond, did_work); } /* * On close we need to do this one more time because there could * be straggling log writes that need to be written. */ WT_ERR(__wt_log_force_write(session, 1, NULL)); - WT_ERR(__wt_log_wrlsn(session, NULL)); + __wt_log_wrlsn(session, NULL); if (0) { err: __wt_err(session, ret, "log wrlsn server error"); } @@ -760,12 +750,12 @@ __log_server(void *arg) WT_LOG *log; WT_SESSION_IMPL *session; uint64_t timediff; - bool did_work, locked, signalled; + bool did_work, signalled; session = arg; conn = S2C(session); log = conn->log; - locked = signalled = false; + signalled = false; /* * Set this to the number of milliseconds we want to run archive and @@ -812,14 +802,11 @@ __log_server(void *arg) * agreed not to rename or remove any files in * the database directory. */ - WT_ERR(__wt_readlock( - session, conn->hot_backup_lock)); - locked = true; + __wt_readlock(session, conn->hot_backup_lock); if (!conn->hot_backup) - WT_ERR(__log_prealloc_once(session)); - WT_ERR(__wt_readunlock( - session, conn->hot_backup_lock)); - locked = false; + ret = __log_prealloc_once(session); + __wt_readunlock(session, conn->hot_backup_lock); + WT_ERR(ret); } /* @@ -829,31 +816,27 @@ __log_server(void *arg) if (__wt_try_writelock( session, log->log_archive_lock) == 0) { ret = __log_archive_once(session, 0); - WT_TRET(__wt_writeunlock( - session, log->log_archive_lock)); + __wt_writeunlock( + session, log->log_archive_lock); WT_ERR(ret); } else - WT_ERR( - __wt_verbose(session, WT_VERB_LOG, + __wt_verbose(session, WT_VERB_LOG, "log_archive: Blocked due to open " - "log cursor holding archive lock")); + "log cursor holding archive lock"); } } /* Wait until the next event. */ WT_ERR(__wt_epoch(session, &start)); - WT_ERR(__wt_cond_auto_wait_signal(session, conn->log_cond, - did_work, &signalled)); + __wt_cond_auto_wait_signal(session, + conn->log_cond, did_work, &signalled); WT_ERR(__wt_epoch(session, &now)); timediff = WT_TIMEDIFF_MS(now, start); } if (0) { err: __wt_err(session, ret, "log server error"); - if (locked) - WT_TRET(__wt_readunlock( - session, conn->hot_backup_lock)); } return (WT_THREAD_RET_VALUE); } @@ -974,7 +957,7 @@ __wt_logmgr_open(WT_SESSION_IMPL *session) if (conn->log_session != NULL) { WT_ASSERT(session, conn->log_cond != NULL); WT_ASSERT(session, conn->log_tid_set == true); - WT_RET(__wt_cond_auto_signal(session, conn->log_cond)); + __wt_cond_auto_signal(session, conn->log_cond); } else { /* The log server gets its own session. */ WT_RET(__wt_open_internal_session(conn, @@ -1016,12 +999,12 @@ __wt_logmgr_destroy(WT_SESSION_IMPL *session) return (0); } if (conn->log_tid_set) { - WT_TRET(__wt_cond_auto_signal(session, conn->log_cond)); + __wt_cond_auto_signal(session, conn->log_cond); WT_TRET(__wt_thread_join(session, conn->log_tid)); conn->log_tid_set = false; } if (conn->log_file_tid_set) { - WT_TRET(__wt_cond_signal(session, conn->log_file_cond)); + __wt_cond_signal(session, conn->log_file_cond); WT_TRET(__wt_thread_join(session, conn->log_file_tid)); conn->log_file_tid_set = false; } @@ -1031,7 +1014,7 @@ __wt_logmgr_destroy(WT_SESSION_IMPL *session) conn->log_file_session = NULL; } if (conn->log_wrlsn_tid_set) { - WT_TRET(__wt_cond_auto_signal(session, conn->log_wrlsn_cond)); + __wt_cond_auto_signal(session, conn->log_wrlsn_cond); WT_TRET(__wt_thread_join(session, conn->log_wrlsn_tid)); conn->log_wrlsn_tid_set = false; } @@ -1058,7 +1041,7 @@ __wt_logmgr_destroy(WT_SESSION_IMPL *session) WT_TRET(__wt_cond_destroy(session, &conn->log->log_sync_cond)); WT_TRET(__wt_cond_destroy(session, &conn->log->log_write_cond)); - WT_TRET(__wt_rwlock_destroy(session, &conn->log->log_archive_lock)); + __wt_rwlock_destroy(session, &conn->log->log_archive_lock); __wt_spin_destroy(session, &conn->log->log_lock); __wt_spin_destroy(session, &conn->log->log_slot_lock); __wt_spin_destroy(session, &conn->log->log_sync_lock); diff --git a/src/third_party/wiredtiger/src/conn/conn_open.c b/src/third_party/wiredtiger/src/conn/conn_open.c index 9c978fed843..69b50147bf5 100644 --- a/src/third_party/wiredtiger/src/conn/conn_open.c +++ b/src/third_party/wiredtiger/src/conn/conn_open.c @@ -157,7 +157,7 @@ __wt_connection_close(WT_CONNECTION_IMPL *conn) WT_TRET(__wt_cache_destroy(session)); /* Discard transaction state. */ - WT_TRET(__wt_txn_global_destroy(session)); + __wt_txn_global_destroy(session); /* Close extensions, first calling any unload entry point. */ while ((dlh = TAILQ_FIRST(&conn->dlhqh)) != NULL) { @@ -186,27 +186,18 @@ __wt_connection_close(WT_CONNECTION_IMPL *conn) } /* - * The session's split stash isn't discarded during normal session close - * because it may persist past the life of the session. Discard it now. + * The session split stash, hazard information and handle arrays aren't + * discarded during normal session close, they persist past the life of + * the session. Discard them now. */ - if ((s = conn->sessions) != NULL) - for (i = 0; i < conn->session_size; ++s, ++i) - __wt_split_stash_discard_all(session, s); - - /* - * The session's hazard pointer memory isn't discarded during normal - * session close because access to it isn't serialized. Discard it - * now. - */ - if ((s = conn->sessions) != NULL) - for (i = 0; i < conn->session_size; ++s, ++i) { - /* - * If hash arrays were allocated, free them now. - */ - __wt_free(session, s->dhhash); - __wt_free(session, s->tablehash); - __wt_free(session, s->hazard); - } + if (!F_ISSET(conn, WT_CONN_LEAK_MEMORY)) + if ((s = conn->sessions) != NULL) + for (i = 0; i < conn->session_size; ++s, ++i) { + __wt_free(session, s->dhhash); + __wt_free(session, s->tablehash); + __wt_split_stash_discard_all(session, s); + __wt_free(session, s->hazard); + } /* Destroy the handle. */ WT_TRET(__wt_connection_destroy(conn)); diff --git a/src/third_party/wiredtiger/src/conn/conn_stat.c b/src/third_party/wiredtiger/src/conn/conn_stat.c index 4e7cac59c4a..0894d1c6058 100644 --- a/src/third_party/wiredtiger/src/conn/conn_stat.c +++ b/src/third_party/wiredtiger/src/conn/conn_stat.c @@ -528,8 +528,7 @@ __statlog_server(void *arg) while (F_ISSET(conn, WT_CONN_SERVER_RUN) && F_ISSET(conn, WT_CONN_SERVER_STATISTICS)) { /* Wait until the next event. */ - WT_ERR( - __wt_cond_wait(session, conn->stat_cond, conn->stat_usecs)); + __wt_cond_wait(session, conn->stat_cond, conn->stat_usecs); if (!FLD_ISSET(conn->stat_flags, WT_CONN_STAT_NONE)) WT_ERR(__statlog_log_one(session, &path, &tmp)); @@ -636,7 +635,7 @@ __wt_statlog_destroy(WT_SESSION_IMPL *session, bool is_close) /* Stop the server thread. */ F_CLR(conn, WT_CONN_SERVER_STATISTICS); if (conn->stat_tid_set) { - WT_TRET(__wt_cond_signal(session, conn->stat_cond)); + __wt_cond_signal(session, conn->stat_cond); WT_TRET(__wt_thread_join(session, conn->stat_tid)); conn->stat_tid_set = false; } diff --git a/src/third_party/wiredtiger/src/conn/conn_sweep.c b/src/third_party/wiredtiger/src/conn/conn_sweep.c index 5d24ea61607..dda296f50f3 100644 --- a/src/third_party/wiredtiger/src/conn/conn_sweep.c +++ b/src/third_party/wiredtiger/src/conn/conn_sweep.c @@ -97,7 +97,7 @@ __sweep_expire_one(WT_SESSION_IMPL *session) */ ret = __wt_conn_btree_sync_and_close(session, false, true); -err: WT_TRET(__wt_writeunlock(session, dhandle->rwlock)); +err: __wt_writeunlock(session, dhandle->rwlock); return (ret); } @@ -207,7 +207,7 @@ __sweep_remove_one(WT_SESSION_IMPL *session, WT_DATA_HANDLE *dhandle) * don't retry the discard until it times out again. */ if (ret != 0) { -err: WT_TRET(__wt_writeunlock(session, dhandle->rwlock)); +err: __wt_writeunlock(session, dhandle->rwlock); } return (ret); @@ -258,10 +258,12 @@ __sweep_server(void *arg) WT_DECL_RET; WT_SESSION_IMPL *session; time_t now; + uint64_t last_las_sweep_id, oldest_id; u_int dead_handles; session = arg; conn = S2C(session); + last_las_sweep_id = WT_TXN_NONE; /* * Sweep for dead and excess handles. @@ -269,8 +271,8 @@ __sweep_server(void *arg) while (F_ISSET(conn, WT_CONN_SERVER_RUN) && F_ISSET(conn, WT_CONN_SERVER_SWEEP)) { /* Wait until the next event. */ - WT_ERR(__wt_cond_wait(session, - conn->sweep_cond, conn->sweep_interval * WT_MILLION)); + __wt_cond_wait(session, + conn->sweep_cond, conn->sweep_interval * WT_MILLION); WT_ERR(__wt_seconds(session, &now)); WT_STAT_FAST_CONN_INCR(session, dh_sweeps); @@ -278,9 +280,22 @@ __sweep_server(void *arg) /* * Sweep the lookaside table. If the lookaside table hasn't yet * been written, there's no work to do. + * + * Don't sweep the lookaside table if the cache is stuck full. + * The sweep uses the cache and can exacerbate the problem. + * If we try to sweep when the cache is full or we aren't + * making progress in eviction, sweeping can wind up constantly + * bringing in and evicting pages from the lookaside table, + * which will stop the WT_CACHE_STUCK flag from being set. */ - if (__wt_las_is_written(session)) - WT_ERR(__wt_las_sweep(session)); + if (__wt_las_is_written(session) && + !F_ISSET(conn->cache, WT_CACHE_STUCK)) { + oldest_id = __wt_txn_oldest_id(session); + if (WT_TXNID_LT(last_las_sweep_id, oldest_id)) { + WT_ERR(__wt_las_sweep(session)); + last_las_sweep_id = oldest_id; + } + } /* * Mark handles with a time of death, and report whether any @@ -401,7 +416,7 @@ __wt_sweep_destroy(WT_SESSION_IMPL *session) F_CLR(conn, WT_CONN_SERVER_SWEEP); if (conn->sweep_tid_set) { - WT_TRET(__wt_cond_signal(session, conn->sweep_cond)); + __wt_cond_signal(session, conn->sweep_cond); WT_TRET(__wt_thread_join(session, conn->sweep_tid)); conn->sweep_tid_set = 0; } diff --git a/src/third_party/wiredtiger/src/cursor/cur_backup.c b/src/third_party/wiredtiger/src/cursor/cur_backup.c index 63952169566..598da3f0ac6 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_backup.c +++ b/src/third_party/wiredtiger/src/cursor/cur_backup.c @@ -227,9 +227,9 @@ __backup_start( * could start a hot backup that would race with an already-started * checkpoint. */ - WT_RET(__wt_writelock(session, conn->hot_backup_lock)); + __wt_writelock(session, conn->hot_backup_lock); conn->hot_backup = true; - WT_ERR(__wt_writeunlock(session, conn->hot_backup_lock)); + __wt_writeunlock(session, conn->hot_backup_lock); /* We're the lock holder, we own cleanup. */ F_SET(cb, WT_CURBACKUP_LOCKER); @@ -342,9 +342,9 @@ __backup_stop(WT_SESSION_IMPL *session, WT_CURSOR_BACKUP *cb) WT_TRET(__wt_backup_file_remove(session)); /* Checkpoint deletion can proceed, as can the next hot backup. */ - WT_TRET(__wt_writelock(session, conn->hot_backup_lock)); + __wt_writelock(session, conn->hot_backup_lock); conn->hot_backup = false; - WT_TRET(__wt_writeunlock(session, conn->hot_backup_lock)); + __wt_writeunlock(session, conn->hot_backup_lock); return (ret); } diff --git a/src/third_party/wiredtiger/src/cursor/cur_join.c b/src/third_party/wiredtiger/src/cursor/cur_join.c index 0760a07a3aa..f6cd5d90f62 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_join.c +++ b/src/third_party/wiredtiger/src/cursor/cur_join.c @@ -612,19 +612,17 @@ __curjoin_entry_member(WT_SESSION_IMPL *session, WT_CURSOR_JOIN_ENTRY *entry, if (entry->bloom != NULL) { /* + * If the item is not in the Bloom filter, we return + * immediately, otherwise, we still need to check the long + * way, since it may be a false positive. + * * If we don't own the Bloom filter, we must be sharing one * in a previous entry. So the shared filter has already - * been checked and passed. - */ - if (!F_ISSET(entry, WT_CURJOIN_ENTRY_OWN_BLOOM)) - return (0); - - /* - * If the item is not in the Bloom filter, we return - * immediately, otherwise, we still need to check the - * long way. + * been checked and passed, we don't need to check it again. + * We'll still need to check the long way. */ - WT_ERR(__wt_bloom_inmem_get(entry->bloom, key)); + if (F_ISSET(entry, WT_CURJOIN_ENTRY_OWN_BLOOM)) + WT_ERR(__wt_bloom_inmem_get(entry->bloom, key)); bloom_found = true; } if (entry->subjoin != NULL) { diff --git a/src/third_party/wiredtiger/src/cursor/cur_log.c b/src/third_party/wiredtiger/src/cursor/cur_log.c index 2adf0c2b8ab..76f31b417a6 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_log.c +++ b/src/third_party/wiredtiger/src/cursor/cur_log.c @@ -323,7 +323,7 @@ __curlog_close(WT_CURSOR *cursor) WT_ASSERT(session, FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED)); if (F_ISSET(cl, WT_CURLOG_ARCHIVE_LOCK)) - WT_TRET(__wt_readunlock(session, conn->log->log_archive_lock)); + __wt_readunlock(session, conn->log->log_archive_lock); __wt_free(session, cl->cur_lsn); __wt_free(session, cl->next_lsn); @@ -401,7 +401,7 @@ __wt_curlog_open(WT_SESSION_IMPL *session, WT_ERR(__wt_log_force_write(session, 1, NULL)); /* Log cursors block archiving. */ - WT_ERR(__wt_readlock(session, log->log_archive_lock)); + __wt_readlock(session, log->log_archive_lock); F_SET(cl, WT_CURLOG_ARCHIVE_LOCK); if (0) { diff --git a/src/third_party/wiredtiger/src/cursor/cur_metadata.c b/src/third_party/wiredtiger/src/cursor/cur_metadata.c index fc63ca13f7c..fd00acdf0ab 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_metadata.c +++ b/src/third_party/wiredtiger/src/cursor/cur_metadata.c @@ -31,55 +31,86 @@ } while (0) /* - * __wt_schema_create_final -- - * Create a single configuration line from a set of configuration strings, - * including all of the defaults declared for a session.create, and stripping - * any configuration strings that don't belong in a session.create. Here for - * the wt dump command utility, which reads a set of configuration strings and - * needs to add in the defaults and then collapse them into single string for - * a subsequent load. + * __schema_source_config -- + * Extract the "source" configuration key, lookup its metadata. */ -int -__wt_schema_create_final( - WT_SESSION_IMPL *session, char *cfg_arg[], char **value_ret) +static int +__schema_source_config(WT_SESSION_IMPL *session, + WT_CURSOR *srch, const char *config, const char **result) { + WT_CONFIG_ITEM cval; + WT_DECL_ITEM(buf); WT_DECL_RET; - u_int i; - const char **cfg; - - /* - * Count the entries in the original, - * Allocate a copy with the defaults as the first entry, - * Collapse the whole thing into a single configuration string (which - * also strips any entries that don't appear in the first entry). - */ - for (i = 0; cfg_arg[i] != NULL; ++i) - ; - WT_RET(__wt_calloc_def(session, i + 2, &cfg)); - cfg[0] = WT_CONFIG_BASE(session, WT_SESSION_create); - for (i = 0; cfg_arg[i] != NULL; ++i) - cfg[i + 1] = cfg_arg[i]; - cfg[i + 1] = NULL; - - ret = __wt_config_collapse(session, cfg, value_ret); - - __wt_free(session, cfg); + char *v; + + WT_ERR(__wt_config_getones(session, config, "source", &cval)); + WT_ERR(__wt_scr_alloc(session, cval.len + 10, &buf)); + WT_ERR(__wt_buf_fmt(session, buf, "%.*s", (int)cval.len, cval.str)); + srch->set_key(srch, buf->data); + if ((ret = srch->search(srch)) == WT_NOTFOUND) + WT_ERR(EINVAL); + WT_ERR(ret); + WT_ERR(srch->get_value(srch, &v)); + WT_ERR(__wt_strdup(session, v, result)); + +err: __wt_scr_free(session, &buf); return (ret); } /* - * __schema_create_strip -- - * Discard any configuration information from a schema entry that is not - * applicable to an session.create call. Here for the metadata:create URI. + * __schema_create_collapse -- + * Discard any configuration information from a schema entry that is + * not applicable to an session.create call. + * + * For a table URI that contains no named column groups, fold in the + * configuration from the implicit column group and its source. For a + * named column group URI, fold in its source. */ static int -__schema_create_strip( - WT_SESSION_IMPL *session, const char *value, char **value_ret) +__schema_create_collapse(WT_SESSION_IMPL *session, WT_CURSOR_METADATA *mdc, + const char *key, const char *value, char **value_ret) { - const char *cfg[] = - { WT_CONFIG_BASE(session, WT_SESSION_create), value, NULL }; - - return (__wt_config_collapse(session, cfg, value_ret)); + WT_CURSOR *c; + WT_DECL_ITEM(buf); + WT_DECL_RET; + const char *_cfg[5] = {NULL, NULL, NULL, value, NULL}; + const char **cfg, **firstcfg, **lastcfg, *v; + + lastcfg = cfg = &_cfg[3]; /* position on value */ + c = NULL; + if (key != NULL && WT_PREFIX_SKIP(key, "table:")) { + c = mdc->create_cursor; + WT_ERR(__wt_scr_alloc(session, 0, &buf)); + /* + * When a table is created without column groups, + * we create one without a name. + */ + WT_ERR(__wt_buf_fmt(session, buf, "colgroup:%s", key)); + c->set_key(c, buf->data); + if ((ret = c->search(c)) == 0) { + WT_ERR(c->get_value(c, &v)); + WT_ERR(__wt_strdup(session, v, --cfg)); + WT_ERR(__schema_source_config(session, c, v, --cfg)); + } else + WT_ERR_NOTFOUND_OK(ret); + } else if (key != NULL && WT_PREFIX_SKIP(key, "colgroup:")) { + if (strchr(key, ':') != NULL) { + c = mdc->create_cursor; + WT_ERR(__wt_strdup(session, value, --cfg)); + WT_ERR( + __schema_source_config(session, c, value, --cfg)); + } + } + firstcfg = cfg; + *--firstcfg = WT_CONFIG_BASE(session, WT_SESSION_create); + WT_ERR(__wt_config_collapse(session, firstcfg, value_ret)); + +err: for (; cfg < lastcfg; cfg++) + __wt_free(session, *cfg); + if (c != NULL) + WT_TRET(c->reset(c)); + __wt_scr_free(session, &buf); + return (ret); } /* @@ -95,17 +126,17 @@ __curmetadata_setkv(WT_CURSOR_METADATA *mdc, WT_CURSOR *fc) WT_SESSION_IMPL *session; char *value; + value = NULL; c = &mdc->iface; session = (WT_SESSION_IMPL *)c->session; c->key.data = fc->key.data; c->key.size = fc->key.size; if (F_ISSET(mdc, WT_MDC_CREATEONLY)) { - WT_RET(__schema_create_strip(session, fc->value.data, &value)); - ret = __wt_buf_set( - session, &c->value, value, strlen(value) + 1); - __wt_free(session, value); - WT_RET(ret); + WT_ERR(__schema_create_collapse( + session, mdc, fc->key.data, fc->value.data, &value)); + WT_ERR(__wt_buf_set( + session, &c->value, value, strlen(value) + 1)); } else { c->value.data = fc->value.data; c->value.size = fc->value.size; @@ -115,7 +146,8 @@ __curmetadata_setkv(WT_CURSOR_METADATA *mdc, WT_CURSOR *fc) F_CLR(mdc, WT_MDC_ONMETADATA); F_SET(mdc, WT_MDC_POSITIONED); - return (0); +err: __wt_free(session, value); + return (ret); } /* @@ -123,8 +155,9 @@ __curmetadata_setkv(WT_CURSOR_METADATA *mdc, WT_CURSOR *fc) * but also check for the internal version of the URI. */ #define WT_KEY_IS_METADATA(key) \ + ((key)->size > 0 && \ (WT_STRING_MATCH(WT_METADATA_URI, (key)->data, (key)->size - 1) ||\ - WT_STRING_MATCH(WT_METAFILE_URI, (key)->data, (key)->size - 1)) + WT_STRING_MATCH(WT_METAFILE_URI, (key)->data, (key)->size - 1))) /* * __curmetadata_metadata_search -- @@ -143,7 +176,8 @@ __curmetadata_metadata_search(WT_SESSION_IMPL *session, WT_CURSOR *cursor) WT_RET(__wt_metadata_search(session, WT_METAFILE_URI, &value)); if (F_ISSET(mdc, WT_MDC_CREATEONLY)) { - ret = __schema_create_strip(session, value, &stripped); + ret = __schema_create_collapse(session, mdc, NULL, value, + &stripped); __wt_free(session, value); WT_RET(ret); value = stripped; @@ -467,19 +501,20 @@ err: API_END_RET(session, ret); static int __curmetadata_close(WT_CURSOR *cursor) { - WT_CURSOR *file_cursor; + WT_CURSOR *c; WT_CURSOR_METADATA *mdc; WT_DECL_RET; WT_SESSION_IMPL *session; mdc = (WT_CURSOR_METADATA *)cursor; - file_cursor = mdc->file_cursor; - CURSOR_API_CALL(cursor, session, - close, file_cursor == NULL ? - NULL : ((WT_CURSOR_BTREE *)file_cursor)->btree); - - if (file_cursor != NULL) - ret = file_cursor->close(file_cursor); + c = mdc->file_cursor; + CURSOR_API_CALL(cursor, session, close, c == NULL ? + NULL : ((WT_CURSOR_BTREE *)c)->btree); + + if (c != NULL) + ret = c->close(c); + if ((c = mdc->create_cursor) != NULL) + WT_TRET(c->close(c)); WT_TRET(__wt_cursor_close(cursor)); err: API_END_RET(session, ret); @@ -536,11 +571,18 @@ __wt_curmetadata_open(WT_SESSION_IMPL *session, */ WT_ERR(__wt_metadata_cursor_open(session, cfg[1], &mdc->file_cursor)); - WT_ERR(__wt_cursor_init(cursor, uri, owner, cfg, cursorp)); - - /* If we are only returning create config, strip internal metadata. */ - if (WT_STREQ(uri, "metadata:create")) + /* + * If we are only returning create config, strip internal metadata. + * We'll need some extra cursors to pull out column group information + * and chase "source" entries. + */ + if (WT_STREQ(uri, "metadata:create")) { F_SET(mdc, WT_MDC_CREATEONLY); + WT_ERR(__wt_metadata_cursor_open(session, cfg[1], + &mdc->create_cursor)); + } + + WT_ERR(__wt_cursor_init(cursor, uri, owner, cfg, cursorp)); /* * Metadata cursors default to readonly; if not set to not-readonly, diff --git a/src/third_party/wiredtiger/src/cursor/cur_std.c b/src/third_party/wiredtiger/src/cursor/cur_std.c index 8bb8931f36f..86594179907 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_std.c +++ b/src/third_party/wiredtiger/src/cursor/cur_std.c @@ -50,7 +50,7 @@ __wt_cursor_get_value_notsup(WT_CURSOR *cursor, ...) void __wt_cursor_set_key_notsup(WT_CURSOR *cursor, ...) { - (void)__wt_cursor_notsup(cursor); + WT_IGNORE_RET(__wt_cursor_notsup(cursor)); } /* @@ -60,7 +60,7 @@ __wt_cursor_set_key_notsup(WT_CURSOR *cursor, ...) void __wt_cursor_set_value_notsup(WT_CURSOR *cursor, ...) { - (void)__wt_cursor_notsup(cursor); + WT_IGNORE_RET(__wt_cursor_notsup(cursor)); } /* diff --git a/src/third_party/wiredtiger/src/docs/custom-file-systems.dox b/src/third_party/wiredtiger/src/docs/custom-file-systems.dox index d496002b0fb..91bda3a23b5 100644 --- a/src/third_party/wiredtiger/src/docs/custom-file-systems.dox +++ b/src/third_party/wiredtiger/src/docs/custom-file-systems.dox @@ -9,13 +9,23 @@ in the WT_FILE_SYSTEM and WT_FILE_HANDLE structures, and documentation for those structures indicate which methods are optional. Methods which are not provided should be set to NULL. -Generally, function pointers should not be changed once a handle is -created. An exception to this are the WT_FILE_HANDLE::fallocate and -WT_FILE_HANDLE::fallocate_nolock methods, because a file system -implementation may not know what support the system provides until file -allocation is attempted. See the WiredTiger POSIX file system -implementation for an example of how the fallocate method might be -changed after initialization. +Function pointers should not be cleared once a handle is created. +(WiredTiger might check for a non-NULL method and then call it, and +clearing the function pointer could result in a core dump.) + +Function pointers are not expected to be cleared or set after a handle +is created. An exception to this are the file extension methods, because +existing file system implementations do not know the level of support +the underlying system provides until after file extension is attempted. +For this reason, these methods appear in both locking and non-locking +versions. Custom file systems needing to discover system support before +configuring non-locking methods should initialize only the locking +version of the method, then either set the non-locking version of the +method and clear the locking method (or clear both methods), after +discovery is complete. Clearing the method value is safe because calls +are serialized until a non-locking method is set. Note it is not +possible to downgrade from a non-locking version of these methods to a +locking version. WT_FILE_SYSTEM and WT_FILE_HANDLE methods are expected to return POSIX 1003.1 or ANSI C standard error codes on failure. Custom file systems @@ -23,13 +33,18 @@ on Windows systems can use the WT_EXTENSION_API::map_windows_error method to translate Windows system errors into POSIX system errors for return to WiredTiger. -WT_FILE_SYSTEM and WT_FILE_HANDLE methods which fail but not fatally -(for example, a WT_FILE_HANDLE::truncate method call which fails because -the file is currently mapped into memory), should return EBUSY. - -WT_FILE_SYSTEM and WT_FILE_HANDLE methods which fail fatally, but not -in all cases (for example, a WT_FILE_HANDLE::fadvise method call which -only supports ::WT_FILE_HANDLE_WILLNEED), should return ENOTSUP. +WT_FILE_SYSTEM and WT_FILE_HANDLE methods which fail, but where future +calls may succeed (for example, a WT_FILE_HANDLE::fh_truncate method +call which fails because the file is currently mapped into memory), +should return EBUSY. + +WT_FILE_SYSTEM and WT_FILE_HANDLE methods which fail, and no future +calls will succeed, should return ENOTSUP. This failure may describe +either the entire method being unavailable or a particular mode failure. +For example, a WT_FILE_HANDLE::fh_advise method call with an argument of +::WT_FILE_HANDLE_DONTNEED, where the file handle doesn't support the +WT_FILE_HANDLE::fh_advise method at all, or only supports the method +argument ::WT_FILE_HANDLE_WILLNEED, should return ENOTSUP. Additionally, custom file system functions may return ::WT_PANIC to shut down the system. diff --git a/src/third_party/wiredtiger/src/docs/license.dox b/src/third_party/wiredtiger/src/docs/license.dox index d7814d04fd6..b70823202ad 100644 --- a/src/third_party/wiredtiger/src/docs/license.dox +++ b/src/third_party/wiredtiger/src/docs/license.dox @@ -46,7 +46,7 @@ of the WiredTiger library should comply with these copyrights. @row{\c src/support/hash_fnv.c, Authors, Public Domain} </table> -@section license_crc32-vpmsum 3rd party software optionally included in the WiredTiger library: PPC64 +@section license_crc32-power8 3rd party software optionally included in the WiredTiger library: PPC64 PPC64 and PPC64LE builds of the WiredTiger library binary include additional 3rd party software, distributed under separate license terms. Redistribution @@ -55,7 +55,18 @@ copyrights. <table> @hrow{Distribution Files, Copyright Holder, License} -@row{\c src/support/power8/*, Anton Blanchard, <a href="http://opensource.org/licenses/Apache-2.0">Apache License\, Version 2.0</a> or the <a href="http://www.gnu.org/licenses/gpl-2.0-standalone.html">GNU General Public License\, version 2 or later</a>} +@row{\c src/support/power8/*, Anton Blanchard\, IBM Corp., <a href="http://opensource.org/licenses/Apache-2.0">Apache License\, Version 2.0</a> or the <a href="http://www.gnu.org/licenses/gpl-2.0-standalone.html">GNU General Public License\, version 2 or later</a>} +</table> + +@section license_crc32-zseries 3rd party software optionally included in the WiredTiger library: s390x + +IBM z13 processor builds of the WiredTiger library binary include additional +3rd party software, distributed under separate license terms. Redistribution +of the WiredTiger library z13 builds should comply with these copyrights. + +<table> +@hrow{Distribution Files, Copyright Holder, License} +@row{\c src/support/zseries/*, IBM Corp., <a href="http://opensource.org/licenses/Apache-2.0">Apache License\, Version 2.0</a> or the <a href="http://www.gnu.org/licenses/gpl-2.0-standalone.html">GNU General Public License\, version 2 or later</a>} </table> @section license_leveldb 3rd party software optionally included in the WiredTiger library: LevelDB diff --git a/src/third_party/wiredtiger/src/docs/readonly.dox b/src/third_party/wiredtiger/src/docs/readonly.dox index ad4a94a73f1..35378cf9567 100644 --- a/src/third_party/wiredtiger/src/docs/readonly.dox +++ b/src/third_party/wiredtiger/src/docs/readonly.dox @@ -47,7 +47,8 @@ One unusual affect of read-only operations is the potential for multiple read-only database handles open on the same database at the same time. WiredTiger prevents multiple connection handles by writing a lock file, and this locking is done even in read-only mode. However, if the lock -file cannot be written, opening in read-only mode is still allowed to +file cannot be written, that is, if the WiredTiger home directory does not +have write permission, opening in read-only mode is still allowed to proceed. For that reason, multiple read-only connection handles could be open at the same time. Normal locking occurs if the lock file can be written in read-only mode, preventing multiple database connections. diff --git a/src/third_party/wiredtiger/src/docs/spell.ok b/src/third_party/wiredtiger/src/docs/spell.ok index e08eb7d1447..a2ef7658ec6 100644 --- a/src/third_party/wiredtiger/src/docs/spell.ok +++ b/src/third_party/wiredtiger/src/docs/spell.ok @@ -15,6 +15,7 @@ Coverity Coverity's DB's DBTs +DONTNEED Datastore DbCursor DbEnv @@ -216,6 +217,8 @@ failchk fallocate fd's fdatasync +fextend +fh fieldname fileID fileformats @@ -230,6 +233,7 @@ forw fput freelist fsync +ftruncate gcc gdbm ge @@ -502,3 +506,4 @@ wtstats xa yieldcpu zlib +zseries diff --git a/src/third_party/wiredtiger/src/docs/tune-cache.dox b/src/third_party/wiredtiger/src/docs/tune-cache.dox index 505da436277..fc42fc80046 100644 --- a/src/third_party/wiredtiger/src/docs/tune-cache.dox +++ b/src/third_party/wiredtiger/src/docs/tune-cache.dox @@ -60,24 +60,38 @@ WiredTiger eviction tuning options can be configured when first opening a database via ::wiredtiger_open, or changed after open with WT_CONNECTION::reconfigure. -The \c eviction_trigger configuration value is the occupied percentage -of the total cache size that causes eviction to start. By default, -WiredTiger begins evicting pages when the cache is 95% full. An -application concerned about a latency spike as the cache becomes full -might want to begin eviction earlier. - -The \c eviction_target configuration value is the overall target for -eviction, expressed as a percentage of total cache size; that is, once -eviction begins, it will proceed until the target percentage of bytes -in the cache is reached. Note the \c eviction_target configuration -value is ignored until eviction is triggered. - -The \c eviction_dirty_target configuration value is the overall dirty -byte target for eviction, expressed as a percentage of total cache size; -that is, once eviction begins, it will proceed until the target -percentage of dirty bytes in the cache is reached. Note the -\c eviction_dirty_target configuration value is ignored until eviction -is triggered. +The \c eviction_target configuration value (default 80%) is the level at +which WiredTiger attempts to keep the overall cache usage. Eviction worker +threads are active when the cache contains at least this much content, +expressed as a percentage of the total cache size. + +The \c eviction_trigger configuration value (default 95%) is the level at +which application threads start to perform eviction. This will throttle +application operations, increasing operation latency, usually resulting in +the cache usage staying at this level when there is more cache pressure +than eviction worker threads can handle in the background. + +Operations will stall when the cache reaches 100% of the cache size. +Application may want to change these settings from their defaults to either +increase the range in which worker threads operate before application +threads are throttled, or to use a larger proportion of RAM, if eviction +worker threads have no difficulty handling the cache pressure generated by +the application. + +The \c eviction_dirty_target (default 5%) and \c eviction_dirty_trigger +(default 20%) operate in a similar way to the overall targets, but only +apply to dirty data in cache. In particular, application threads will be +throttled if the percentage of dirty data reaches the +\c eviction_dirty_trigger. Any page that has been modified since it was +read from disk is considered dirty. + +The dirty eviction settings control how much work checkpoints have to do +in the worst case, and also limit how much memory fragmentation is likely +for memory allocations related to the cache. Most memory fragmentation is +caused by workloads that generate a mix of updates (small allocations) with +cache misses (large allocations). Limiting the percentage of cache that +can be dirty limits the worst case fragmentation to the approximately the +same level. @snippet ex_all.c Eviction configuration diff --git a/src/third_party/wiredtiger/src/docs/wtperf.dox b/src/third_party/wiredtiger/src/docs/wtperf.dox index 17b95660f79..c794ee2f2d7 100644 --- a/src/third_party/wiredtiger/src/docs/wtperf.dox +++ b/src/third_party/wiredtiger/src/docs/wtperf.dox @@ -264,6 +264,8 @@ transaction configuration string, relevant when populate_opts_per_txn is nonzero @par table_name (string, default=test) table name +@par truncate_single_ops (boolean, default=false) +Implement truncate via cursor remove instead of session API @par value_sz_max (unsigned int, default=1000) maximum value size when delta updates are present. Default disabled @par value_sz_min (unsigned int, default=1) diff --git a/src/third_party/wiredtiger/src/evict/evict_lru.c b/src/third_party/wiredtiger/src/evict/evict_lru.c index 7d3fd838dcd..44031729e82 100644 --- a/src/third_party/wiredtiger/src/evict/evict_lru.c +++ b/src/third_party/wiredtiger/src/evict/evict_lru.c @@ -9,15 +9,18 @@ #include "wt_internal.h" static int __evict_clear_all_walks(WT_SESSION_IMPL *); -static int __evict_helper(WT_SESSION_IMPL *); static int WT_CDECL __evict_lru_cmp(const void *, const void *); static int __evict_lru_pages(WT_SESSION_IMPL *, bool); static int __evict_lru_walk(WT_SESSION_IMPL *); static int __evict_page(WT_SESSION_IMPL *, bool); static int __evict_pass(WT_SESSION_IMPL *); static int __evict_server(WT_SESSION_IMPL *, bool *); -static int __evict_walk(WT_SESSION_IMPL *, uint32_t); -static int __evict_walk_file(WT_SESSION_IMPL *, uint32_t, u_int, u_int *); +static int __evict_walk(WT_SESSION_IMPL *, WT_EVICT_QUEUE *); +static int __evict_walk_file( + WT_SESSION_IMPL *, WT_EVICT_QUEUE *, u_int, u_int *, bool *); + +#define WT_EVICT_HAS_WORKERS(s) \ + (S2C(s)->evict_threads.current_threads > 1) /* * __evict_read_gen -- @@ -49,6 +52,10 @@ __evict_read_gen(const WT_EVICT_ENTRY *entry) if (__wt_page_is_empty(page)) return (WT_READGEN_OLDEST); + /* Any large page in memory is likewise a good choice. */ + if (page->memory_footprint > btree->splitmempage) + return (WT_READGEN_OLDEST); + /* * The base read-generation is skewed by the eviction priority. * Internal pages are also adjusted, we prefer to evict leaf pages. @@ -136,10 +143,33 @@ __wt_evict_list_clear_page(WT_SESSION_IMPL *session, WT_REF *ref) } /* + * __evict_queue_empty -- + * Is the queue empty? + */ +static inline bool +__evict_queue_empty(WT_EVICT_QUEUE *queue) +{ + return (queue->evict_current == NULL || + queue->evict_candidates == 0); +} + +/* + * __evict_queue_full -- + * Is the queue full (i.e., it has been populated with candidates and none + * of them have been evicted yet)? + */ +static inline bool +__evict_queue_full(WT_EVICT_QUEUE *queue) +{ + return (queue->evict_current == queue->evict_queue && + queue->evict_candidates != 0); +} + +/* * __wt_evict_server_wake -- * Wake the eviction server thread. */ -int +void __wt_evict_server_wake(WT_SESSION_IMPL *session) { WT_CACHE *cache; @@ -154,43 +184,45 @@ __wt_evict_server_wake(WT_SESSION_IMPL *session) bytes_inuse = __wt_cache_bytes_inuse(cache); bytes_max = conn->cache_size; - WT_RET(__wt_verbose(session, WT_VERB_EVICTSERVER, + __wt_verbose(session, WT_VERB_EVICTSERVER, "waking, bytes inuse %s max (%" PRIu64 "MB %s %" PRIu64 "MB)", bytes_inuse <= bytes_max ? "<=" : ">", bytes_inuse / WT_MEGABYTE, bytes_inuse <= bytes_max ? "<=" : ">", - bytes_max / WT_MEGABYTE)); + bytes_max / WT_MEGABYTE); } #endif - return (__wt_cond_auto_signal(session, cache->evict_cond)); + __wt_cond_auto_signal(session, cache->evict_cond); } /* - * __evict_thread_run -- - * General wrapper for any eviction thread. + * __wt_evict_thread_run -- + * Starting point for an eviction thread. */ -static WT_THREAD_RET -__evict_thread_run(void *arg) +int +__wt_evict_thread_run(WT_SESSION_IMPL *session, WT_THREAD *thread) { WT_CACHE *cache; WT_CONNECTION_IMPL *conn; WT_DECL_RET; - WT_SESSION_IMPL *session; bool did_work; - session = arg; conn = S2C(session); cache = conn->cache; #ifdef HAVE_DIAGNOSTIC - if (session == conn->evict_session) - WT_ERR(__wt_epoch( - session, &cache->stuck_ts)); /* -Wuninitialized */ + /* + * Ensure the cache stuck timer is initialized when starting eviction + */ + if (thread->id == 0) + WT_ERR(__wt_epoch(session, &cache->stuck_ts)); #endif - while (F_ISSET(conn, WT_CONN_EVICTION_RUN)) { - if (conn->evict_tid_set && + + while (F_ISSET(conn, WT_CONN_EVICTION_RUN) && + F_ISSET(thread, WT_THREAD_RUN)) { + if (conn->evict_server_running && __wt_spin_trylock(session, &cache->evict_pass_lock) == 0) { /* * Cannot use WT_WITH_PASS_LOCK because this is a try @@ -205,40 +237,40 @@ __evict_thread_run(void *arg) F_CLR(session, WT_SESSION_LOCKED_PASS); __wt_spin_unlock(session, &cache->evict_pass_lock); WT_ERR(ret); - WT_ERR(__wt_verbose( - session, WT_VERB_EVICTSERVER, "sleeping")); + __wt_verbose(session, WT_VERB_EVICTSERVER, "sleeping"); /* Don't rely on signals: check periodically. */ - WT_ERR(__wt_cond_auto_wait( - session, cache->evict_cond, did_work)); - WT_ERR(__wt_verbose( - session, WT_VERB_EVICTSERVER, "waking")); + __wt_cond_auto_wait( + session, cache->evict_cond, did_work); + __wt_verbose(session, WT_VERB_EVICTSERVER, "waking"); } else - WT_ERR(__evict_helper(session)); + WT_ERR(__evict_lru_pages(session, false)); } - if (session == conn->evict_session) { - /* - * The eviction server is shutting down: in case any trees are - * still open, clear all walks now so that they can be closed. - */ + /* + * The only time the first eviction thread is stopped is on shutdown: + * in case any trees are still open, clear all walks now so that they + * can be closed. + */ + if (thread->id == 0) { WT_WITH_PASS_LOCK(session, ret, ret = __evict_clear_all_walks(session)); WT_ERR(ret); + /* + * The only two cases when the eviction server is expected to + * stop are when recovery is finished or when the connection is + * closing. + */ + WT_ASSERT(session, + F_ISSET(conn, WT_CONN_CLOSING | WT_CONN_RECOVERING)); } - WT_ERR(__wt_verbose( - session, WT_VERB_EVICTSERVER, "cache eviction thread exiting")); - /* - * The only two cases when eviction workers are expected to stop are - * when recovery is finished or when the connection is closing. Check - * otherwise fewer eviction worker threads may be running than - * expected. - */ - WT_ASSERT(session, F_ISSET(conn, WT_CONN_CLOSING | WT_CONN_RECOVERING)); + __wt_verbose( + session, WT_VERB_EVICTSERVER, "cache eviction thread exiting"); + if (0) { err: WT_PANIC_MSG(session, ret, "cache eviction thread error"); } - return (WT_THREAD_RET_VALUE); + return (ret); } /* @@ -306,10 +338,11 @@ __evict_server(WT_SESSION_IMPL *session, bool *did_work) /* After being stuck for 5 minutes, give up. */ WT_RET(__wt_epoch(session, &now)); if (WT_TIMEDIFF_SEC(now, cache->stuck_ts) > 300) { - __wt_err(session, ETIMEDOUT, + ret = ETIMEDOUT; + __wt_err(session, ret, "Cache stuck for too long, giving up"); - (void)__wt_cache_dump(session, NULL); - WT_RET(ETIMEDOUT); + WT_TRET(__wt_cache_dump(session, NULL)); + return (ret); } #endif } @@ -318,110 +351,31 @@ __evict_server(WT_SESSION_IMPL *session, bool *did_work) } /* - * __evict_workers_resize -- - * Resize the array of eviction workers (as needed after a reconfigure). - * We don't do this during the reconfigure because the eviction server - * thread owns these structures. - */ -static int -__evict_workers_resize(WT_SESSION_IMPL *session) -{ - WT_CONNECTION_IMPL *conn; - WT_DECL_RET; - WT_EVICT_WORKER *workers; - size_t alloc; - uint32_t i, session_flags; - - conn = S2C(session); - workers = NULL; /* -Wconditional-uninitialized */ - - if (conn->evict_workers_alloc < conn->evict_workers_max) { - alloc = conn->evict_workers_alloc * sizeof(*workers); - WT_RET(__wt_realloc(session, &alloc, - conn->evict_workers_max * sizeof(*workers), - &conn->evict_workctx)); - workers = conn->evict_workctx; - } - - for (i = conn->evict_workers_alloc; i < conn->evict_workers_max; i++) { - /* - * Eviction worker threads get their own session. - * Eviction worker threads may be called upon to perform slow - * operations for the block manager. - * - * Eviction worker threads get their own lookaside table cursor - * if the lookaside table is open. Note that eviction is also - * started during recovery, before the lookaside table is - * created. - */ - session_flags = WT_SESSION_CAN_WAIT; - if (F_ISSET(conn, WT_CONN_LAS_OPEN)) - FLD_SET(session_flags, WT_SESSION_LOOKASIDE_CURSOR); - WT_ERR(__wt_open_internal_session(conn, "eviction-worker", - false, session_flags, &workers[i].session)); - workers[i].id = i; - - if (i < conn->evict_workers_min) { - ++conn->evict_workers; - F_SET(&workers[i], WT_EVICT_WORKER_RUN); - WT_ERR(__wt_thread_create(workers[i].session, - &workers[i].tid, __evict_thread_run, - workers[i].session)); - } - } - -err: conn->evict_workers_alloc = conn->evict_workers_max; - return (ret); -} - -/* * __wt_evict_create -- - * Start the eviction server thread. + * Start the eviction server. */ int __wt_evict_create(WT_SESSION_IMPL *session) { WT_CONNECTION_IMPL *conn; - uint32_t session_flags; conn = S2C(session); + WT_ASSERT(session, conn->evict_threads_min > 0); /* Set first, the thread might run before we finish up. */ F_SET(conn, WT_CONN_EVICTION_RUN); - /* - * We need a session handle because we're reading/writing pages. - * - * The eviction server gets its own lookaside table cursor. - * - * If there's only a single eviction thread, it may be called upon to - * perform slow operations for the block manager. (The flag is not - * reset if reconfigured later, but I doubt that's a problem.) - */ - session_flags = F_ISSET(conn, WT_CONN_LAS_OPEN) ? - WT_SESSION_LOOKASIDE_CURSOR : 0; - if (conn->evict_workers_max == 0) - FLD_SET(session_flags, WT_SESSION_CAN_WAIT); - WT_RET(__wt_open_internal_session(conn, - "eviction-server", false, session_flags, &conn->evict_session)); - session = conn->evict_session; - - /* - * If eviction workers were configured, allocate sessions for them now. - * This is done to reduce the chance that we will open new eviction - * sessions after WT_CONNECTION::close is called. - */ - if (conn->evict_workers_max > 0) - WT_RET(__evict_workers_resize(session)); + /* Create the eviction thread group */ + WT_RET(__wt_thread_group_create(session, &conn->evict_threads, + "eviction-server", conn->evict_threads_min, + conn->evict_threads_max, WT_THREAD_CAN_WAIT | WT_THREAD_PANIC_FAIL, + __wt_evict_thread_run)); - /* - * Start the primary eviction server thread after the worker threads - * have started to avoid it starting additional worker threads before - * the worker's sessions are created. + /* + * Allow queues to be populated now that the eviction threads + * are running. */ - WT_RET(__wt_thread_create( - session, &conn->evict_tid, __evict_thread_run, session)); - conn->evict_tid_set = true; + conn->evict_server_running = true; return (0); } @@ -433,78 +387,33 @@ __wt_evict_create(WT_SESSION_IMPL *session) int __wt_evict_destroy(WT_SESSION_IMPL *session) { - WT_CACHE *cache; WT_CONNECTION_IMPL *conn; - WT_DECL_RET; - WT_EVICT_WORKER *workers; - WT_SESSION *wt_session; - uint32_t i; conn = S2C(session); - cache = conn->cache; - workers = conn->evict_workctx; - F_CLR(conn, WT_CONN_EVICTION_RUN); + /* We are done if the eviction server didn't start successfully. */ + if (!conn->evict_server_running) + return (0); + + /* Wait for any eviction thread group changes to stabilize. */ + __wt_writelock(session, conn->evict_threads.lock); /* - * Wait for the main eviction thread to exit before waiting on the - * helpers. The eviction server spawns helper threads, so we can't - * safely know how many helpers are running until the main thread is - * done. + * Signal the threads to finish and stop populating the queue. */ - WT_TRET(__wt_verbose( - session, WT_VERB_EVICTSERVER, "waiting for main thread")); - if (conn->evict_tid_set) { - WT_TRET(__wt_evict_server_wake(session)); - WT_TRET(__wt_thread_join(session, conn->evict_tid)); - conn->evict_tid_set = false; - } - - WT_TRET(__wt_verbose( - session, WT_VERB_EVICTSERVER, "waiting for helper threads")); - for (i = 0; i < conn->evict_workers; i++) { - WT_TRET(__wt_cond_signal(session, cache->evict_waiter_cond)); - WT_TRET(__wt_thread_join(session, workers[i].tid)); - } - conn->evict_workers = 0; - - /* Handle shutdown when cleaning up after a failed open. */ - if (conn->evict_workctx != NULL) { - for (i = 0; i < conn->evict_workers_alloc; i++) { - wt_session = &conn->evict_workctx[i].session->iface; - if (wt_session != NULL) - WT_TRET(wt_session->close(wt_session, NULL)); - } - __wt_free(session, conn->evict_workctx); - } - conn->evict_workers_alloc = 0; - - if (conn->evict_session != NULL) { - wt_session = &conn->evict_session->iface; - WT_TRET(wt_session->close(wt_session, NULL)); - - conn->evict_session = NULL; - } + F_CLR(conn, WT_CONN_EVICTION_RUN); + conn->evict_server_running = false; + __wt_evict_server_wake(session); - return (ret); -} + __wt_verbose( + session, WT_VERB_EVICTSERVER, "waiting for helper threads"); -/* - * __evict_helper -- - * Thread to help evict pages from the cache. - */ -static int -__evict_helper(WT_SESSION_IMPL *session) -{ - WT_CACHE *cache; - WT_DECL_RET; + /* + * We call the destroy function still holding the write lock. + * It assumes it is called locked. + */ + WT_RET(__wt_thread_group_destroy(session, &conn->evict_threads)); - cache = S2C(session)->cache; - if ((ret = __evict_lru_pages(session, false)) == WT_NOTFOUND) - WT_RET(__wt_cond_wait( - session, cache->evict_waiter_cond, 10000)); - else - WT_RET(ret); return (0); } @@ -529,16 +438,7 @@ __evict_update_work(WT_SESSION_IMPL *session) if (!F_ISSET(conn, WT_CONN_EVICTION_RUN)) return (false); - /* - * Setup the number of refs to consider in each handle, depending - * on how many handles are open. We want to consider less candidates - * from each file as more files are open. Handle the case where there - * are no files open by adding 1. - */ - cache->evict_max_refs_per_file = - WT_MAX(100, WT_MILLION / (conn->open_file_count + 1)); - - if (cache->evict_queues[WT_EVICT_URGENT_QUEUE].evict_current != NULL) + if (!__evict_queue_empty(cache->evict_urgent_queue)) FLD_SET(cache->state, WT_EVICT_STATE_URGENT); /* @@ -551,19 +451,25 @@ __evict_update_work(WT_SESSION_IMPL *session) bytes_inuse = __wt_cache_bytes_inuse(cache); if (bytes_inuse > (cache->eviction_target * bytes_max) / 100) FLD_SET(cache->state, WT_EVICT_STATE_CLEAN); + if (bytes_inuse > (cache->eviction_trigger * bytes_max) / 100) + FLD_SET(cache->state, WT_EVICT_STATE_CLEAN_HARD); + + dirty_inuse = __wt_cache_dirty_leaf_inuse(cache); + if (dirty_inuse > (cache->eviction_dirty_target * bytes_max) / 100) + FLD_SET(cache->state, WT_EVICT_STATE_DIRTY); + if (dirty_inuse > (cache->eviction_dirty_trigger * bytes_max) / 100) + FLD_SET(cache->state, WT_EVICT_STATE_DIRTY_HARD); /* * Scrub dirty pages and keep them in cache if we are less than half - * way between the cache target and trigger. + * way to the clean or dirty trigger. */ if (bytes_inuse < ((cache->eviction_target + cache->eviction_trigger) * + bytes_max) / 200 && dirty_inuse < + ((cache->eviction_dirty_target + cache->eviction_dirty_trigger) * bytes_max) / 200) FLD_SET(cache->state, WT_EVICT_STATE_SCRUB); - dirty_inuse = __wt_cache_dirty_leaf_inuse(cache); - if (dirty_inuse > (cache->eviction_dirty_target * bytes_max) / 100) - FLD_SET(cache->state, WT_EVICT_STATE_DIRTY); - /* * If the cache has been stuck and is now under control, clear the * stuck flag. @@ -579,6 +485,8 @@ __evict_update_work(WT_SESSION_IMPL *session) FLD_SET(cache->state, WT_EVICT_STATE_AGGRESSIVE); } + WT_STAT_FAST_CONN_SET(session, cache_eviction_state, cache->state); + return (FLD_ISSET(cache->state, WT_EVICT_STATE_ALL | WT_EVICT_STATE_URGENT)); } @@ -592,7 +500,6 @@ __evict_pass(WT_SESSION_IMPL *session) { WT_CACHE *cache; WT_CONNECTION_IMPL *conn; - WT_EVICT_WORKER *worker; uint64_t pages_evicted; u_int loop; @@ -642,30 +549,31 @@ __evict_pass(WT_SESSION_IMPL *session) } /* - * Start a worker if we have capacity and we haven't reached - * the eviction targets. + * Try to start a new thread if we have capacity and haven't + * reached the eviction targets. */ - if (FLD_ISSET(cache->state, WT_EVICT_STATE_ALL) && - conn->evict_workers < conn->evict_workers_max) { - WT_RET(__wt_verbose(session, WT_VERB_EVICTSERVER, - "Starting evict worker: %"PRIu32"\n", - conn->evict_workers)); - if (conn->evict_workers >= conn->evict_workers_alloc) - WT_RET(__evict_workers_resize(session)); - worker = &conn->evict_workctx[conn->evict_workers++]; - F_SET(worker, WT_EVICT_WORKER_RUN); - WT_RET(__wt_thread_create(session, - &worker->tid, __evict_thread_run, worker->session)); - } + if (FLD_ISSET(cache->state, WT_EVICT_STATE_ALL)) + WT_RET(__wt_thread_group_start_one( + session, &conn->evict_threads, false)); - WT_RET(__wt_verbose(session, WT_VERB_EVICTSERVER, + __wt_verbose(session, WT_VERB_EVICTSERVER, "Eviction pass with: Max: %" PRIu64 " In use: %" PRIu64 " Dirty: %" PRIu64, conn->cache_size, cache->bytes_inmem, - cache->bytes_dirty_intl + cache->bytes_dirty_leaf)); + cache->bytes_dirty_intl + cache->bytes_dirty_leaf); WT_RET(__evict_lru_walk(session)); - WT_RET_NOTFOUND_OK(__evict_lru_pages(session, true)); + + /* + * If the queue has been empty recently, keep queuing more + * pages to evict. If the rate of queuing pages is high + * enough, this score will go to zero, in which case the + * eviction server might as well help out with eviction. + */ + if (cache->evict_empty_score < WT_EVICT_EMPTY_SCORE_CUTOFF || + (!WT_EVICT_HAS_WORKERS(session) && + !__evict_queue_empty(cache->evict_urgent_queue))) + WT_RET_NOTFOUND_OK(__evict_lru_pages(session, true)); /* * If we're making progress, keep going; if we're not making @@ -685,8 +593,7 @@ __evict_pass(WT_SESSION_IMPL *session) */ WT_STAT_FAST_CONN_INCR(session, cache_eviction_server_slept); - WT_RET(__wt_cond_wait(session, - cache->evict_cond, WT_THOUSAND * WT_MAX(loop, 1))); + __wt_cond_wait(session, cache->evict_cond, WT_THOUSAND); if (loop == 100) { /* @@ -696,9 +603,8 @@ __evict_pass(WT_SESSION_IMPL *session) F_SET(cache, WT_CACHE_STUCK); WT_STAT_FAST_CONN_INCR( session, cache_eviction_slow); - WT_RET(__wt_verbose( - session, WT_VERB_EVICTSERVER, - "unable to reach eviction goal")); + __wt_verbose(session, WT_VERB_EVICTSERVER, + "unable to reach eviction goal"); break; } } else { @@ -799,13 +705,13 @@ __wt_evict_file_exclusive_on(WT_SESSION_IMPL *session) * this point. */ F_SET(btree, WT_BTREE_NO_EVICTION); - (void)__wt_atomic_add32(&cache->pass_intr, 1); + (void)__wt_atomic_addv32(&cache->pass_intr, 1); WT_FULL_BARRIER(); /* Clear any existing LRU eviction walk for the file. */ WT_WITH_PASS_LOCK(session, ret, ret = __evict_clear_walk(session)); - (void)__wt_atomic_sub32(&cache->pass_intr, 1); + (void)__wt_atomic_subv32(&cache->pass_intr, 1); WT_ERR(ret); /* @@ -873,7 +779,6 @@ __wt_evict_file_exclusive_off(WT_SESSION_IMPL *session) __wt_spin_unlock(session, &cache->evict_walk_lock); } -#define APP_EVICT_THRESHOLD 3 /* Threshold to help evict */ /* * __evict_lru_pages -- * Get pages from the LRU queue to evict. @@ -881,34 +786,26 @@ __wt_evict_file_exclusive_off(WT_SESSION_IMPL *session) static int __evict_lru_pages(WT_SESSION_IMPL *session, bool is_server) { - WT_CACHE *cache; + WT_CONNECTION_IMPL *conn; WT_DECL_RET; - uint64_t app_evict_percent, total_evict; - /* - * The server will not help evict if the workers are coping with - * eviction workload, that is, if fewer than the threshold of the - * pages are evicted by application threads. - */ - if (is_server && S2C(session)->evict_workers > 1) { - cache = S2C(session)->cache; - total_evict = cache->app_evicts + - cache->server_evicts + cache->worker_evicts; - app_evict_percent = (100 * cache->app_evicts) / - (total_evict + 1); - if (app_evict_percent < APP_EVICT_THRESHOLD) { - WT_STAT_FAST_CONN_INCR(session, - cache_eviction_server_not_evicting); - return (0); - } - } + conn = S2C(session); /* * Reconcile and discard some pages: EBUSY is returned if a page fails * eviction because it's unavailable, continue in that case. */ - while ((ret = __evict_page(session, is_server)) == 0 || ret == EBUSY) - ; + while (F_ISSET(S2C(session), WT_CONN_EVICTION_RUN) && ret == 0) + if ((ret = __evict_page(session, is_server)) == EBUSY) + ret = 0; + + /* If a worker thread found the queue empty, pause. */ + if (ret == WT_NOTFOUND && !is_server && + F_ISSET(S2C(session), WT_CONN_EVICTION_RUN)) { + ret = 0; + __wt_cond_wait(session, conn->evict_threads.wait_cond, 10000); + } + return (ret); } @@ -921,21 +818,45 @@ __evict_lru_walk(WT_SESSION_IMPL *session) { WT_CACHE *cache; WT_DECL_RET; - WT_EVICT_QUEUE *queue; + WT_EVICT_QUEUE *queue, *other_queue; uint64_t read_gen_oldest; - uint32_t candidates, entries, queue_index; + uint32_t candidates, entries; cache = S2C(session)->cache; + /* Age out the score of how much the queue has been empty recently. */ + cache->evict_empty_score = (99 * cache->evict_empty_score) / 100; + /* Fill the next queue (that isn't the urgent queue). */ - queue_index = - 1 + (cache->evict_queue_fill++ % (WT_EVICT_QUEUE_MAX - 1)); - queue = &cache->evict_queues[queue_index]; + queue = cache->evict_fill_queue; + other_queue = cache->evict_queues + (1 - (queue - cache->evict_queues)); + + /* If this queue is full, try the other one. */ + if (__evict_queue_full(queue) && !__evict_queue_full(other_queue)) + queue = other_queue; + other_queue = cache->evict_fill_queue = + &cache->evict_queues[1 - (queue - cache->evict_queues)]; + + /* + * If both queues are full and haven't been empty on recent refills, + * we're done. + */ + if (__evict_queue_full(queue) && + cache->evict_empty_score < WT_EVICT_EMPTY_SCORE_CUTOFF) + return (0); /* Get some more pages to consider for eviction. */ - if ((ret = __evict_walk(cache->walk_session, queue_index)) != 0) + if ((ret = __evict_walk(cache->walk_session, queue)) != 0) return (ret == EBUSY ? 0 : ret); + /* Make sure the other queue is current before locking. */ + if (cache->evict_current_queue != other_queue) { + __wt_spin_lock(session, &cache->evict_queue_lock); + cache->evict_other_queue = queue; + cache->evict_current_queue = other_queue; + __wt_spin_unlock(session, &cache->evict_queue_lock); + } + /* Sort the list into LRU order and restart. */ __wt_spin_lock(session, &queue->evict_lock); @@ -1020,26 +941,26 @@ __evict_lru_walk(WT_SESSION_IMPL *session) } } - queue->evict_current = queue->evict_queue; - __wt_spin_unlock(session, &queue->evict_lock); - - /* - * Now we can set the next queue. - */ - __wt_spin_lock(session, &cache->evict_queue_lock); - if (cache->evict_current_queue->evict_current == NULL) + if (__evict_queue_empty(queue)) { + /* + * This score varies between 0 (if the queue hasn't been empty + * for a long time) and 100 (if the queue has been empty the + * last 10 times we filled up. + */ + cache->evict_empty_score = WT_MIN(100, + cache->evict_empty_score + WT_EVICT_EMPTY_SCORE_BUMP); WT_STAT_FAST_CONN_INCR(session, cache_eviction_queue_empty); - else + } else WT_STAT_FAST_CONN_INCR(session, cache_eviction_queue_not_empty); - cache->evict_current_queue = queue; - __wt_spin_unlock(session, &cache->evict_queue_lock); + queue->evict_current = queue->evict_queue; + __wt_spin_unlock(session, &queue->evict_lock); /* * Signal any application or helper threads that may be waiting * to help with eviction. */ - WT_RET(__wt_cond_signal(session, cache->evict_waiter_cond)); + __wt_cond_signal(session, S2C(session)->evict_threads.wait_cond); return (0); } @@ -1049,16 +970,15 @@ __evict_lru_walk(WT_SESSION_IMPL *session) * Fill in the array by walking the next set of pages. */ static int -__evict_walk(WT_SESSION_IMPL *session, uint32_t queue_index) +__evict_walk(WT_SESSION_IMPL *session, WT_EVICT_QUEUE *queue) { WT_BTREE *btree; WT_CACHE *cache; WT_CONNECTION_IMPL *conn; WT_DATA_HANDLE *dhandle; WT_DECL_RET; - WT_EVICT_QUEUE *queue; u_int max_entries, prev_slot, retries, slot, start_slot, spins; - bool dhandle_locked, incr; + bool dhandle_locked, incr, progress; conn = S2C(session); cache = S2C(session)->cache; @@ -1071,7 +991,6 @@ __evict_walk(WT_SESSION_IMPL *session, uint32_t queue_index) * Set the starting slot in the queue and the maximum pages added * per walk. */ - queue = &cache->evict_queues[queue_index]; start_slot = slot = queue->evict_entries; max_entries = WT_MIN(slot + WT_EVICT_WALK_INCR, cache->evict_slots); @@ -1138,11 +1057,18 @@ retry: while (slot < max_entries && ret == 0) { continue; /* - * Also skip files that are checkpointing or configured to - * stick in cache until we get aggressive. + * Skip files that are checkpointing if we are only looking for + * dirty pages. + */ + if (btree->checkpointing != WT_CKPT_OFF && + !FLD_ISSET(cache->state, WT_EVICT_STATE_CLEAN)) + continue; + + /* + * Skip files that are configured to stick in cache until we + * become aggressive. */ - if ((btree->checkpointing != WT_CKPT_OFF || - btree->evict_priority != 0) && + if (btree->evict_priority != 0 && !FLD_ISSET(cache->state, WT_EVICT_STATE_AGGRESSIVE)) continue; @@ -1160,6 +1086,7 @@ retry: while (slot < max_entries && ret == 0) { continue; btree->evict_walk_skips = 0; prev_slot = slot; + progress = false; (void)__wt_atomic_addi32(&dhandle->session_inuse, 1); incr = true; @@ -1180,9 +1107,9 @@ retry: while (slot < max_entries && ret == 0) { !__wt_spin_trylock(session, &cache->evict_walk_lock)) { if (!F_ISSET(btree, WT_BTREE_NO_EVICTION)) { cache->evict_file_next = dhandle; - WT_WITH_DHANDLE(session, dhandle, - ret = __evict_walk_file(session, - queue_index, max_entries, &slot)); + WT_WITH_DHANDLE(session, dhandle, ret = + __evict_walk_file(session, queue, + max_entries, &slot, &progress)); WT_ASSERT(session, session->split_gen == 0); } __wt_spin_unlock(session, &cache->evict_walk_lock); @@ -1192,7 +1119,7 @@ retry: while (slot < max_entries && ret == 0) { * If we didn't find any candidates in the file, skip it next * time. */ - if (slot == prev_slot) + if (slot == prev_slot && !progress) btree->evict_walk_period = WT_MIN( WT_MAX(1, 2 * btree->evict_walk_period), 100); else @@ -1260,6 +1187,14 @@ __evict_push_candidate(WT_SESSION_IMPL *session, evict->btree = S2BT(session); evict->ref = ref; evict->score = __evict_read_gen(evict); + + /* Adjust for size when doing dirty eviction. */ + if (FLD_ISSET(S2C(session)->cache->state, WT_EVICT_STATE_DIRTY) && + evict->score != WT_READGEN_OLDEST && evict->score != UINT64_MAX && + !__wt_page_is_modified(ref->page)) + evict->score += WT_MEGABYTE - + WT_MIN(WT_MEGABYTE, ref->page->memory_footprint); + return (true); } @@ -1269,29 +1204,27 @@ __evict_push_candidate(WT_SESSION_IMPL *session, */ static int __evict_walk_file(WT_SESSION_IMPL *session, - uint32_t queue_index, u_int max_entries, u_int *slotp) + WT_EVICT_QUEUE *queue, u_int max_entries, u_int *slotp, bool *progressp) { WT_BTREE *btree; WT_CACHE *cache; WT_CONNECTION_IMPL *conn; WT_DECL_RET; WT_EVICT_ENTRY *end, *evict, *start; - WT_EVICT_QUEUE *queue; WT_PAGE *page; WT_PAGE_MODIFY *mod; WT_REF *ref; uint64_t btree_inuse, bytes_per_slot, cache_inuse; uint64_t pages_seen, refs_walked; - uint32_t remaining_slots, target_pages, total_slots, walk_flags; + uint32_t remaining_slots, total_slots, walk_flags; + uint32_t target_pages_clean, target_pages_dirty, target_pages; int internal_pages, restarts; - bool enough, modified; + bool modified; conn = S2C(session); btree = S2BT(session); cache = conn->cache; - queue = &cache->evict_queues[queue_index]; internal_pages = restarts = 0; - enough = false; /* * Figure out how many slots to fill from this tree. @@ -1299,8 +1232,6 @@ __evict_walk_file(WT_SESSION_IMPL *session, */ start = queue->evict_queue + *slotp; remaining_slots = max_entries - *slotp; - btree_inuse = __wt_btree_bytes_inuse(session); - cache_inuse = __wt_cache_bytes_inuse(cache); total_slots = max_entries - queue->evict_entries; /* @@ -1309,24 +1240,34 @@ __evict_walk_file(WT_SESSION_IMPL *session, * slots so we assign all of the slots to a tree filling 99+% of the * cache (and only have to walk it once). */ - bytes_per_slot = cache_inuse / total_slots; - target_pages = (uint32_t)( - (btree_inuse + bytes_per_slot / 2) / bytes_per_slot); + if (FLD_ISSET(cache->state, WT_EVICT_STATE_CLEAN)) { + btree_inuse = __wt_btree_bytes_inuse(session); + cache_inuse = __wt_cache_bytes_inuse(cache); + bytes_per_slot = 1 + cache_inuse / total_slots; + target_pages_clean = (uint32_t)( + (btree_inuse + bytes_per_slot / 2) / bytes_per_slot); + } else + target_pages_clean = 0; + + if (FLD_ISSET(cache->state, WT_EVICT_STATE_DIRTY)) { + btree_inuse = __wt_btree_dirty_leaf_inuse(session); + cache_inuse = __wt_cache_dirty_leaf_inuse(cache); + bytes_per_slot = 1 + cache_inuse / total_slots; + target_pages_dirty = (uint32_t)( + (btree_inuse + bytes_per_slot / 2) / bytes_per_slot); + } else + target_pages_dirty = 0; + + target_pages = WT_MAX(target_pages_clean, target_pages_dirty); + if (target_pages == 0) { /* * Randomly walk trees with a tiny fraction of the cache in * case there are so many trees that none of them use enough of - * the cache to be allocated slots. - * - * Map a random number into the range [0..1], and if the result - * is greater than the fraction of the cache used by this tree, - * give up. In other words, there is a small chance we will - * visit trees that use a small fraction of the cache. Arrange - * this calculation to avoid overflow (e.g., don't multiply - * anything by UINT32_MAX). + * the cache to be allocated slots. Walk small trees 1% of the + * time. */ - if (__wt_random(&session->rnd) / (double)UINT32_MAX > - btree_inuse / (double)cache_inuse) + if (__wt_random(&session->rnd) > UINT32_MAX / 100) return (0); target_pages = 10; } @@ -1354,12 +1295,11 @@ __evict_walk_file(WT_SESSION_IMPL *session, * case we are appending and only the last page in the file is live. */ for (evict = start, pages_seen = refs_walked = 0; - evict < end && !enough && (ret == 0 || ret == WT_NOTFOUND); + evict < end && (ret == 0 || ret == WT_NOTFOUND); ret = __wt_tree_walk_count( session, &btree->evict_ref, &refs_walked, walk_flags)) { - enough = refs_walked > cache->evict_max_refs_per_file; if ((ref = btree->evict_ref) == NULL) { - if (++restarts == 2 || enough) + if (++restarts == 2) break; WT_STAT_FAST_CONN_INCR( session, cache_eviction_walks_started); @@ -1392,10 +1332,13 @@ __evict_walk_file(WT_SESSION_IMPL *session, __wt_cache_read_gen_new(session, page); /* Pages we no longer need (clean or dirty), are found money. */ - if (page->read_gen == WT_READGEN_OLDEST) { + if (page->read_gen == WT_READGEN_OLDEST || + page->memory_footprint >= btree->splitmempage) { WT_STAT_FAST_CONN_INCR( session, cache_eviction_pages_queued_oldest); - goto fast; + if (__wt_page_evict_urgent(session, ref)) + *progressp = true; + continue; } if (__wt_page_is_empty(page) || @@ -1417,35 +1360,22 @@ __evict_walk_file(WT_SESSION_IMPL *session, internal_pages >= (int)(evict - start) / 2) continue; -fast: /* If the page can't be evicted, give up. */ - if (!__wt_page_can_evict(session, ref, NULL)) - continue; - /* - * Note: take care with ordering: if we detected that - * the page is modified above, we expect mod != NULL. + * If the oldest transaction hasn't changed since the last time + * this page was written, it's unlikely we can make progress. + * Similarly, if the most recent update on the page is not yet + * globally visible, eviction will fail. These heuristics + * attempt to avoid repeated attempts to evict the same page. */ mod = page->modify; + if (modified && + (mod->last_oldest_id == __wt_txn_oldest_id(session) || + !__wt_txn_visible_all(session, mod->update_txn))) + continue; - /* - * Additional tests if eviction is likely to succeed. - * - * If eviction is stuck or we are helping with forced eviction, - * try anyway: maybe a transaction that was running last time - * we wrote the page has since rolled back, or we can help the - * checkpoint complete sooner. Additionally, being stuck will - * configure lookaside table writes in reconciliation, allowing - * us to evict pages we can't usually evict. - */ - if (!FLD_ISSET(cache->state, WT_EVICT_STATE_AGGRESSIVE)) { - /* - * If the page is clean but has modifications that - * appear too new to evict, skip it. - */ - if (!modified && mod != NULL && - !__wt_txn_visible_all(session, mod->rec_max_txn)) - continue; - } +fast: /* If the page can't be evicted, give up. */ + if (!__wt_page_can_evict(session, ref, NULL)) + continue; WT_ASSERT(session, evict->ref == NULL); if (!__evict_push_candidate(session, queue, evict, ref)) @@ -1455,8 +1385,8 @@ fast: /* If the page can't be evicted, give up. */ if (WT_PAGE_IS_INTERNAL(page)) ++internal_pages; - WT_RET(__wt_verbose(session, WT_VERB_EVICTSERVER, - "select: %p, size %" PRIu64, page, page->memory_footprint)); + __wt_verbose(session, WT_VERB_EVICTSERVER, + "select: %p, size %" PRIu64, page, page->memory_footprint); } WT_RET_NOTFOUND_OK(ret); @@ -1538,30 +1468,67 @@ __evict_get_ref( WT_SESSION_IMPL *session, bool is_server, WT_BTREE **btreep, WT_REF **refp) { WT_CACHE *cache; + WT_DECL_RET; WT_EVICT_ENTRY *evict; - WT_EVICT_QUEUE *queue, *urgent_queue; + WT_EVICT_QUEUE *other_queue, *queue, *urgent_queue; uint32_t candidates; + bool is_app, urgent_ok; cache = S2C(session)->cache; - urgent_queue = &cache->evict_queues[WT_EVICT_URGENT_QUEUE]; + is_app = !F_ISSET(session, WT_SESSION_INTERNAL); + urgent_ok = (!is_app && !is_server) || + !WT_EVICT_HAS_WORKERS(session) || + FLD_ISSET(cache->state, WT_EVICT_STATE_AGGRESSIVE); + urgent_queue = cache->evict_urgent_queue; *btreep = NULL; *refp = NULL; - /* Avoid the LRU lock if no pages are available. */ WT_STAT_FAST_CONN_INCR(session, cache_eviction_get_ref); - if (cache->evict_current_queue->evict_current == NULL && - urgent_queue->evict_current == NULL) { + + /* Avoid the LRU lock if no pages are available. */ + if (__evict_queue_empty(cache->evict_current_queue) && + __evict_queue_empty(cache->evict_other_queue) && + __evict_queue_empty(urgent_queue)) { WT_STAT_FAST_CONN_INCR(session, cache_eviction_get_ref_empty); return (WT_NOTFOUND); } - __wt_spin_lock(session, &cache->evict_queue_lock); + /* + * The server repopulates whenever the other queue is not full. + * + * Note that there are pathological cases where there are only enough + * eviction candidates in the cache to fill one queue. In that case, + * we will continually evict one page and attempt to refill the queues. + * Such cases are extremely rare in real applications. + */ + if (is_server && + (cache->evict_empty_score > WT_EVICT_EMPTY_SCORE_CUTOFF || + __evict_queue_empty(cache->evict_fill_queue))) { + do { + if ((!urgent_ok || + __evict_queue_empty(urgent_queue)) && + !__evict_queue_full(cache->evict_fill_queue)) + return (WT_NOTFOUND); + } while ((ret = __wt_spin_trylock( + session, &cache->evict_queue_lock)) == EBUSY); + + WT_RET(ret); + } else + __wt_spin_lock(session, &cache->evict_queue_lock); + + /* + * Check if the current queue needs to change. + * The current queue could have changed while we waited for the lock. + */ + queue = cache->evict_current_queue; + other_queue = cache->evict_other_queue; + if (__evict_queue_empty(queue) && !__evict_queue_empty(other_queue)) { + cache->evict_current_queue = other_queue; + cache->evict_other_queue = queue; + } /* Check the urgent queue first. */ - queue = urgent_queue->evict_current != NULL && - (FLD_ISSET(cache->state, WT_EVICT_STATE_AGGRESSIVE) || - (F_ISSET(session, WT_SESSION_INTERNAL) && - (!is_server || S2C(session)->evict_workers <= 1))) ? + queue = urgent_ok && !__evict_queue_empty(urgent_queue) ? urgent_queue : cache->evict_current_queue; __wt_spin_unlock(session, &cache->evict_queue_lock); @@ -1581,7 +1548,7 @@ __evict_get_ref( */ for (;;) { /* Verify there are still pages available. */ - if (queue->evict_current == NULL || (uint32_t) + if (__evict_queue_empty(queue) || (uint32_t) (queue->evict_current - queue->evict_queue) >= candidates) { WT_STAT_FAST_CONN_INCR( session, cache_eviction_get_ref_empty2); @@ -1612,14 +1579,24 @@ __evict_get_ref( * However, we can't skip entries in the urgent queue or they * may never be found again. */ - if (is_server && queue != urgent_queue && - S2C(session)->evict_workers > 1 && + if (is_server && !urgent_ok && !__evict_check_entry_size(session, evict)) { --evict; break; } /* + * Don't force application threads to evict dirty pages if they + * aren't stalled by the amount of dirty data in cache. + */ + if (is_app && !urgent_ok && + !FLD_ISSET(cache->state, WT_EVICT_STATE_DIRTY_HARD) && + __wt_page_is_modified(evict->ref->page)) { + --evict; + break; + } + + /* * Lock the page while holding the eviction mutex to prevent * multiple attempts to evict it. For pages that are already * being evicted, this operation will fail and we will move on. @@ -1656,7 +1633,7 @@ __evict_get_ref( __wt_spin_unlock(session, &queue->evict_lock); - return ((*refp == NULL) ? WT_NOTFOUND : 0); + return (*refp == NULL ? WT_NOTFOUND : 0); } /* @@ -1733,6 +1710,13 @@ __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full) cache = conn->cache; /* + * It is not safe to proceed if the eviction server threads aren't + * setup yet. + */ + if (!conn->evict_server_running) + return (0); + + /* * If the current transaction is keeping the oldest ID pinned, it is in * the middle of an operation. This may prevent the oldest ID from * moving forward, leading to deadlock, so only evict what we can. @@ -1753,7 +1737,7 @@ __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full) txn_busy = true; /* Wake the eviction server if we need to do work. */ - WT_RET(__wt_evict_server_wake(session)); + __wt_evict_server_wake(session); /* * If we're busy, either because of the transaction check we just did, @@ -1795,8 +1779,8 @@ __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full) break; case WT_NOTFOUND: /* Allow the queue to re-populate before retrying. */ - WT_RET(__wt_cond_wait( - session, cache->evict_waiter_cond, 100000)); + __wt_cond_wait( + session, conn->evict_threads.wait_cond, 100000); cache->app_waits++; break; default: @@ -1812,11 +1796,11 @@ __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full) } /* - * __wt_page_evict_soon -- + * __wt_page_evict_urgent -- * Set a page to be evicted as soon as possible. */ -int -__wt_page_evict_soon(WT_SESSION_IMPL *session, WT_REF *ref) +bool +__wt_page_evict_urgent(WT_SESSION_IMPL *session, WT_REF *ref) { WT_CACHE *cache; WT_EVICT_ENTRY *evict; @@ -1828,10 +1812,9 @@ __wt_page_evict_soon(WT_SESSION_IMPL *session, WT_REF *ref) WT_ASSERT(session, !__wt_ref_is_root(ref)); page = ref->page; - page->read_gen = WT_READGEN_OLDEST; if (F_ISSET_ATOMIC(page, WT_PAGE_EVICT_LRU) || F_ISSET(S2BT(session), WT_BTREE_NO_EVICTION)) - return (0); + return (false); /* Append to the urgent queue if we can. */ cache = S2C(session)->cache; @@ -1844,12 +1827,12 @@ __wt_page_evict_soon(WT_SESSION_IMPL *session, WT_REF *ref) goto done; __wt_spin_lock(session, &urgent_queue->evict_lock); - if (urgent_queue->evict_current == NULL) { + if (__evict_queue_empty(urgent_queue)) { urgent_queue->evict_current = urgent_queue->evict_queue; urgent_queue->evict_candidates = 0; } evict = urgent_queue->evict_queue + urgent_queue->evict_candidates; - if (evict < urgent_queue->evict_queue + WT_EVICT_QUEUE_MAX && + if (evict < urgent_queue->evict_queue + cache->evict_slots && __evict_push_candidate(session, urgent_queue, evict, ref)) { ++urgent_queue->evict_candidates; queued = true; @@ -1860,13 +1843,14 @@ done: __wt_spin_unlock(session, &cache->evict_queue_lock); if (queued) { WT_STAT_FAST_CONN_INCR( session, cache_eviction_pages_queued_urgent); - if (S2C(session)->evict_workers > 1) - WT_RET(__wt_cond_signal( - session, cache->evict_waiter_cond)); + if (WT_EVICT_HAS_WORKERS(session)) + __wt_cond_signal(session, + S2C(session)->evict_threads.wait_cond); else - WT_RET(__wt_evict_server_wake(session)); + __wt_evict_server_wake(session); } - return (0); + + return (queued); } /* @@ -2013,9 +1997,8 @@ __wt_cache_dump(WT_SESSION_IMPL *session, const char *ofile) * Apply the overhead percentage so our total bytes are comparable with * the tracked value. */ - if (conn->cache->overhead_pct != 0) - total_bytes += - (total_bytes * (uint64_t)conn->cache->overhead_pct) / 100; + total_bytes = __wt_cache_bytes_plus_overhead(conn->cache, total_bytes); + (void)fprintf(fp, "cache dump: " "total found = %" PRIu64 "MB vs tracked inuse %" PRIu64 "MB\n" diff --git a/src/third_party/wiredtiger/src/evict/evict_page.c b/src/third_party/wiredtiger/src/evict/evict_page.c index d4c4e3e311a..972c72bbfb0 100644 --- a/src/third_party/wiredtiger/src/evict/evict_page.c +++ b/src/third_party/wiredtiger/src/evict/evict_page.c @@ -74,7 +74,7 @@ __wt_page_release_evict(WT_SESSION_IMPL *session, WT_REF *ref) (void)__wt_atomic_addv32(&btree->evict_busy, 1); - too_big = page->memory_footprint > btree->splitmempage; + too_big = page->memory_footprint >= btree->splitmempage; if ((ret = __wt_evict(session, ref, false)) == 0) { if (too_big) WT_STAT_FAST_CONN_INCR(session, cache_eviction_force); @@ -116,8 +116,8 @@ __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool closing) page = ref->page; tree_dead = F_ISSET(session->dhandle, WT_DHANDLE_DEAD); - WT_RET(__wt_verbose(session, WT_VERB_EVICT, - "page %p (%s)", page, __wt_page_type_string(page->type))); + __wt_verbose(session, WT_VERB_EVICT, + "page %p (%s)", page, __wt_page_type_string(page->type)); /* * Get exclusive access to the page and review it for conditions that @@ -527,7 +527,9 @@ __evict_review( else if (F_ISSET(cache, WT_CACHE_STUCK)) LF_SET(WT_EVICT_LOOKASIDE); else if (!__wt_txn_visible_all( - session, page->modify->update_txn)) + session, page->modify->update_txn) || + page->read_gen == WT_READGEN_OLDEST || + page->memory_footprint >= S2BT(session)->splitmempage) LF_SET(WT_EVICT_UPDATE_RESTORE); /* diff --git a/src/third_party/wiredtiger/src/include/api.h b/src/third_party/wiredtiger/src/include/api.h index 0a4593178dc..e1b2f8edaf3 100644 --- a/src/third_party/wiredtiger/src/include/api.h +++ b/src/third_party/wiredtiger/src/include/api.h @@ -17,7 +17,7 @@ #define API_CALL_NOCONF(s, h, n, cur, dh) do { \ API_SESSION_INIT(s, h, n, cur, dh); \ WT_ERR(WT_SESSION_CHECK_PANIC(s)); \ - WT_ERR(__wt_verbose((s), WT_VERB_API, "CALL: " #h ":" #n)) + __wt_verbose((s), WT_VERB_API, "CALL: " #h ":" #n) #define API_CALL(s, h, n, cur, dh, config, cfg) do { \ const char *cfg[] = \ @@ -27,7 +27,7 @@ if ((config) != NULL) \ WT_ERR(__wt_config_check((s), \ WT_CONFIG_REF(session, h##_##n), (config), 0)); \ - WT_ERR(__wt_verbose((s), WT_VERB_API, "CALL: " #h ":" #n)) + __wt_verbose((s), WT_VERB_API, "CALL: " #h ":" #n) #define API_END(s, ret) \ if ((s) != NULL) { \ diff --git a/src/third_party/wiredtiger/src/include/btmem.h b/src/third_party/wiredtiger/src/include/btmem.h index 817ce892952..a9d190c3b09 100644 --- a/src/third_party/wiredtiger/src/include/btmem.h +++ b/src/third_party/wiredtiger/src/include/btmem.h @@ -584,9 +584,10 @@ struct __wt_page { /* * Used to protect and co-ordinate splits for internal pages and - * reconciliation for all pages. + * reconciliation for all pages. Only used to co-ordinate among the + * uncommon cases that require exclusive access to a page. */ - WT_FAIR_LOCK page_lock; + WT_RWLOCK page_lock; /* * The page's read generation acts as an LRU value for each page in the diff --git a/src/third_party/wiredtiger/src/include/btree.h b/src/third_party/wiredtiger/src/include/btree.h index 432474f9dc1..f1365c6c933 100644 --- a/src/third_party/wiredtiger/src/include/btree.h +++ b/src/third_party/wiredtiger/src/include/btree.h @@ -131,6 +131,7 @@ struct __wt_btree { uint64_t write_gen; /* Write generation */ uint64_t bytes_inmem; /* Cache bytes in memory. */ + uint64_t bytes_dirty_leaf; /* Bytes in dirty leaf pages. */ WT_REF *evict_ref; /* Eviction thread's location */ uint64_t evict_priority; /* Relative priority of cached pages */ diff --git a/src/third_party/wiredtiger/src/include/btree.i b/src/third_party/wiredtiger/src/include/btree.i index 3234ad1ed41..1ca6426eef6 100644 --- a/src/third_party/wiredtiger/src/include/btree.i +++ b/src/third_party/wiredtiger/src/include/btree.i @@ -61,18 +61,29 @@ __wt_btree_block_free( static inline uint64_t __wt_btree_bytes_inuse(WT_SESSION_IMPL *session) { + WT_BTREE *btree; WT_CACHE *cache; - uint64_t bytes_inuse; + btree = S2BT(session); cache = S2C(session)->cache; - /* Adjust the cache size to take allocation overhead into account. */ - bytes_inuse = S2BT(session)->bytes_inmem; - if (cache->overhead_pct != 0) - bytes_inuse += - (bytes_inuse * (uint64_t)cache->overhead_pct) / 100; + return (__wt_cache_bytes_plus_overhead(cache, btree->bytes_inmem)); +} + +/* + * __wt_btree_dirty_leaf_inuse -- + * Return the number of bytes in use by dirty leaf pages. + */ +static inline uint64_t +__wt_btree_dirty_leaf_inuse(WT_SESSION_IMPL *session) +{ + WT_BTREE *btree; + WT_CACHE *cache; + + btree = S2BT(session); + cache = S2C(session)->cache; - return (bytes_inuse); + return (__wt_cache_bytes_plus_overhead(cache, btree->bytes_dirty_leaf)); } /* @@ -82,18 +93,24 @@ __wt_btree_bytes_inuse(WT_SESSION_IMPL *session) static inline void __wt_cache_page_inmem_incr(WT_SESSION_IMPL *session, WT_PAGE *page, size_t size) { + WT_BTREE *btree; WT_CACHE *cache; WT_ASSERT(session, size < WT_EXABYTE); - + btree = S2BT(session); cache = S2C(session)->cache; - (void)__wt_atomic_add64(&S2BT(session)->bytes_inmem, size); + + (void)__wt_atomic_add64(&btree->bytes_inmem, size); (void)__wt_atomic_add64(&cache->bytes_inmem, size); (void)__wt_atomic_addsize(&page->memory_footprint, size); if (__wt_page_is_modified(page)) { (void)__wt_atomic_addsize(&page->modify->bytes_dirty, size); - (void)__wt_atomic_add64(WT_PAGE_IS_INTERNAL(page) ? - &cache->bytes_dirty_intl : &cache->bytes_dirty_leaf, size); + if (WT_PAGE_IS_INTERNAL(page)) + (void)__wt_atomic_add64(&cache->bytes_dirty_intl, size); + else { + (void)__wt_atomic_add64(&cache->bytes_dirty_leaf, size); + (void)__wt_atomic_add64(&btree->bytes_dirty_leaf, size); + } } /* Track internal size in cache. */ if (WT_PAGE_IS_INTERNAL(page)) @@ -157,6 +174,22 @@ __wt_cache_decr_check_uint64( } /* + * __wt_cache_decr_zero_uint64 -- + * Decrement a uint64_t cache value and zero it on underflow. + */ +static inline void +__wt_cache_decr_zero_uint64( + WT_SESSION_IMPL *session, uint64_t *vp, size_t v, const char *fld) +{ + if (__wt_atomic_sub64(vp, v) < WT_EXABYTE) + return; + + __wt_errx( + session, "%s went negative: decrementing %" WT_SIZET_FMT, fld, v); + *vp = 0; +} + +/* * __wt_cache_page_byte_dirty_decr -- * Decrement the page's dirty byte count, guarding from underflow. */ @@ -164,17 +197,14 @@ static inline void __wt_cache_page_byte_dirty_decr( WT_SESSION_IMPL *session, WT_PAGE *page, size_t size) { + WT_BTREE *btree; WT_CACHE *cache; - const char *destname; - uint64_t *dest; size_t decr, orig; int i; + btree = S2BT(session); cache = S2C(session)->cache; - dest = WT_PAGE_IS_INTERNAL(page) ? - &cache->bytes_dirty_intl : &cache->bytes_dirty_leaf; - destname = WT_PAGE_IS_INTERNAL(page) ? - "WT_CACHE.bytes_dirty_intl" : "WT_CACHE.bytes_dirty_leaf"; + decr = 0; /* [-Wconditional-uninitialized] */ /* * We don't have exclusive access and there are ways of decrementing the @@ -201,11 +231,21 @@ __wt_cache_page_byte_dirty_decr( orig = page->modify->bytes_dirty; decr = WT_MIN(size, orig); if (__wt_atomic_cassize( - &page->modify->bytes_dirty, orig, orig - decr)) { - __wt_cache_decr_check_uint64( - session, dest, decr, destname); + &page->modify->bytes_dirty, orig, orig - decr)) break; - } + } + + if (i == 5) + return; + + if (WT_PAGE_IS_INTERNAL(page)) + __wt_cache_decr_check_uint64(session, &cache->bytes_dirty_intl, + decr, "WT_CACHE.bytes_dirty_intl"); + else { + __wt_cache_decr_check_uint64(session, &btree->bytes_dirty_leaf, + decr, "WT_BTREE.bytes_dirty_leaf"); + __wt_cache_decr_check_uint64(session, &cache->bytes_dirty_leaf, + decr, "WT_CACHE.bytes_dirty_leaf"); } } @@ -244,20 +284,26 @@ __wt_cache_page_inmem_decr(WT_SESSION_IMPL *session, WT_PAGE *page, size_t size) static inline void __wt_cache_dirty_incr(WT_SESSION_IMPL *session, WT_PAGE *page) { + WT_BTREE *btree; WT_CACHE *cache; size_t size; + btree = S2BT(session); cache = S2C(session)->cache; - (void)__wt_atomic_add64(WT_PAGE_IS_INTERNAL(page) ? - &cache->pages_dirty_intl : &cache->pages_dirty_leaf, 1); /* * Take care to read the memory_footprint once in case we are racing * with updates. */ size = page->memory_footprint; - (void)__wt_atomic_add64(WT_PAGE_IS_INTERNAL(page) ? - &cache->bytes_dirty_intl : &cache->bytes_dirty_leaf, size); + if (WT_PAGE_IS_INTERNAL(page)) { + (void)__wt_atomic_add64(&cache->bytes_dirty_intl, size); + (void)__wt_atomic_add64(&cache->pages_dirty_intl, 1); + } else { + (void)__wt_atomic_add64(&btree->bytes_dirty_leaf, size); + (void)__wt_atomic_add64(&cache->bytes_dirty_leaf, size); + (void)__wt_atomic_add64(&cache->pages_dirty_leaf, 1); + } (void)__wt_atomic_addsize(&page->modify->bytes_dirty, size); } @@ -271,19 +317,15 @@ __wt_cache_dirty_decr(WT_SESSION_IMPL *session, WT_PAGE *page) { WT_CACHE *cache; WT_PAGE_MODIFY *modify; - uint64_t *pages_dirty; cache = S2C(session)->cache; - pages_dirty = WT_PAGE_IS_INTERNAL(page) ? - &cache->pages_dirty_intl : &cache->pages_dirty_leaf; - if (*pages_dirty < 1) { - __wt_errx(session, - "cache eviction dirty-page decrement failed: dirty page" - "count went negative"); - *pages_dirty = 0; - } else - (void)__wt_atomic_sub64(pages_dirty, 1); + if (WT_PAGE_IS_INTERNAL(page)) + __wt_cache_decr_zero_uint64(session, + &cache->pages_dirty_intl, 1, "dirty internal page count"); + else + __wt_cache_decr_zero_uint64(session, + &cache->pages_dirty_leaf, 1, "dirty leaf page count"); modify = page->modify; if (modify != NULL && modify->bytes_dirty != 0) @@ -326,16 +368,12 @@ __wt_cache_page_image_incr(WT_SESSION_IMPL *session, uint32_t size) static inline void __wt_cache_page_evict(WT_SESSION_IMPL *session, WT_PAGE *page) { + WT_BTREE *btree; WT_CACHE *cache; WT_PAGE_MODIFY *modify; - uint64_t *dest; - const char *destname; + btree = S2BT(session); cache = S2C(session)->cache; - dest = WT_PAGE_IS_INTERNAL(page) ? - &cache->bytes_dirty_intl : &cache->bytes_dirty_leaf; - destname = WT_PAGE_IS_INTERNAL(page) ? - "WT_CACHE.bytes_dirty_intl" : "WT_CACHE.bytes_dirty_leaf"; modify = page->modify; /* Update the bytes in-memory to reflect the eviction. */ @@ -352,14 +390,18 @@ __wt_cache_page_evict(WT_SESSION_IMPL *session, WT_PAGE *page) /* Update the cache's dirty-byte count. */ if (modify != NULL && modify->bytes_dirty != 0) { - if ((size_t)*dest < modify->bytes_dirty) { - __wt_errx(session, - "%s decrement failed: " - "dirty byte count went negative", destname); - *dest = 0; - } else - __wt_cache_decr_check_uint64(session, dest, - modify->bytes_dirty, destname); + if (WT_PAGE_IS_INTERNAL(page)) + __wt_cache_decr_zero_uint64(session, + &cache->bytes_dirty_intl, + modify->bytes_dirty, "WT_CACHE.bytes_dirty_intl"); + else { + __wt_cache_decr_zero_uint64(session, + &cache->bytes_dirty_leaf, + modify->bytes_dirty, "WT_CACHE.bytes_dirty_leaf"); + __wt_cache_decr_zero_uint64(session, + &btree->bytes_dirty_leaf, + modify->bytes_dirty, "WT_BTREE.bytes_dirty_leaf"); + } } /* Update pages and bytes evicted. */ @@ -1190,7 +1232,7 @@ __wt_page_can_evict( * previous version might be referenced by an internal page already * been written in the checkpoint, leaving the checkpoint inconsistent. */ - if (btree->checkpointing != WT_CKPT_OFF && modified) { + if (modified && btree->checkpointing != WT_CKPT_OFF) { WT_STAT_FAST_CONN_INCR(session, cache_eviction_checkpoint); WT_STAT_FAST_DATA_INCR(session, cache_eviction_checkpoint); return (false); @@ -1217,20 +1259,12 @@ __wt_page_can_evict( F_ISSET_ATOMIC(page, WT_PAGE_SPLIT_BLOCK)) return (false); - /* If the cache is stuck, try anything else. */ - if (F_ISSET(S2C(session)->cache, WT_CACHE_STUCK)) - return (true); - /* - * If the oldest transaction hasn't changed since the last time - * this page was written, it's unlikely we can make progress. - * Similarly, if the most recent update on the page is not yet - * globally visible, eviction will fail. These heuristics - * attempt to avoid repeated attempts to evict the same page. + * If the page is clean but has modifications that + * appear too new to evict, skip it. */ - if (modified && - (mod->last_oldest_id == __wt_txn_oldest_id(session) || - !__wt_txn_visible_all(session, mod->update_txn))) + if (!modified && mod != NULL && + !__wt_txn_visible_all(session, mod->rec_max_txn)) return (false); return (true); diff --git a/src/third_party/wiredtiger/src/include/buf.i b/src/third_party/wiredtiger/src/include/buf.i index 95d945ec6d3..ebbee6b4633 100644 --- a/src/third_party/wiredtiger/src/include/buf.i +++ b/src/third_party/wiredtiger/src/include/buf.i @@ -76,7 +76,8 @@ __wt_buf_set( WT_RET(__wt_buf_initsize(session, buf, size)); /* Copy the data, allowing for overlapping strings. */ - memmove(buf->mem, data, size); + if (size != 0) + memmove(buf->mem, data, size); return (0); } diff --git a/src/third_party/wiredtiger/src/include/cache.h b/src/third_party/wiredtiger/src/include/cache.h index e3a003ccc56..c7e817fd391 100644 --- a/src/third_party/wiredtiger/src/include/cache.h +++ b/src/third_party/wiredtiger/src/include/cache.h @@ -26,8 +26,8 @@ struct __wt_evict_entry { uint64_t score; /* Relative eviction priority */ }; -#define WT_EVICT_URGENT_QUEUE 0 /* Urgent queue index */ -#define WT_EVICT_QUEUE_MAX 3 /* Urgent plus two ordinary queues */ +#define WT_EVICT_QUEUE_MAX 3 /* Two ordinary queues plus urgent */ +#define WT_EVICT_URGENT_QUEUE 2 /* Urgent queue index */ /* * WT_EVICT_QUEUE -- @@ -42,18 +42,6 @@ struct __wt_evict_queue { volatile uint32_t evict_max; /* LRU maximum eviction slot used */ }; -/* - * WT_EVICT_WORKER -- - * Encapsulation of an eviction worker thread. - */ -struct __wt_evict_worker { - WT_SESSION_IMPL *session; - u_int id; - wt_thread_t tid; -#define WT_EVICT_WORKER_RUN 0x01 - uint32_t flags; -}; - /* Cache operations. */ typedef enum __wt_cache_op { WT_SYNC_CHECKPOINT, @@ -109,8 +97,6 @@ struct __wt_cache { */ WT_CONDVAR *evict_cond; /* Eviction server condition */ WT_SPINLOCK evict_walk_lock; /* Eviction walk location */ - /* Condition signalled when the eviction server populates the queue */ - WT_CONDVAR *evict_waiter_cond; u_int eviction_trigger; /* Percent to trigger eviction */ u_int eviction_target; /* Percent to end eviction */ @@ -124,14 +110,19 @@ struct __wt_cache { */ WT_SPINLOCK evict_pass_lock; /* Eviction pass lock */ WT_SESSION_IMPL *walk_session; /* Eviction pass session */ + WT_DATA_HANDLE + *evict_file_next; /* LRU next file to search */ WT_SPINLOCK evict_queue_lock; /* Eviction current queue lock */ WT_EVICT_QUEUE evict_queues[WT_EVICT_QUEUE_MAX]; - WT_EVICT_QUEUE *evict_current_queue;/* LRU current queue in use */ - uint32_t evict_queue_fill; /* LRU eviction queue index to fill */ + WT_EVICT_QUEUE *evict_current_queue; /* LRU current queue in use */ + WT_EVICT_QUEUE *evict_fill_queue; /* LRU next queue to fill */ + WT_EVICT_QUEUE *evict_other_queue; /* LRU queue not in use */ + WT_EVICT_QUEUE *evict_urgent_queue; /* LRU urgent queue */ uint32_t evict_slots; /* LRU list eviction slots */ - WT_DATA_HANDLE - *evict_file_next; /* LRU next file to search */ - uint32_t evict_max_refs_per_file;/* LRU pages per file per pass */ +#define WT_EVICT_EMPTY_SCORE_BUMP 10 +#define WT_EVICT_EMPTY_SCORE_CUTOFF 10 + uint32_t evict_empty_score; /* LRU score of how often queues are + empty on refill. */ /* * Cache pool information. @@ -153,15 +144,17 @@ struct __wt_cache { #define WT_EVICT_STATE_AGGRESSIVE 0x01 /* Eviction isn't making progress: try harder */ #define WT_EVICT_STATE_CLEAN 0x02 /* Evict clean pages */ -#define WT_EVICT_STATE_DIRTY 0x04 /* Evict dirty pages */ -#define WT_EVICT_STATE_SCRUB 0x08 /* Scrub dirty pages pages */ -#define WT_EVICT_STATE_URGENT 0x10 /* Pages are in the urgent queue */ +#define WT_EVICT_STATE_CLEAN_HARD 0x04 /* Clean % blocking app threads */ +#define WT_EVICT_STATE_DIRTY 0x08 /* Evict dirty pages */ +#define WT_EVICT_STATE_DIRTY_HARD 0x10 /* Dirty % blocking app threads */ +#define WT_EVICT_STATE_SCRUB 0x20 /* Scrub dirty pages pages */ +#define WT_EVICT_STATE_URGENT 0x40 /* Pages are in the urgent queue */ #define WT_EVICT_STATE_ALL (WT_EVICT_STATE_CLEAN | WT_EVICT_STATE_DIRTY) uint32_t state; /* * Pass interrupt counter. */ - uint32_t pass_intr; /* Interrupt eviction pass. */ + volatile uint32_t pass_intr; /* Interrupt eviction pass. */ /* * Flags. diff --git a/src/third_party/wiredtiger/src/include/cache.i b/src/third_party/wiredtiger/src/include/cache.i index b5cb79afb3c..155b1a7ab3d 100644 --- a/src/third_party/wiredtiger/src/include/cache.i +++ b/src/third_party/wiredtiger/src/include/cache.i @@ -68,6 +68,18 @@ __wt_cache_read_gen_new(WT_SESSION_IMPL *session, WT_PAGE *page) } /* + * __wt_page_evict_soon -- + * Set a page to be evicted as soon as possible. + */ +static inline void +__wt_page_evict_soon(WT_SESSION_IMPL *session, WT_REF *ref) +{ + WT_UNUSED(session); + + ref->page->read_gen = WT_READGEN_OLDEST; +} + +/* * __wt_cache_pages_inuse -- * Return the number of pages in use. */ @@ -78,21 +90,26 @@ __wt_cache_pages_inuse(WT_CACHE *cache) } /* + * __wt_cache_bytes_plus_overhead -- + * Apply the cache overhead to a size in bytes. + */ +static inline uint64_t +__wt_cache_bytes_plus_overhead(WT_CACHE *cache, uint64_t sz) +{ + if (cache->overhead_pct != 0) + sz += (sz * (uint64_t)cache->overhead_pct) / 100; + + return (sz); +} + +/* * __wt_cache_bytes_inuse -- * Return the number of bytes in use. */ static inline uint64_t __wt_cache_bytes_inuse(WT_CACHE *cache) { - uint64_t bytes_inuse; - - /* Adjust the cache size to take allocation overhead into account. */ - bytes_inuse = cache->bytes_inmem; - if (cache->overhead_pct != 0) - bytes_inuse += - (bytes_inuse * (uint64_t)cache->overhead_pct) / 100; - - return (bytes_inuse); + return (__wt_cache_bytes_plus_overhead(cache, cache->bytes_inmem)); } /* @@ -102,14 +119,8 @@ __wt_cache_bytes_inuse(WT_CACHE *cache) static inline uint64_t __wt_cache_dirty_inuse(WT_CACHE *cache) { - uint64_t dirty_inuse; - - dirty_inuse = cache->bytes_dirty_intl + cache->bytes_dirty_leaf; - if (cache->overhead_pct != 0) - dirty_inuse += - (dirty_inuse * (uint64_t)cache->overhead_pct) / 100; - - return (dirty_inuse); + return (__wt_cache_bytes_plus_overhead(cache, + cache->bytes_dirty_intl + cache->bytes_dirty_leaf)); } /* @@ -119,14 +130,7 @@ __wt_cache_dirty_inuse(WT_CACHE *cache) static inline uint64_t __wt_cache_dirty_leaf_inuse(WT_CACHE *cache) { - uint64_t dirty_inuse; - - dirty_inuse = cache->bytes_dirty_leaf; - if (cache->overhead_pct != 0) - dirty_inuse += - (dirty_inuse * (uint64_t)cache->overhead_pct) / 100; - - return (dirty_inuse); + return (__wt_cache_bytes_plus_overhead(cache, cache->bytes_dirty_leaf)); } /* @@ -136,14 +140,7 @@ __wt_cache_dirty_leaf_inuse(WT_CACHE *cache) static inline uint64_t __wt_cache_bytes_image(WT_CACHE *cache) { - uint64_t bytes_image; - - bytes_image = cache->bytes_image; - if (cache->overhead_pct != 0) - bytes_image += - (bytes_image * (uint64_t)cache->overhead_pct) / 100; - - return (bytes_image); + return (__wt_cache_bytes_plus_overhead(cache, cache->bytes_image)); } /* @@ -153,7 +150,7 @@ __wt_cache_bytes_image(WT_CACHE *cache) static inline uint64_t __wt_cache_bytes_other(WT_CACHE *cache) { - uint64_t bytes_image, bytes_inmem, bytes_other; + uint64_t bytes_image, bytes_inmem; bytes_image = cache->bytes_image; bytes_inmem = cache->bytes_inmem; @@ -162,15 +159,8 @@ __wt_cache_bytes_other(WT_CACHE *cache) * The reads above could race with changes to the values, so protect * against underflow. */ - if (bytes_image > bytes_inmem) - return (0); - - bytes_other = bytes_inmem - bytes_image; - if (cache->overhead_pct != 0) - bytes_other += - (bytes_other * (uint64_t)cache->overhead_pct) / 100; - - return (bytes_other); + return ((bytes_image > bytes_inmem) ? 0 : + __wt_cache_bytes_plus_overhead(cache, bytes_inmem - bytes_image)); } /* @@ -210,7 +200,7 @@ __wt_eviction_needed(WT_SESSION_IMPL *session, u_int *pct_fullp) WT_CONNECTION_IMPL *conn; WT_CACHE *cache; uint64_t bytes_inuse, bytes_max; - u_int pct_full; + u_int pct_dirty, pct_full; conn = S2C(session); cache = conn->cache; @@ -234,24 +224,16 @@ __wt_eviction_needed(WT_SESSION_IMPL *session, u_int *pct_fullp) * we involve the application thread. */ pct_full = (u_int)((100 * bytes_inuse) / bytes_max); - if (pct_fullp != NULL) - *pct_fullp = pct_full; + pct_dirty = + (u_int)((100 * __wt_cache_dirty_leaf_inuse(cache)) / bytes_max); - if (pct_full > cache->eviction_trigger) - return (true); - - /* - * Check if there are too many dirty bytes in cache. - * - * We try to avoid penalizing read-only operations by only checking the - * dirty limit once a transaction ID has been allocated, or if the last - * transaction did an update. - */ - if (__wt_cache_dirty_leaf_inuse(cache) > - (cache->eviction_dirty_trigger * bytes_max) / 100) - return (true); + if (pct_fullp != NULL) + *pct_fullp = (u_int)WT_MAX(0, 100 - WT_MIN( + (int)cache->eviction_trigger - (int)pct_full, + (int)cache->eviction_dirty_trigger - (int)pct_dirty)); - return (false); + return (pct_full >= cache->eviction_trigger || + pct_dirty >= cache->eviction_dirty_trigger); } /* diff --git a/src/third_party/wiredtiger/src/include/connection.h b/src/third_party/wiredtiger/src/include/connection.h index a9855e42980..bd5726a06c3 100644 --- a/src/third_party/wiredtiger/src/include/connection.h +++ b/src/third_party/wiredtiger/src/include/connection.h @@ -303,15 +303,11 @@ struct __wt_connection_impl { WT_KEYED_ENCRYPTOR *kencryptor; /* Encryptor for metadata and log */ - WT_SESSION_IMPL *evict_session; /* Eviction server sessions */ - wt_thread_t evict_tid; /* Eviction server thread ID */ - bool evict_tid_set; /* Eviction server thread ID set */ - - uint32_t evict_workers_alloc;/* Allocated eviction workers */ - uint32_t evict_workers_max;/* Max eviction workers */ - uint32_t evict_workers_min;/* Min eviction workers */ - uint32_t evict_workers; /* Number of eviction workers */ - WT_EVICT_WORKER *evict_workctx; /* Eviction worker context */ + bool evict_server_running;/* Eviction server operating */ + + WT_THREAD_GROUP evict_threads; + uint32_t evict_threads_max;/* Max eviction threads */ + uint32_t evict_threads_min;/* Min eviction threads */ #define WT_STATLOG_FILENAME "WiredTigerStat.%d.%H" WT_SESSION_IMPL *stat_session; /* Statistics log session */ diff --git a/src/third_party/wiredtiger/src/include/cursor.h b/src/third_party/wiredtiger/src/include/cursor.h index dce24f20844..f1fa4d193ac 100644 --- a/src/third_party/wiredtiger/src/include/cursor.h +++ b/src/third_party/wiredtiger/src/include/cursor.h @@ -425,6 +425,7 @@ struct __wt_cursor_metadata { WT_CURSOR iface; WT_CURSOR *file_cursor; /* Queries of regular metadata */ + WT_CURSOR *create_cursor; /* Extra cursor for create option */ #define WT_MDC_CREATEONLY 0x01 #define WT_MDC_ONMETADATA 0x02 diff --git a/src/third_party/wiredtiger/src/include/cursor.i b/src/third_party/wiredtiger/src/include/cursor.i index 76a08138afb..e142441e0a6 100644 --- a/src/third_party/wiredtiger/src/include/cursor.i +++ b/src/third_party/wiredtiger/src/include/cursor.i @@ -117,7 +117,7 @@ __curfile_leave(WT_CURSOR_BTREE *cbt) */ if (cbt->ref != NULL && cbt->page_deleted_count > WT_BTREE_DELETE_THRESHOLD) - WT_TRET(__wt_page_evict_soon(session, cbt->ref)); + __wt_page_evict_soon(session, cbt->ref); cbt->page_deleted_count = 0; /* @@ -127,7 +127,7 @@ __curfile_leave(WT_CURSOR_BTREE *cbt) * * Clear the reference regardless, so we don't try the release twice. */ - WT_TRET(__wt_page_release(session, cbt->ref, 0)); + ret = __wt_page_release(session, cbt->ref, 0); cbt->ref = NULL; return (ret); diff --git a/src/third_party/wiredtiger/src/include/error.h b/src/third_party/wiredtiger/src/include/error.h index 5f24d205af9..bbb7f989332 100644 --- a/src/third_party/wiredtiger/src/include/error.h +++ b/src/third_party/wiredtiger/src/include/error.h @@ -77,7 +77,6 @@ ret == 0 || ret == WT_DUPLICATE_KEY || ret == WT_NOTFOUND)) \ ret = __ret; \ } while (0) -#define WT_TRET_BUSY_OK(a) WT_TRET_ERROR_OK(a, EBUSY) #define WT_TRET_NOTFOUND_OK(a) WT_TRET_ERROR_OK(a, WT_NOTFOUND) /* Return and branch-to-err-label cases for switch statements. */ @@ -95,10 +94,11 @@ #define WT_PANIC_MSG(session, v, ...) do { \ __wt_err(session, v, __VA_ARGS__); \ - (void)__wt_panic(session); \ + WT_IGNORE_RET(__wt_panic(session)); \ } while (0) #define WT_PANIC_ERR(session, v, ...) do { \ WT_PANIC_MSG(session, v, __VA_ARGS__); \ + /* Return WT_PANIC regardless of earlier return codes. */ \ WT_ERR(WT_PANIC); \ } while (0) #define WT_PANIC_RET(session, v, ...) do { \ diff --git a/src/third_party/wiredtiger/src/include/extern.h b/src/third_party/wiredtiger/src/include/extern.h index f3a639ac07f..2992a97b727 100644 --- a/src/third_party/wiredtiger/src/include/extern.h +++ b/src/third_party/wiredtiger/src/include/extern.h @@ -1,641 +1,642 @@ /* DO NOT EDIT: automatically built by dist/s_prototypes. */ extern void __wt_async_stats_update(WT_SESSION_IMPL *session); -extern int __wt_async_create(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_async_reconfig(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_async_destroy(WT_SESSION_IMPL *session); -extern int __wt_async_flush(WT_SESSION_IMPL *session); -extern int __wt_async_new_op(WT_SESSION_IMPL *session, const char *uri, const char *config, const char *cfg[], WT_ASYNC_CALLBACK *cb, WT_ASYNC_OP_IMPL **opp); -extern int __wt_async_op_enqueue(WT_SESSION_IMPL *session, WT_ASYNC_OP_IMPL *op); -extern int __wt_async_op_init(WT_SESSION_IMPL *session); +extern int __wt_async_create(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_async_reconfig(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_async_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_async_flush(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_async_new_op(WT_SESSION_IMPL *session, const char *uri, const char *config, const char *cfg[], WT_ASYNC_CALLBACK *cb, WT_ASYNC_OP_IMPL **opp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_async_op_enqueue(WT_SESSION_IMPL *session, WT_ASYNC_OP_IMPL *op) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_async_op_init(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern WT_THREAD_RET __wt_async_worker(void *arg); -extern int __wt_block_addr_to_buffer(WT_BLOCK *block, uint8_t **pp, wt_off_t offset, uint32_t size, uint32_t cksum); -extern int __wt_block_buffer_to_addr(WT_BLOCK *block, const uint8_t *p, wt_off_t *offsetp, uint32_t *sizep, uint32_t *cksump); -extern int __wt_block_addr_invalid(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, bool live); -extern int __wt_block_addr_string(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, const uint8_t *addr, size_t addr_size); -extern int __wt_block_buffer_to_ckpt(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *p, WT_BLOCK_CKPT *ci); -extern int __wt_block_ckpt_decode(WT_SESSION *wt_session, size_t allocsize, const uint8_t *p, WT_BLOCK_CKPT *ci); -extern int __wt_block_ckpt_to_buffer(WT_SESSION_IMPL *session, WT_BLOCK *block, uint8_t **pp, WT_BLOCK_CKPT *ci); -extern int __wt_block_ckpt_init( WT_SESSION_IMPL *session, WT_BLOCK_CKPT *ci, const char *name); -extern int __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, uint8_t *root_addr, size_t *root_addr_sizep, bool checkpoint); -extern int __wt_block_checkpoint_unload( WT_SESSION_IMPL *session, WT_BLOCK *block, bool checkpoint); +extern int __wt_block_addr_to_buffer(WT_BLOCK *block, uint8_t **pp, wt_off_t offset, uint32_t size, uint32_t cksum) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_buffer_to_addr(WT_BLOCK *block, const uint8_t *p, wt_off_t *offsetp, uint32_t *sizep, uint32_t *cksump) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_addr_invalid(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, bool live) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_addr_string(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, const uint8_t *addr, size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_buffer_to_ckpt(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *p, WT_BLOCK_CKPT *ci) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_ckpt_decode(WT_SESSION *wt_session, size_t allocsize, const uint8_t *p, WT_BLOCK_CKPT *ci) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_ckpt_to_buffer(WT_SESSION_IMPL *session, WT_BLOCK *block, uint8_t **pp, WT_BLOCK_CKPT *ci) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_ckpt_init( WT_SESSION_IMPL *session, WT_BLOCK_CKPT *ci, const char *name) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, uint8_t *root_addr, size_t *root_addr_sizep, bool checkpoint) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_checkpoint_unload( WT_SESSION_IMPL *session, WT_BLOCK *block, bool checkpoint) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_block_ckpt_destroy(WT_SESSION_IMPL *session, WT_BLOCK_CKPT *ci); -extern int __wt_block_checkpoint(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, WT_CKPT *ckptbase, bool data_cksum); -extern int __wt_block_checkpoint_resolve(WT_SESSION_IMPL *session, WT_BLOCK *block); -extern int __wt_block_compact_start(WT_SESSION_IMPL *session, WT_BLOCK *block); -extern int __wt_block_compact_end(WT_SESSION_IMPL *session, WT_BLOCK *block); -extern int __wt_block_compact_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, bool *skipp); -extern int __wt_block_compact_page_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, bool *skipp); -extern int __wt_block_misplaced(WT_SESSION_IMPL *session, WT_BLOCK *block, const char *tag, wt_off_t offset, uint32_t size, bool live); -extern int __wt_block_off_remove_overlap(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el, wt_off_t off, wt_off_t size); -extern int __wt_block_alloc( WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t *offp, wt_off_t size); -extern int __wt_block_free(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size); -extern int __wt_block_off_free( WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t offset, wt_off_t size); -extern int __wt_block_extlist_check( WT_SESSION_IMPL *session, WT_EXTLIST *al, WT_EXTLIST *bl); -extern int __wt_block_extlist_overlap( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_BLOCK_CKPT *ci); -extern int __wt_block_extlist_merge(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *a, WT_EXTLIST *b); -extern int __wt_block_insert_ext(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el, wt_off_t off, wt_off_t size); -extern int __wt_block_extlist_read_avail(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el, wt_off_t ckpt_size); -extern int __wt_block_extlist_read(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el, wt_off_t ckpt_size); -extern int __wt_block_extlist_write(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el, WT_EXTLIST *additional); -extern int __wt_block_extlist_truncate( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el); -extern int __wt_block_extlist_init(WT_SESSION_IMPL *session, WT_EXTLIST *el, const char *name, const char *extname, bool track_size); +extern int __wt_block_checkpoint(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, WT_CKPT *ckptbase, bool data_cksum) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_checkpoint_resolve(WT_SESSION_IMPL *session, WT_BLOCK *block) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_compact_start(WT_SESSION_IMPL *session, WT_BLOCK *block) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_compact_end(WT_SESSION_IMPL *session, WT_BLOCK *block) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_compact_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, bool *skipp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_compact_page_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, bool *skipp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_misplaced(WT_SESSION_IMPL *session, WT_BLOCK *block, const char *tag, wt_off_t offset, uint32_t size, bool live) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_off_remove_overlap(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el, wt_off_t off, wt_off_t size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_alloc( WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t *offp, wt_off_t size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_free(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_off_free( WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t offset, wt_off_t size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_extlist_check( WT_SESSION_IMPL *session, WT_EXTLIST *al, WT_EXTLIST *bl) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_extlist_overlap( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_BLOCK_CKPT *ci) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_extlist_merge(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *a, WT_EXTLIST *b) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_insert_ext(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el, wt_off_t off, wt_off_t size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_extlist_read_avail(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el, wt_off_t ckpt_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_extlist_read(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el, wt_off_t ckpt_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_extlist_write(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el, WT_EXTLIST *additional) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_extlist_truncate( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_extlist_init(WT_SESSION_IMPL *session, WT_EXTLIST *el, const char *name, const char *extname, bool track_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_block_extlist_free(WT_SESSION_IMPL *session, WT_EXTLIST *el); -extern int __wt_block_map(WT_SESSION_IMPL *session, WT_BLOCK *block, void *mapped_regionp, size_t *lengthp, void *mapped_cookiep); -extern int __wt_block_unmap(WT_SESSION_IMPL *session, WT_BLOCK *block, void *mapped_region, size_t length, void *mapped_cookie); -extern int __wt_block_manager_open(WT_SESSION_IMPL *session, const char *filename, const char *cfg[], bool forced_salvage, bool readonly, uint32_t allocsize, WT_BM **bmp); -extern int __wt_block_manager_drop( WT_SESSION_IMPL *session, const char *filename, bool durable); -extern int __wt_block_manager_create( WT_SESSION_IMPL *session, const char *filename, uint32_t allocsize); +extern int __wt_block_map(WT_SESSION_IMPL *session, WT_BLOCK *block, void *mapped_regionp, size_t *lengthp, void *mapped_cookiep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_unmap(WT_SESSION_IMPL *session, WT_BLOCK *block, void *mapped_region, size_t length, void *mapped_cookie) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_manager_open(WT_SESSION_IMPL *session, const char *filename, const char *cfg[], bool forced_salvage, bool readonly, uint32_t allocsize, WT_BM **bmp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_manager_drop( WT_SESSION_IMPL *session, const char *filename, bool durable) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_manager_create( WT_SESSION_IMPL *session, const char *filename, uint32_t allocsize) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_block_configure_first_fit(WT_BLOCK *block, bool on); -extern int __wt_block_open(WT_SESSION_IMPL *session, const char *filename, const char *cfg[], bool forced_salvage, bool readonly, uint32_t allocsize, WT_BLOCK **blockp); -extern int __wt_block_close(WT_SESSION_IMPL *session, WT_BLOCK *block); -extern int __wt_desc_write(WT_SESSION_IMPL *session, WT_FH *fh, uint32_t allocsize); +extern int __wt_block_open(WT_SESSION_IMPL *session, const char *filename, const char *cfg[], bool forced_salvage, bool readonly, uint32_t allocsize, WT_BLOCK **blockp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_close(WT_SESSION_IMPL *session, WT_BLOCK *block) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_desc_write(WT_SESSION_IMPL *session, WT_FH *fh, uint32_t allocsize) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_block_stat(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_DSRC_STATS *stats); -extern int __wt_block_manager_size(WT_BM *bm, WT_SESSION_IMPL *session, wt_off_t *sizep); -extern int __wt_block_manager_named_size( WT_SESSION_IMPL *session, const char *name, wt_off_t *sizep); -extern int __wt_bm_preload( WT_BM *bm, WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size); -extern int __wt_bm_read(WT_BM *bm, WT_SESSION_IMPL *session, WT_ITEM *buf, const uint8_t *addr, size_t addr_size); -extern int __wt_block_read_off_blind( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, wt_off_t offset); -extern int __wt_block_read_off(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, wt_off_t offset, uint32_t size, uint32_t cksum); -extern int __wt_block_ext_alloc(WT_SESSION_IMPL *session, WT_EXT **extp); +extern int __wt_block_manager_size(WT_BM *bm, WT_SESSION_IMPL *session, wt_off_t *sizep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_manager_named_size( WT_SESSION_IMPL *session, const char *name, wt_off_t *sizep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bm_preload( WT_BM *bm, WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bm_read(WT_BM *bm, WT_SESSION_IMPL *session, WT_ITEM *buf, const uint8_t *addr, size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_read_off_blind( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, wt_off_t offset) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_read_off(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, wt_off_t offset, uint32_t size, uint32_t cksum) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_ext_alloc(WT_SESSION_IMPL *session, WT_EXT **extp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_block_ext_free(WT_SESSION_IMPL *session, WT_EXT *ext); -extern int __wt_block_size_alloc(WT_SESSION_IMPL *session, WT_SIZE **szp); +extern int __wt_block_size_alloc(WT_SESSION_IMPL *session, WT_SIZE **szp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_block_size_free(WT_SESSION_IMPL *session, WT_SIZE *sz); -extern int __wt_block_ext_prealloc(WT_SESSION_IMPL *session, u_int max); -extern int __wt_block_ext_discard(WT_SESSION_IMPL *session, u_int max); -extern int __wt_block_salvage_start(WT_SESSION_IMPL *session, WT_BLOCK *block); -extern int __wt_block_salvage_end(WT_SESSION_IMPL *session, WT_BLOCK *block); +extern int __wt_block_ext_prealloc(WT_SESSION_IMPL *session, u_int max) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_ext_discard(WT_SESSION_IMPL *session, u_int max) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_salvage_start(WT_SESSION_IMPL *session, WT_BLOCK *block) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_salvage_end(WT_SESSION_IMPL *session, WT_BLOCK *block) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern bool __wt_block_offset_invalid(WT_BLOCK *block, wt_off_t offset, uint32_t size); -extern int __wt_block_salvage_next(WT_SESSION_IMPL *session, WT_BLOCK *block, uint8_t *addr, size_t *addr_sizep, bool *eofp); -extern int __wt_block_salvage_valid(WT_SESSION_IMPL *session, WT_BLOCK *block, uint8_t *addr, size_t addr_size, bool valid); -extern int __wt_block_verify_start(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_CKPT *ckptbase, const char *cfg[]); -extern int __wt_block_verify_end(WT_SESSION_IMPL *session, WT_BLOCK *block); -extern int __wt_verify_ckpt_load( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_BLOCK_CKPT *ci); -extern int __wt_verify_ckpt_unload(WT_SESSION_IMPL *session, WT_BLOCK *block); -extern int __wt_block_verify_addr(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size); -extern int __wt_block_truncate(WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t len); -extern int __wt_block_discard(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t added_size); -extern int __wt_block_write_size(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t *sizep); -extern int __wt_block_write(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, uint8_t *addr, size_t *addr_sizep, bool data_cksum, bool checkpoint_io); -extern int __wt_block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, wt_off_t *offsetp, uint32_t *sizep, uint32_t *cksump, bool data_cksum, bool checkpoint_io, bool caller_locked); -extern int __wt_bloom_create( WT_SESSION_IMPL *session, const char *uri, const char *config, uint64_t count, uint32_t factor, uint32_t k, WT_BLOOM **bloomp); -extern int __wt_bloom_open(WT_SESSION_IMPL *session, const char *uri, uint32_t factor, uint32_t k, WT_CURSOR *owner, WT_BLOOM **bloomp); -extern int __wt_bloom_insert(WT_BLOOM *bloom, WT_ITEM *key); -extern int __wt_bloom_finalize(WT_BLOOM *bloom); -extern int __wt_bloom_hash(WT_BLOOM *bloom, WT_ITEM *key, WT_BLOOM_HASH *bhash); -extern int __wt_bloom_hash_get(WT_BLOOM *bloom, WT_BLOOM_HASH *bhash); -extern int __wt_bloom_get(WT_BLOOM *bloom, WT_ITEM *key); -extern int __wt_bloom_inmem_get(WT_BLOOM *bloom, WT_ITEM *key); -extern int __wt_bloom_intersection(WT_BLOOM *bloom, WT_BLOOM *other); -extern int __wt_bloom_close(WT_BLOOM *bloom); -extern int __wt_bloom_drop(WT_BLOOM *bloom, const char *config); -extern int __wt_compact(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_compact_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp); -extern int __wt_cursor_key_order_check( WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, bool next); -extern int __wt_cursor_key_order_init(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt); +extern int __wt_block_salvage_next(WT_SESSION_IMPL *session, WT_BLOCK *block, uint8_t *addr, size_t *addr_sizep, bool *eofp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_salvage_valid(WT_SESSION_IMPL *session, WT_BLOCK *block, uint8_t *addr, size_t addr_size, bool valid) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_verify_start(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_CKPT *ckptbase, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_verify_end(WT_SESSION_IMPL *session, WT_BLOCK *block) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_verify_ckpt_load( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_BLOCK_CKPT *ci) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_verify_ckpt_unload(WT_SESSION_IMPL *session, WT_BLOCK *block) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_verify_addr(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_truncate(WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t len) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_discard(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t added_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_write_size(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t *sizep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_write(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, uint8_t *addr, size_t *addr_sizep, bool data_cksum, bool checkpoint_io) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, wt_off_t *offsetp, uint32_t *sizep, uint32_t *cksump, bool data_cksum, bool checkpoint_io, bool caller_locked) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bloom_create( WT_SESSION_IMPL *session, const char *uri, const char *config, uint64_t count, uint32_t factor, uint32_t k, WT_BLOOM **bloomp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bloom_open(WT_SESSION_IMPL *session, const char *uri, uint32_t factor, uint32_t k, WT_CURSOR *owner, WT_BLOOM **bloomp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bloom_insert(WT_BLOOM *bloom, WT_ITEM *key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bloom_finalize(WT_BLOOM *bloom) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bloom_hash(WT_BLOOM *bloom, WT_ITEM *key, WT_BLOOM_HASH *bhash) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bloom_hash_get(WT_BLOOM *bloom, WT_BLOOM_HASH *bhash) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bloom_get(WT_BLOOM *bloom, WT_ITEM *key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bloom_inmem_get(WT_BLOOM *bloom, WT_ITEM *key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bloom_intersection(WT_BLOOM *bloom, WT_BLOOM *other) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bloom_close(WT_BLOOM *bloom) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bloom_drop(WT_BLOOM *bloom, const char *config) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_compact(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_compact_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_key_order_check( WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, bool next) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_key_order_init(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_cursor_key_order_reset(WT_CURSOR_BTREE *cbt); extern void __wt_btcur_iterate_setup(WT_CURSOR_BTREE *cbt); -extern int __wt_btcur_next(WT_CURSOR_BTREE *cbt, bool truncating); -extern int __wt_btcur_prev(WT_CURSOR_BTREE *cbt, bool truncating); -extern int __wt_btcur_reset(WT_CURSOR_BTREE *cbt); -extern int __wt_btcur_search(WT_CURSOR_BTREE *cbt); -extern int __wt_btcur_search_near(WT_CURSOR_BTREE *cbt, int *exactp); -extern int __wt_btcur_insert(WT_CURSOR_BTREE *cbt); -extern int __wt_btcur_update_check(WT_CURSOR_BTREE *cbt); -extern int __wt_btcur_remove(WT_CURSOR_BTREE *cbt); -extern int __wt_btcur_update(WT_CURSOR_BTREE *cbt); -extern int __wt_btcur_next_random(WT_CURSOR_BTREE *cbt); -extern int __wt_btcur_compare(WT_CURSOR_BTREE *a_arg, WT_CURSOR_BTREE *b_arg, int *cmpp); -extern int __wt_btcur_equals(WT_CURSOR_BTREE *a_arg, WT_CURSOR_BTREE *b_arg, int *equalp); -extern int __wt_btcur_range_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop); +extern int __wt_btcur_next(WT_CURSOR_BTREE *cbt, bool truncating) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_prev(WT_CURSOR_BTREE *cbt, bool truncating) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_reset(WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_search(WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_search_near(WT_CURSOR_BTREE *cbt, int *exactp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_insert(WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_update_check(WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_remove(WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_update(WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_next_random(WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_compare(WT_CURSOR_BTREE *a_arg, WT_CURSOR_BTREE *b_arg, int *cmpp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_equals(WT_CURSOR_BTREE *a_arg, WT_CURSOR_BTREE *b_arg, int *equalp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btcur_range_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_btcur_init(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt); extern void __wt_btcur_open(WT_CURSOR_BTREE *cbt); -extern int __wt_btcur_close(WT_CURSOR_BTREE *cbt, bool lowlevel); -extern int __wt_debug_set_verbose(WT_SESSION_IMPL *session, const char *v); -extern int __wt_debug_addr_print( WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size); -extern int __wt_debug_addr(WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size, const char *ofile); -extern int __wt_debug_offset_blind( WT_SESSION_IMPL *session, wt_off_t offset, const char *ofile); -extern int __wt_debug_offset(WT_SESSION_IMPL *session, wt_off_t offset, uint32_t size, uint32_t cksum, const char *ofile); -extern int __wt_debug_disk( WT_SESSION_IMPL *session, const WT_PAGE_HEADER *dsk, const char *ofile); -extern int __wt_debug_tree_shape( WT_SESSION_IMPL *session, WT_PAGE *page, const char *ofile); -extern int __wt_debug_tree_all( WT_SESSION_IMPL *session, WT_BTREE *btree, WT_REF *ref, const char *ofile); -extern int __wt_debug_tree( WT_SESSION_IMPL *session, WT_BTREE *btree, WT_REF *ref, const char *ofile); -extern int __wt_debug_page(WT_SESSION_IMPL *session, WT_REF *ref, const char *ofile); -extern int __wt_delete_page(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp); +extern int __wt_btcur_close(WT_CURSOR_BTREE *cbt, bool lowlevel) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_debug_set_verbose(WT_SESSION_IMPL *session, const char *v) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_debug_addr_print( WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_debug_addr(WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size, const char *ofile) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_debug_offset_blind( WT_SESSION_IMPL *session, wt_off_t offset, const char *ofile) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_debug_offset(WT_SESSION_IMPL *session, wt_off_t offset, uint32_t size, uint32_t cksum, const char *ofile) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_debug_disk( WT_SESSION_IMPL *session, const WT_PAGE_HEADER *dsk, const char *ofile) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_debug_tree_shape( WT_SESSION_IMPL *session, WT_PAGE *page, const char *ofile) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_debug_tree_all( WT_SESSION_IMPL *session, WT_BTREE *btree, WT_REF *ref, const char *ofile) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_debug_tree( WT_SESSION_IMPL *session, WT_BTREE *btree, WT_REF *ref, const char *ofile) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_debug_page(WT_SESSION_IMPL *session, WT_REF *ref, const char *ofile) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_delete_page(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_delete_page_rollback(WT_SESSION_IMPL *session, WT_REF *ref); extern bool __wt_delete_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, bool visible_all); -extern int __wt_delete_page_instantiate(WT_SESSION_IMPL *session, WT_REF *ref); +extern int __wt_delete_page_instantiate(WT_SESSION_IMPL *session, WT_REF *ref) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_ref_out(WT_SESSION_IMPL *session, WT_REF *ref); extern void __wt_page_out(WT_SESSION_IMPL *session, WT_PAGE **pagep); extern void __wt_free_ref( WT_SESSION_IMPL *session, WT_REF *ref, int page_type, bool free_pages); extern void __wt_free_ref_index(WT_SESSION_IMPL *session, WT_PAGE *page, WT_PAGE_INDEX *pindex, bool free_pages); extern void __wt_free_update_list(WT_SESSION_IMPL *session, WT_UPDATE *upd); -extern int __wt_btree_open(WT_SESSION_IMPL *session, const char *op_cfg[]); -extern int __wt_btree_close(WT_SESSION_IMPL *session); +extern int __wt_btree_open(WT_SESSION_IMPL *session, const char *op_cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btree_close(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_root_ref_init(WT_REF *root_ref, WT_PAGE *root, bool is_recno); -extern int __wt_btree_tree_open( WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size); -extern int __wt_btree_new_leaf_page(WT_SESSION_IMPL *session, WT_PAGE **pagep); +extern int __wt_btree_tree_open( WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btree_new_leaf_page(WT_SESSION_IMPL *session, WT_PAGE **pagep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_btree_evictable(WT_SESSION_IMPL *session, bool on); -extern int __wt_btree_huffman_open(WT_SESSION_IMPL *session); +extern int __wt_btree_huffman_open(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_btree_huffman_close(WT_SESSION_IMPL *session); -extern int __wt_bt_read(WT_SESSION_IMPL *session, WT_ITEM *buf, const uint8_t *addr, size_t addr_size); -extern int __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf, uint8_t *addr, size_t *addr_sizep, bool checkpoint, bool checkpoint_io, bool compressed); +extern int __wt_bt_read(WT_SESSION_IMPL *session, WT_ITEM *buf, const uint8_t *addr, size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf, uint8_t *addr, size_t *addr_sizep, bool checkpoint, bool checkpoint_io, bool compressed) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern const char *__wt_page_type_string(u_int type); extern const char *__wt_cell_type_string(uint8_t type); extern const char *__wt_page_addr_string(WT_SESSION_IMPL *session, WT_REF *ref, WT_ITEM *buf); extern const char *__wt_addr_string(WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size, WT_ITEM *buf); -extern int __wt_ovfl_read(WT_SESSION_IMPL *session, WT_PAGE *page, WT_CELL_UNPACK *unpack, WT_ITEM *store); -extern int __wt_ovfl_cache(WT_SESSION_IMPL *session, WT_PAGE *page, void *cookie, WT_CELL_UNPACK *vpack); -extern int __wt_ovfl_discard(WT_SESSION_IMPL *session, WT_CELL *cell); -extern int __wt_page_alloc(WT_SESSION_IMPL *session, uint8_t type, uint32_t alloc_entries, bool alloc_refs, WT_PAGE **pagep); -extern int __wt_page_inmem(WT_SESSION_IMPL *session, WT_REF *ref, const void *image, size_t memsize, uint32_t flags, WT_PAGE **pagep); -extern int __wt_las_remove_block(WT_SESSION_IMPL *session, WT_CURSOR *cursor, uint32_t btree_id, const uint8_t *addr, size_t addr_size); +extern int __wt_ovfl_read(WT_SESSION_IMPL *session, WT_PAGE *page, WT_CELL_UNPACK *unpack, WT_ITEM *store) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ovfl_cache(WT_SESSION_IMPL *session, WT_PAGE *page, void *cookie, WT_CELL_UNPACK *vpack) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ovfl_discard(WT_SESSION_IMPL *session, WT_CELL *cell) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_page_alloc(WT_SESSION_IMPL *session, uint8_t type, uint32_t alloc_entries, bool alloc_refs, WT_PAGE **pagep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_page_inmem(WT_SESSION_IMPL *session, WT_REF *ref, const void *image, size_t memsize, uint32_t flags, WT_PAGE **pagep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_las_remove_block(WT_SESSION_IMPL *session, WT_CURSOR *cursor, uint32_t btree_id, const uint8_t *addr, size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags #ifdef HAVE_DIAGNOSTIC , const char *file, int line #endif ); -extern int __wt_bt_rebalance(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_kv_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd); -extern int __wt_bt_salvage(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, const char *cfg[]); +extern int __wt_bt_rebalance(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_kv_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bt_salvage(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_split_stash_discard(WT_SESSION_IMPL *session); extern void __wt_split_stash_discard_all( WT_SESSION_IMPL *session_safe, WT_SESSION_IMPL *session); -extern int __wt_multi_to_ref(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi, WT_REF **refp, size_t *incrp, bool closing); -extern int __wt_split_insert(WT_SESSION_IMPL *session, WT_REF *ref); -extern int __wt_split_multi(WT_SESSION_IMPL *session, WT_REF *ref, int closing); -extern int __wt_split_reverse(WT_SESSION_IMPL *session, WT_REF *ref); -extern int __wt_split_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, WT_MULTI *multi); -extern int __wt_btree_stat_init(WT_SESSION_IMPL *session, WT_CURSOR_STAT *cst); -extern int __wt_cache_op(WT_SESSION_IMPL *session, WT_CACHE_OP op); -extern int __wt_upgrade(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_verify(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_verify_dsk_image(WT_SESSION_IMPL *session, const char *tag, const WT_PAGE_HEADER *dsk, size_t size, bool empty_page_ok); -extern int __wt_verify_dsk(WT_SESSION_IMPL *session, const char *tag, WT_ITEM *buf); -extern int __wt_tree_walk(WT_SESSION_IMPL *session, WT_REF **refp, uint32_t flags); -extern int __wt_tree_walk_count(WT_SESSION_IMPL *session, WT_REF **refp, uint64_t *walkcntp, uint32_t flags); -extern int __wt_tree_walk_skip(WT_SESSION_IMPL *session, WT_REF **refp, uint64_t *skipleafcntp, uint32_t flags); -extern int __wt_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, uint64_t recno, WT_ITEM *value, WT_UPDATE *upd_arg, bool is_remove); -extern int __wt_col_search(WT_SESSION_IMPL *session, uint64_t search_recno, WT_REF *leaf, WT_CURSOR_BTREE *cbt); -extern int __wt_row_leaf_keys(WT_SESSION_IMPL *session, WT_PAGE *page); -extern int __wt_row_leaf_key_copy( WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW *rip, WT_ITEM *key); -extern int __wt_row_leaf_key_work(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW *rip_arg, WT_ITEM *keyb, bool instantiate); -extern int __wt_row_ikey_alloc(WT_SESSION_IMPL *session, uint32_t cell_offset, const void *key, size_t size, WT_IKEY **ikeyp); -extern int __wt_row_ikey_incr(WT_SESSION_IMPL *session, WT_PAGE *page, uint32_t cell_offset, const void *key, size_t size, WT_REF *ref); -extern int __wt_row_ikey(WT_SESSION_IMPL *session, uint32_t cell_offset, const void *key, size_t size, WT_REF *ref); -extern int __wt_page_modify_alloc(WT_SESSION_IMPL *session, WT_PAGE *page); -extern int __wt_row_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_ITEM *key, WT_ITEM *value, WT_UPDATE *upd_arg, bool is_remove); -extern int __wt_row_insert_alloc(WT_SESSION_IMPL *session, WT_ITEM *key, u_int skipdepth, WT_INSERT **insp, size_t *ins_sizep); -extern int __wt_update_alloc( WT_SESSION_IMPL *session, WT_ITEM *value, WT_UPDATE **updp, size_t *sizep); +extern int __wt_multi_to_ref(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi, WT_REF **refp, size_t *incrp, bool closing) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_split_insert(WT_SESSION_IMPL *session, WT_REF *ref) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_split_multi(WT_SESSION_IMPL *session, WT_REF *ref, int closing) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_split_reverse(WT_SESSION_IMPL *session, WT_REF *ref) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_split_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, WT_MULTI *multi) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_btree_stat_init(WT_SESSION_IMPL *session, WT_CURSOR_STAT *cst) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cache_op(WT_SESSION_IMPL *session, WT_CACHE_OP op) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_upgrade(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_verify(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_verify_dsk_image(WT_SESSION_IMPL *session, const char *tag, const WT_PAGE_HEADER *dsk, size_t size, bool empty_page_ok) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_verify_dsk(WT_SESSION_IMPL *session, const char *tag, WT_ITEM *buf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_tree_walk(WT_SESSION_IMPL *session, WT_REF **refp, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_tree_walk_count(WT_SESSION_IMPL *session, WT_REF **refp, uint64_t *walkcntp, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_tree_walk_skip(WT_SESSION_IMPL *session, WT_REF **refp, uint64_t *skipleafcntp, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, uint64_t recno, WT_ITEM *value, WT_UPDATE *upd_arg, bool is_remove) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_col_search(WT_SESSION_IMPL *session, uint64_t search_recno, WT_REF *leaf, WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_leaf_keys(WT_SESSION_IMPL *session, WT_PAGE *page) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_leaf_key_copy( WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW *rip, WT_ITEM *key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_leaf_key_work(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW *rip_arg, WT_ITEM *keyb, bool instantiate) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_ikey_alloc(WT_SESSION_IMPL *session, uint32_t cell_offset, const void *key, size_t size, WT_IKEY **ikeyp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_ikey_incr(WT_SESSION_IMPL *session, WT_PAGE *page, uint32_t cell_offset, const void *key, size_t size, WT_REF *ref) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_ikey(WT_SESSION_IMPL *session, uint32_t cell_offset, const void *key, size_t size, WT_REF *ref) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_page_modify_alloc(WT_SESSION_IMPL *session, WT_PAGE *page) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_ITEM *key, WT_ITEM *value, WT_UPDATE *upd_arg, bool is_remove) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_insert_alloc(WT_SESSION_IMPL *session, WT_ITEM *key, u_int skipdepth, WT_INSERT **insp, size_t *ins_sizep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_update_alloc( WT_SESSION_IMPL *session, WT_ITEM *value, WT_UPDATE **updp, size_t *sizep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern WT_UPDATE *__wt_update_obsolete_check( WT_SESSION_IMPL *session, WT_PAGE *page, WT_UPDATE *upd); extern void __wt_update_obsolete_free( WT_SESSION_IMPL *session, WT_PAGE *page, WT_UPDATE *upd); -extern int __wt_search_insert(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_INSERT_HEAD *ins_head, WT_ITEM *srch_key); -extern int __wt_row_search(WT_SESSION_IMPL *session, WT_ITEM *srch_key, WT_REF *leaf, WT_CURSOR_BTREE *cbt, bool insert); -extern int __wt_row_random_leaf(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt); -extern int __wt_row_random_descent(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt); +extern int __wt_search_insert(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_INSERT_HEAD *ins_head, WT_ITEM *srch_key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_search(WT_SESSION_IMPL *session, WT_ITEM *srch_key, WT_REF *leaf, WT_CURSOR_BTREE *cbt, bool insert) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_random_leaf(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_random_descent(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_las_stats_update(WT_SESSION_IMPL *session); -extern int __wt_las_create(WT_SESSION_IMPL *session); -extern int __wt_las_destroy(WT_SESSION_IMPL *session); +extern int __wt_las_create(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_las_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_las_set_written(WT_SESSION_IMPL *session); extern bool __wt_las_is_written(WT_SESSION_IMPL *session); -extern int __wt_las_cursor_open(WT_SESSION_IMPL *session, WT_CURSOR **cursorp); -extern int __wt_las_cursor( WT_SESSION_IMPL *session, WT_CURSOR **cursorp, uint32_t *session_flags); -extern int __wt_las_cursor_close( WT_SESSION_IMPL *session, WT_CURSOR **cursorp, uint32_t session_flags); -extern int __wt_las_sweep(WT_SESSION_IMPL *session); +extern int __wt_las_cursor_open(WT_SESSION_IMPL *session, WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_las_cursor( WT_SESSION_IMPL *session, WT_CURSOR **cursorp, uint32_t *session_flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_las_cursor_close( WT_SESSION_IMPL *session, WT_CURSOR **cursorp, uint32_t session_flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_las_sweep(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern uint32_t __wt_cksum(const void *chunk, size_t len); extern void __wt_cksum_init(void); -extern int __wt_config_initn( WT_SESSION_IMPL *session, WT_CONFIG *conf, const char *str, size_t len); -extern int __wt_config_init(WT_SESSION_IMPL *session, WT_CONFIG *conf, const char *str); -extern int __wt_config_subinit( WT_SESSION_IMPL *session, WT_CONFIG *conf, WT_CONFIG_ITEM *item); -extern int __wt_config_next(WT_CONFIG *conf, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value); -extern int __wt_config_get(WT_SESSION_IMPL *session, const char **cfg_arg, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value); -extern int __wt_config_gets(WT_SESSION_IMPL *session, const char **cfg, const char *key, WT_CONFIG_ITEM *value); -extern int __wt_config_gets_none(WT_SESSION_IMPL *session, const char **cfg, const char *key, WT_CONFIG_ITEM *value); -extern int __wt_config_getone(WT_SESSION_IMPL *session, const char *config, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value); -extern int __wt_config_getones(WT_SESSION_IMPL *session, const char *config, const char *key, WT_CONFIG_ITEM *value); -extern int __wt_config_getones_none(WT_SESSION_IMPL *session, const char *config, const char *key, WT_CONFIG_ITEM *value); -extern int __wt_config_gets_def(WT_SESSION_IMPL *session, const char **cfg, const char *key, int def, WT_CONFIG_ITEM *value); -extern int __wt_config_subgetraw(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *cfg, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value); -extern int __wt_config_subgets(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *cfg, const char *key, WT_CONFIG_ITEM *value); +extern int __wt_config_initn( WT_SESSION_IMPL *session, WT_CONFIG *conf, const char *str, size_t len) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_init(WT_SESSION_IMPL *session, WT_CONFIG *conf, const char *str) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_subinit( WT_SESSION_IMPL *session, WT_CONFIG *conf, WT_CONFIG_ITEM *item) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_next(WT_CONFIG *conf, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_get(WT_SESSION_IMPL *session, const char **cfg_arg, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_gets(WT_SESSION_IMPL *session, const char **cfg, const char *key, WT_CONFIG_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_gets_none(WT_SESSION_IMPL *session, const char **cfg, const char *key, WT_CONFIG_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_getone(WT_SESSION_IMPL *session, const char *config, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_getones(WT_SESSION_IMPL *session, const char *config, const char *key, WT_CONFIG_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_getones_none(WT_SESSION_IMPL *session, const char *config, const char *key, WT_CONFIG_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_gets_def(WT_SESSION_IMPL *session, const char **cfg, const char *key, int def, WT_CONFIG_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_subgetraw(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *cfg, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_subgets(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *cfg, const char *key, WT_CONFIG_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_conn_foc_discard(WT_SESSION_IMPL *session); -extern int __wt_configure_method(WT_SESSION_IMPL *session, const char *method, const char *uri, const char *config, const char *type, const char *check); -extern int __wt_config_check(WT_SESSION_IMPL *session, const WT_CONFIG_ENTRY *entry, const char *config, size_t config_len); -extern int __wt_config_collapse( WT_SESSION_IMPL *session, const char **cfg, char **config_ret); -extern int __wt_config_merge(WT_SESSION_IMPL *session, const char **cfg, const char *cfg_strip, const char **config_ret); -extern int __wt_conn_config_init(WT_SESSION_IMPL *session); +extern int __wt_configure_method(WT_SESSION_IMPL *session, const char *method, const char *uri, const char *config, const char *type, const char *check) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_check(WT_SESSION_IMPL *session, const WT_CONFIG_ENTRY *entry, const char *config, size_t config_len) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_collapse( WT_SESSION_IMPL *session, const char **cfg, char **config_ret) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_merge(WT_SESSION_IMPL *session, const char **cfg, const char *cfg_strip, const char **config_ret) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_config_init(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_conn_config_discard(WT_SESSION_IMPL *session); extern const WT_CONFIG_ENTRY *__wt_conn_config_match(const char *method); -extern int __wt_ext_config_parser_open(WT_EXTENSION_API *wt_ext, WT_SESSION *wt_session, const char *config, size_t len, WT_CONFIG_PARSER **config_parserp); -extern int __wt_ext_config_get(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, WT_CONFIG_ARG *cfg_arg, const char *key, WT_CONFIG_ITEM *cval); -extern int __wt_config_upgrade(WT_SESSION_IMPL *session, WT_ITEM *buf); +extern int __wt_ext_config_parser_open(WT_EXTENSION_API *wt_ext, WT_SESSION *wt_session, const char *config, size_t len, WT_CONFIG_PARSER **config_parserp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_config_get(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, WT_CONFIG_ARG *cfg_arg, const char *key, WT_CONFIG_ITEM *cval) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_config_upgrade(WT_SESSION_IMPL *session, WT_ITEM *buf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern const char *__wt_wiredtiger_error(int error); -extern int __wt_collator_config(WT_SESSION_IMPL *session, const char *uri, WT_CONFIG_ITEM *cname, WT_CONFIG_ITEM *metadata, WT_COLLATOR **collatorp, int *ownp); -extern int __wt_conn_remove_collator(WT_SESSION_IMPL *session); -extern int __wt_compressor_config( WT_SESSION_IMPL *session, WT_CONFIG_ITEM *cval, WT_COMPRESSOR **compressorp); -extern int __wt_conn_remove_compressor(WT_SESSION_IMPL *session); -extern int __wt_conn_remove_data_source(WT_SESSION_IMPL *session); -extern int __wt_encryptor_config(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *cval, WT_CONFIG_ITEM *keyid, WT_CONFIG_ARG *cfg_arg, WT_KEYED_ENCRYPTOR **kencryptorp); -extern int __wt_conn_remove_encryptor(WT_SESSION_IMPL *session); -extern int __wt_extractor_config(WT_SESSION_IMPL *session, const char *uri, const char *config, WT_EXTRACTOR **extractorp, int *ownp); -extern int __wt_conn_remove_extractor(WT_SESSION_IMPL *session); -extern int __wt_verbose_config(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_cache_config(WT_SESSION_IMPL *session, bool reconfigure, const char *cfg[]); -extern int __wt_cache_create(WT_SESSION_IMPL *session, const char *cfg[]); +extern int __wt_collator_config(WT_SESSION_IMPL *session, const char *uri, WT_CONFIG_ITEM *cname, WT_CONFIG_ITEM *metadata, WT_COLLATOR **collatorp, int *ownp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_remove_collator(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_compressor_config( WT_SESSION_IMPL *session, WT_CONFIG_ITEM *cval, WT_COMPRESSOR **compressorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_remove_compressor(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_remove_data_source(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_encryptor_config(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *cval, WT_CONFIG_ITEM *keyid, WT_CONFIG_ARG *cfg_arg, WT_KEYED_ENCRYPTOR **kencryptorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_remove_encryptor(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_extractor_config(WT_SESSION_IMPL *session, const char *uri, const char *config, WT_EXTRACTOR **extractorp, int *ownp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_remove_extractor(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_verbose_config(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cache_config(WT_SESSION_IMPL *session, bool reconfigure, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cache_create(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_cache_stats_update(WT_SESSION_IMPL *session); -extern int __wt_cache_destroy(WT_SESSION_IMPL *session); -extern int __wt_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg); -extern int __wt_conn_cache_pool_open(WT_SESSION_IMPL *session); -extern int __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session); +extern int __wt_cache_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_cache_pool_open(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern WT_THREAD_RET __wt_cache_pool_server(void *arg); -extern int __wt_checkpoint_server_create(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_checkpoint_server_destroy(WT_SESSION_IMPL *session); -extern int __wt_checkpoint_signal(WT_SESSION_IMPL *session, wt_off_t logsize); -extern int __wt_conn_dhandle_find( WT_SESSION_IMPL *session, const char *uri, const char *checkpoint); -extern int __wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, bool final, bool force); -extern int __wt_conn_btree_open( WT_SESSION_IMPL *session, const char *cfg[], uint32_t flags); -extern int __wt_conn_btree_apply(WT_SESSION_IMPL *session, const char *uri, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[]); -extern int __wt_conn_dhandle_close_all( WT_SESSION_IMPL *session, const char *uri, bool force); -extern int __wt_conn_dhandle_discard_single( WT_SESSION_IMPL *session, bool final, bool force); -extern int __wt_conn_dhandle_discard(WT_SESSION_IMPL *session); -extern int __wt_connection_init(WT_CONNECTION_IMPL *conn); -extern int __wt_connection_destroy(WT_CONNECTION_IMPL *conn); -extern int __wt_logmgr_reconfig(WT_SESSION_IMPL *session, const char **cfg); -extern int __wt_log_truncate_files( WT_SESSION_IMPL *session, WT_CURSOR *cursor, const char *cfg[]); -extern int __wt_log_wrlsn(WT_SESSION_IMPL *session, int *yield); -extern int __wt_logmgr_create(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_logmgr_open(WT_SESSION_IMPL *session); -extern int __wt_logmgr_destroy(WT_SESSION_IMPL *session); -extern int __wt_connection_open(WT_CONNECTION_IMPL *conn, const char *cfg[]); -extern int __wt_connection_close(WT_CONNECTION_IMPL *conn); -extern int __wt_connection_workers(WT_SESSION_IMPL *session, const char *cfg[]); +extern int __wt_checkpoint_server_create(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_checkpoint_server_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_checkpoint_signal(WT_SESSION_IMPL *session, wt_off_t logsize) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_dhandle_find( WT_SESSION_IMPL *session, const char *uri, const char *checkpoint) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, bool final, bool force) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_btree_open( WT_SESSION_IMPL *session, const char *cfg[], uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_btree_apply(WT_SESSION_IMPL *session, const char *uri, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_dhandle_close_all( WT_SESSION_IMPL *session, const char *uri, bool force) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_dhandle_discard_single( WT_SESSION_IMPL *session, bool final, bool force) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_conn_dhandle_discard(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_connection_init(WT_CONNECTION_IMPL *conn) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_connection_destroy(WT_CONNECTION_IMPL *conn) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logmgr_reconfig(WT_SESSION_IMPL *session, const char **cfg) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_truncate_files( WT_SESSION_IMPL *session, WT_CURSOR *cursor, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_log_wrlsn(WT_SESSION_IMPL *session, int *yield); +extern int __wt_logmgr_create(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logmgr_open(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logmgr_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_connection_open(WT_CONNECTION_IMPL *conn, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_connection_close(WT_CONNECTION_IMPL *conn) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_connection_workers(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_conn_stat_init(WT_SESSION_IMPL *session); -extern int __wt_statlog_log_one(WT_SESSION_IMPL *session); -extern int __wt_statlog_create(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_statlog_destroy(WT_SESSION_IMPL *session, bool is_close); -extern int __wt_sweep_config(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_sweep_create(WT_SESSION_IMPL *session); -extern int __wt_sweep_destroy(WT_SESSION_IMPL *session); -extern int __wt_curbackup_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR **cursorp); -extern int __wt_backup_file_remove(WT_SESSION_IMPL *session); -extern int __wt_curbulk_init(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, bool bitmap, bool skip_sort_check); -extern int __wt_curconfig_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR **cursorp); -extern int __wt_curds_open( WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_DATA_SOURCE *dsrc, WT_CURSOR **cursorp); -extern int __wt_curdump_create(WT_CURSOR *child, WT_CURSOR *owner, WT_CURSOR **cursorp); -extern int __wt_curfile_update_check(WT_CURSOR *cursor); -extern int __wt_curfile_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp); -extern int __wt_curindex_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp); -extern int __wt_curjoin_joined(WT_CURSOR *cursor); -extern int __wt_curjoin_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp); -extern int __wt_curjoin_join(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, WT_INDEX *idx, WT_CURSOR *ref_cursor, uint8_t flags, uint8_t range, uint64_t count, uint32_t bloom_bit_count, uint32_t bloom_hash_count); -extern int __wt_json_alloc_unpack(WT_SESSION_IMPL *session, const void *buffer, size_t size, const char *fmt, WT_CURSOR_JSON *json, bool iskey, va_list ap); +extern int __wt_statlog_log_one(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_statlog_create(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_statlog_destroy(WT_SESSION_IMPL *session, bool is_close) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_sweep_config(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_sweep_create(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_sweep_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curbackup_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_backup_file_remove(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curbulk_init(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, bool bitmap, bool skip_sort_check) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curconfig_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curds_open( WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_DATA_SOURCE *dsrc, WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curdump_create(WT_CURSOR *child, WT_CURSOR *owner, WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curfile_update_check(WT_CURSOR *cursor) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curfile_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curindex_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curjoin_joined(WT_CURSOR *cursor) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curjoin_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curjoin_join(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, WT_INDEX *idx, WT_CURSOR *ref_cursor, uint8_t flags, uint8_t range, uint64_t count, uint32_t bloom_bit_count, uint32_t bloom_hash_count) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_json_alloc_unpack(WT_SESSION_IMPL *session, const void *buffer, size_t size, const char *fmt, WT_CURSOR_JSON *json, bool iskey, va_list ap) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_json_close(WT_SESSION_IMPL *session, WT_CURSOR *cursor); extern size_t __wt_json_unpack_char(u_char ch, u_char *buf, size_t bufsz, bool force_unicode); -extern int __wt_json_column_init(WT_CURSOR *cursor, const char *keyformat, const WT_CONFIG_ITEM *idxconf, const WT_CONFIG_ITEM *colconf); -extern int __wt_json_token(WT_SESSION *wt_session, const char *src, int *toktype, const char **tokstart, size_t *toklen); +extern int __wt_json_column_init(WT_CURSOR *cursor, const char *keyformat, const WT_CONFIG_ITEM *idxconf, const WT_CONFIG_ITEM *colconf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_json_token(WT_SESSION *wt_session, const char *src, int *toktype, const char **tokstart, size_t *toklen) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern const char *__wt_json_tokname(int toktype); -extern int __wt_json_to_item(WT_SESSION_IMPL *session, const char *jstr, const char *format, WT_CURSOR_JSON *json, bool iskey, WT_ITEM *item); +extern int __wt_json_to_item(WT_SESSION_IMPL *session, const char *jstr, const char *format, WT_CURSOR_JSON *json, bool iskey, WT_ITEM *item) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern ssize_t __wt_json_strlen(const char *src, size_t srclen); -extern int __wt_json_strncpy(WT_SESSION *wt_session, char **pdst, size_t dstlen, const char *src, size_t srclen); -extern int __wt_curlog_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR **cursorp); -extern int __wt_schema_create_final( WT_SESSION_IMPL *session, char *cfg_arg[], char **value_ret); -extern int __wt_curmetadata_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp); +extern int __wt_json_strncpy(WT_SESSION *wt_session, char **pdst, size_t dstlen, const char *src, size_t srclen) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curlog_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curmetadata_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_curstat_dsrc_final(WT_CURSOR_STAT *cst); -extern int __wt_curstat_init(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *curjoin, const char *cfg[], WT_CURSOR_STAT *cst); -extern int __wt_curstat_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *other, const char *cfg[], WT_CURSOR **cursorp); -extern int __wt_cursor_noop(WT_CURSOR *cursor); -extern int __wt_cursor_notsup(WT_CURSOR *cursor); -extern int __wt_cursor_get_value_notsup(WT_CURSOR *cursor, ...); +extern int __wt_curstat_init(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *curjoin, const char *cfg[], WT_CURSOR_STAT *cst) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curstat_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *other, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_noop(WT_CURSOR *cursor) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_notsup(WT_CURSOR *cursor) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_get_value_notsup(WT_CURSOR *cursor, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_cursor_set_key_notsup(WT_CURSOR *cursor, ...); extern void __wt_cursor_set_value_notsup(WT_CURSOR *cursor, ...); -extern int __wt_cursor_compare_notsup(WT_CURSOR *a, WT_CURSOR *b, int *cmpp); -extern int __wt_cursor_equals_notsup(WT_CURSOR *cursor, WT_CURSOR *other, int *equalp); -extern int __wt_cursor_search_near_notsup(WT_CURSOR *cursor, int *exact); -extern int __wt_cursor_reconfigure_notsup(WT_CURSOR *cursor, const char *config); +extern int __wt_cursor_compare_notsup(WT_CURSOR *a, WT_CURSOR *b, int *cmpp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_equals_notsup(WT_CURSOR *cursor, WT_CURSOR *other, int *equalp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_search_near_notsup(WT_CURSOR *cursor, int *exact) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_reconfigure_notsup(WT_CURSOR *cursor, const char *config) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_cursor_set_notsup(WT_CURSOR *cursor); -extern int __wt_cursor_kv_not_set(WT_CURSOR *cursor, bool key); -extern int __wt_cursor_get_key(WT_CURSOR *cursor, ...); +extern int __wt_cursor_kv_not_set(WT_CURSOR *cursor, bool key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_get_key(WT_CURSOR *cursor, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_cursor_set_key(WT_CURSOR *cursor, ...); -extern int __wt_cursor_get_raw_key(WT_CURSOR *cursor, WT_ITEM *key); +extern int __wt_cursor_get_raw_key(WT_CURSOR *cursor, WT_ITEM *key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_cursor_set_raw_key(WT_CURSOR *cursor, WT_ITEM *key); -extern int __wt_cursor_get_raw_value(WT_CURSOR *cursor, WT_ITEM *value); +extern int __wt_cursor_get_raw_value(WT_CURSOR *cursor, WT_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_cursor_set_raw_value(WT_CURSOR *cursor, WT_ITEM *value); -extern int __wt_cursor_get_keyv(WT_CURSOR *cursor, uint32_t flags, va_list ap); +extern int __wt_cursor_get_keyv(WT_CURSOR *cursor, uint32_t flags, va_list ap) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_cursor_set_keyv(WT_CURSOR *cursor, uint32_t flags, va_list ap); -extern int __wt_cursor_get_value(WT_CURSOR *cursor, ...); -extern int __wt_cursor_get_valuev(WT_CURSOR *cursor, va_list ap); +extern int __wt_cursor_get_value(WT_CURSOR *cursor, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_get_valuev(WT_CURSOR *cursor, va_list ap) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_cursor_set_value(WT_CURSOR *cursor, ...); extern void __wt_cursor_set_valuev(WT_CURSOR *cursor, va_list ap); -extern int __wt_cursor_close(WT_CURSOR *cursor); -extern int __wt_cursor_equals(WT_CURSOR *cursor, WT_CURSOR *other, int *equalp); -extern int __wt_cursor_reconfigure(WT_CURSOR *cursor, const char *config); -extern int __wt_cursor_dup_position(WT_CURSOR *to_dup, WT_CURSOR *cursor); -extern int __wt_cursor_init(WT_CURSOR *cursor, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp); -extern int __wt_apply_single_idx(WT_SESSION_IMPL *session, WT_INDEX *idx, WT_CURSOR *cur, WT_CURSOR_TABLE *ctable, int (*f)(WT_CURSOR *)); -extern int __wt_curtable_get_key(WT_CURSOR *cursor, ...); -extern int __wt_curtable_get_value(WT_CURSOR *cursor, ...); +extern int __wt_cursor_close(WT_CURSOR *cursor) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_equals(WT_CURSOR *cursor, WT_CURSOR *other, int *equalp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_reconfigure(WT_CURSOR *cursor, const char *config) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_dup_position(WT_CURSOR *to_dup, WT_CURSOR *cursor) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cursor_init(WT_CURSOR *cursor, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_apply_single_idx(WT_SESSION_IMPL *session, WT_INDEX *idx, WT_CURSOR *cur, WT_CURSOR_TABLE *ctable, int (*f)(WT_CURSOR *)) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curtable_get_key(WT_CURSOR *cursor, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curtable_get_value(WT_CURSOR *cursor, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_curtable_set_key(WT_CURSOR *cursor, ...); extern void __wt_curtable_set_value(WT_CURSOR *cursor, ...); -extern int __wt_table_range_truncate(WT_CURSOR_TABLE *start, WT_CURSOR_TABLE *stop); -extern int __wt_curtable_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp); -extern int __wt_evict_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop); +extern int __wt_table_range_truncate(WT_CURSOR_TABLE *start, WT_CURSOR_TABLE *stop) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curtable_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_evict_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_evict_list_clear_page(WT_SESSION_IMPL *session, WT_REF *ref); -extern int __wt_evict_server_wake(WT_SESSION_IMPL *session); -extern int __wt_evict_create(WT_SESSION_IMPL *session); -extern int __wt_evict_destroy(WT_SESSION_IMPL *session); -extern int __wt_evict_file_exclusive_on(WT_SESSION_IMPL *session); +extern void __wt_evict_server_wake(WT_SESSION_IMPL *session); +extern int __wt_evict_thread_run(WT_SESSION_IMPL *session, WT_THREAD *thread) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_evict_create(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_evict_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_evict_file_exclusive_on(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_evict_file_exclusive_off(WT_SESSION_IMPL *session); -extern int __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full); -extern int __wt_page_evict_soon(WT_SESSION_IMPL *session, WT_REF *ref); +extern int __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern bool __wt_page_evict_urgent(WT_SESSION_IMPL *session, WT_REF *ref); extern void __wt_evict_priority_set(WT_SESSION_IMPL *session, uint64_t v); extern void __wt_evict_priority_clear(WT_SESSION_IMPL *session); -extern int __wt_cache_dump(WT_SESSION_IMPL *session, const char *ofile); -extern int __wt_page_release_evict(WT_SESSION_IMPL *session, WT_REF *ref); -extern int __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool closing); -extern int __wt_log_ckpt(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn); -extern int __wt_log_flush_lsn(WT_SESSION_IMPL *session, WT_LSN *lsn, bool start); -extern int __wt_log_background(WT_SESSION_IMPL *session, WT_LSN *lsn); -extern int __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn); -extern int __wt_log_needs_recovery(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn, bool *recp); +extern int __wt_cache_dump(WT_SESSION_IMPL *session, const char *ofile) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_page_release_evict(WT_SESSION_IMPL *session, WT_REF *ref) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool closing) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_log_ckpt(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn); +extern int __wt_log_flush_lsn(WT_SESSION_IMPL *session, WT_LSN *lsn, bool start) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_log_background(WT_SESSION_IMPL *session, WT_LSN *lsn); +extern int __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_needs_recovery(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn, bool *recp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_log_written_reset(WT_SESSION_IMPL *session); -extern int __wt_log_get_all_files(WT_SESSION_IMPL *session, char ***filesp, u_int *countp, uint32_t *maxid, bool active_only); -extern int __wt_log_extract_lognum( WT_SESSION_IMPL *session, const char *name, uint32_t *id); -extern int __wt_log_acquire(WT_SESSION_IMPL *session, uint64_t recsize, WT_LOGSLOT *slot); -extern int __wt_log_allocfile( WT_SESSION_IMPL *session, uint32_t lognum, const char *dest); -extern int __wt_log_remove(WT_SESSION_IMPL *session, const char *file_prefix, uint32_t lognum); -extern int __wt_log_open(WT_SESSION_IMPL *session); -extern int __wt_log_close(WT_SESSION_IMPL *session); -extern int __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep); -extern int __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags, int (*func)(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, WT_LSN *next_lsnp, void *cookie, int firstrecord), void *cookie); -extern int __wt_log_force_write(WT_SESSION_IMPL *session, bool retry, bool *did_work); -extern int __wt_log_write(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, uint32_t flags); -extern int __wt_log_vprintf(WT_SESSION_IMPL *session, const char *fmt, va_list ap); -extern int __wt_log_flush(WT_SESSION_IMPL *session, uint32_t flags); -extern int __wt_logrec_alloc(WT_SESSION_IMPL *session, size_t size, WT_ITEM **logrecp); +extern int __wt_log_get_all_files(WT_SESSION_IMPL *session, char ***filesp, u_int *countp, uint32_t *maxid, bool active_only) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_extract_lognum( WT_SESSION_IMPL *session, const char *name, uint32_t *id) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_acquire(WT_SESSION_IMPL *session, uint64_t recsize, WT_LOGSLOT *slot) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_allocfile( WT_SESSION_IMPL *session, uint32_t lognum, const char *dest) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_remove(WT_SESSION_IMPL *session, const char *file_prefix, uint32_t lognum) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_open(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_close(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags, int (*func)(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, WT_LSN *next_lsnp, void *cookie, int firstrecord), void *cookie) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_force_write(WT_SESSION_IMPL *session, bool retry, bool *did_work) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_write(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_vprintf(WT_SESSION_IMPL *session, const char *fmt, va_list ap) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_flush(WT_SESSION_IMPL *session, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logrec_alloc(WT_SESSION_IMPL *session, size_t size, WT_ITEM **logrecp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_logrec_free(WT_SESSION_IMPL *session, WT_ITEM **logrecp); -extern int __wt_logrec_read(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *rectypep); -extern int __wt_logop_read(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *optypep, uint32_t *opsizep); -extern int __wt_logop_col_put_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, uint64_t recno, WT_ITEM *value); -extern int __wt_logop_col_put_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, uint64_t *recnop, WT_ITEM *valuep); -extern int __wt_logop_col_put_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags); -extern int __wt_logop_col_remove_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, uint64_t recno); -extern int __wt_logop_col_remove_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, uint64_t *recnop); -extern int __wt_logop_col_remove_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags); -extern int __wt_logop_col_truncate_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, uint64_t start, uint64_t stop); -extern int __wt_logop_col_truncate_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, uint64_t *startp, uint64_t *stopp); -extern int __wt_logop_col_truncate_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags); -extern int __wt_logop_row_put_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, WT_ITEM *key, WT_ITEM *value); -extern int __wt_logop_row_put_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, WT_ITEM *keyp, WT_ITEM *valuep); -extern int __wt_logop_row_put_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags); -extern int __wt_logop_row_remove_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, WT_ITEM *key); -extern int __wt_logop_row_remove_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, WT_ITEM *keyp); -extern int __wt_logop_row_remove_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags); -extern int __wt_logop_row_truncate_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, WT_ITEM *start, WT_ITEM *stop, uint32_t mode); -extern int __wt_logop_row_truncate_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, WT_ITEM *startp, WT_ITEM *stopp, uint32_t *modep); -extern int __wt_logop_row_truncate_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags); -extern int __wt_txn_op_printlog(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags); +extern int __wt_logrec_read(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *rectypep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_read(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *optypep, uint32_t *opsizep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_col_put_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, uint64_t recno, WT_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_col_put_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, uint64_t *recnop, WT_ITEM *valuep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_col_put_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_col_remove_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, uint64_t recno) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_col_remove_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, uint64_t *recnop) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_col_remove_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_col_truncate_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, uint64_t start, uint64_t stop) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_col_truncate_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, uint64_t *startp, uint64_t *stopp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_col_truncate_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_row_put_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, WT_ITEM *key, WT_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_row_put_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, WT_ITEM *keyp, WT_ITEM *valuep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_row_put_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_row_remove_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, WT_ITEM *key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_row_remove_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, WT_ITEM *keyp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_row_remove_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_row_truncate_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, WT_ITEM *start, WT_ITEM *stop, uint32_t mode) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_row_truncate_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, WT_ITEM *startp, WT_ITEM *stopp, uint32_t *modep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_logop_row_truncate_print(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_op_printlog(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_log_slot_activate(WT_SESSION_IMPL *session, WT_LOGSLOT *slot); -extern int __wt_log_slot_switch( WT_SESSION_IMPL *session, WT_MYSLOT *myslot, bool retry, bool forced); -extern int __wt_log_slot_new(WT_SESSION_IMPL *session); -extern int __wt_log_slot_init(WT_SESSION_IMPL *session); -extern int __wt_log_slot_destroy(WT_SESSION_IMPL *session); +extern int __wt_log_slot_switch( WT_SESSION_IMPL *session, WT_MYSLOT *myslot, bool retry, bool forced) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_slot_new(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_slot_init(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_log_slot_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_log_slot_join(WT_SESSION_IMPL *session, uint64_t mysize, uint32_t flags, WT_MYSLOT *myslot); extern int64_t __wt_log_slot_release(WT_SESSION_IMPL *session, WT_MYSLOT *myslot, int64_t size); extern void __wt_log_slot_free(WT_SESSION_IMPL *session, WT_LOGSLOT *slot); -extern int __wt_clsm_request_switch(WT_CURSOR_LSM *clsm); -extern int __wt_clsm_await_switch(WT_CURSOR_LSM *clsm); -extern int __wt_clsm_init_merge( WT_CURSOR *cursor, u_int start_chunk, uint32_t start_id, u_int nchunks); -extern int __wt_clsm_close(WT_CURSOR *cursor); -extern int __wt_clsm_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp); -extern int __wt_clsm_open_bulk(WT_CURSOR_LSM *clsm, const char *cfg[]); -extern int __wt_lsm_manager_config(WT_SESSION_IMPL *session, const char **cfg); -extern int __wt_lsm_manager_reconfig(WT_SESSION_IMPL *session, const char **cfg); -extern int __wt_lsm_manager_start(WT_SESSION_IMPL *session); +extern int __wt_clsm_request_switch(WT_CURSOR_LSM *clsm) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_clsm_await_switch(WT_CURSOR_LSM *clsm) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_clsm_init_merge( WT_CURSOR *cursor, u_int start_chunk, uint32_t start_id, u_int nchunks) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_clsm_close(WT_CURSOR *cursor) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_clsm_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_clsm_open_bulk(WT_CURSOR_LSM *clsm, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_manager_config(WT_SESSION_IMPL *session, const char **cfg) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_manager_reconfig(WT_SESSION_IMPL *session, const char **cfg) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_manager_start(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_lsm_manager_free_work_unit( WT_SESSION_IMPL *session, WT_LSM_WORK_UNIT *entry); -extern int __wt_lsm_manager_destroy(WT_SESSION_IMPL *session); -extern int __wt_lsm_manager_clear_tree( WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); -extern int __wt_lsm_manager_pop_entry( WT_SESSION_IMPL *session, uint32_t type, WT_LSM_WORK_UNIT **entryp); -extern int __wt_lsm_manager_push_entry(WT_SESSION_IMPL *session, uint32_t type, uint32_t flags, WT_LSM_TREE *lsm_tree); -extern int __wt_lsm_merge_update_tree(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int start_chunk, u_int nchunks, WT_LSM_CHUNK *chunk); -extern int __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id); -extern int __wt_lsm_meta_read(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); -extern int __wt_lsm_meta_write(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); -extern int __wt_curstat_lsm_init( WT_SESSION_IMPL *session, const char *uri, WT_CURSOR_STAT *cst); -extern int __wt_lsm_tree_close_all(WT_SESSION_IMPL *session); -extern int __wt_lsm_tree_bloom_name(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, uint32_t id, const char **retp); -extern int __wt_lsm_tree_chunk_name(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, uint32_t id, const char **retp); -extern int __wt_lsm_tree_set_chunk_size( WT_SESSION_IMPL *session, WT_LSM_CHUNK *chunk); -extern int __wt_lsm_tree_setup_chunk( WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, WT_LSM_CHUNK *chunk); -extern int __wt_lsm_tree_setup_bloom( WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, WT_LSM_CHUNK *chunk); -extern int __wt_lsm_tree_create(WT_SESSION_IMPL *session, const char *uri, bool exclusive, const char *config); -extern int __wt_lsm_tree_get(WT_SESSION_IMPL *session, const char *uri, bool exclusive, WT_LSM_TREE **treep); +extern int __wt_lsm_manager_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_manager_clear_tree( WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_manager_pop_entry( WT_SESSION_IMPL *session, uint32_t type, WT_LSM_WORK_UNIT **entryp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_manager_push_entry(WT_SESSION_IMPL *session, uint32_t type, uint32_t flags, WT_LSM_TREE *lsm_tree) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_merge_update_tree(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int start_chunk, u_int nchunks, WT_LSM_CHUNK *chunk) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_meta_read(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_meta_write(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curstat_lsm_init( WT_SESSION_IMPL *session, const char *uri, WT_CURSOR_STAT *cst) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_close_all(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_bloom_name(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, uint32_t id, const char **retp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_chunk_name(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, uint32_t id, const char **retp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_set_chunk_size( WT_SESSION_IMPL *session, WT_LSM_CHUNK *chunk) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_setup_chunk( WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, WT_LSM_CHUNK *chunk) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_setup_bloom( WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, WT_LSM_CHUNK *chunk) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_create(WT_SESSION_IMPL *session, const char *uri, bool exclusive, const char *config) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_get(WT_SESSION_IMPL *session, const char *uri, bool exclusive, WT_LSM_TREE **treep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_lsm_tree_release(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); extern void __wt_lsm_tree_throttle( WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, bool decrease_only); -extern int __wt_lsm_tree_switch(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); -extern int __wt_lsm_tree_retire_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int start_chunk, u_int nchunks); -extern int __wt_lsm_tree_drop( WT_SESSION_IMPL *session, const char *name, const char *cfg[]); -extern int __wt_lsm_tree_rename(WT_SESSION_IMPL *session, const char *olduri, const char *newuri, const char *cfg[]); -extern int __wt_lsm_tree_truncate( WT_SESSION_IMPL *session, const char *name, const char *cfg[]); -extern int __wt_lsm_tree_readlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); -extern int __wt_lsm_tree_readunlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); -extern int __wt_lsm_tree_writelock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); -extern int __wt_lsm_tree_writeunlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); -extern int __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp); -extern int __wt_lsm_tree_worker(WT_SESSION_IMPL *session, const char *uri, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[], uint32_t open_flags); -extern int __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, bool force, WT_LSM_CHUNK **chunkp); -extern int __wt_lsm_work_switch( WT_SESSION_IMPL *session, WT_LSM_WORK_UNIT **entryp, bool *ran); -extern int __wt_lsm_work_bloom(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); -extern int __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, WT_LSM_CHUNK *chunk); -extern int __wt_lsm_free_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); -extern int __wt_lsm_worker_start(WT_SESSION_IMPL *session, WT_LSM_WORKER_ARGS *args); -extern int __wt_meta_apply_all(WT_SESSION_IMPL *session, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[]); -extern int __wt_meta_checkpoint(WT_SESSION_IMPL *session, const char *fname, const char *checkpoint, WT_CKPT *ckpt); -extern int __wt_meta_checkpoint_last_name( WT_SESSION_IMPL *session, const char *fname, const char **namep); -extern int __wt_meta_checkpoint_clear(WT_SESSION_IMPL *session, const char *fname); -extern int __wt_meta_ckptlist_get( WT_SESSION_IMPL *session, const char *fname, WT_CKPT **ckptbasep); -extern int __wt_meta_ckptlist_set(WT_SESSION_IMPL *session, const char *fname, WT_CKPT *ckptbase, WT_LSN *ckptlsn); +extern int __wt_lsm_tree_switch(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_retire_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int start_chunk, u_int nchunks) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_drop( WT_SESSION_IMPL *session, const char *name, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_rename(WT_SESSION_IMPL *session, const char *olduri, const char *newuri, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_truncate( WT_SESSION_IMPL *session, const char *name, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_lsm_tree_readlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); +extern void __wt_lsm_tree_readunlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); +extern void __wt_lsm_tree_writelock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); +extern void __wt_lsm_tree_writeunlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); +extern int __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_tree_worker(WT_SESSION_IMPL *session, const char *uri, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[], uint32_t open_flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, bool force, WT_LSM_CHUNK **chunkp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_work_switch( WT_SESSION_IMPL *session, WT_LSM_WORK_UNIT **entryp, bool *ran) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_work_bloom(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, WT_LSM_CHUNK *chunk) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_free_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_lsm_worker_start(WT_SESSION_IMPL *session, WT_LSM_WORKER_ARGS *args) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_apply_all(WT_SESSION_IMPL *session, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_checkpoint(WT_SESSION_IMPL *session, const char *fname, const char *checkpoint, WT_CKPT *ckpt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_checkpoint_last_name( WT_SESSION_IMPL *session, const char *fname, const char **namep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_checkpoint_clear(WT_SESSION_IMPL *session, const char *fname) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_ckptlist_get( WT_SESSION_IMPL *session, const char *fname, WT_CKPT **ckptbasep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_ckptlist_set(WT_SESSION_IMPL *session, const char *fname, WT_CKPT *ckptbase, WT_LSN *ckptlsn) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_meta_ckptlist_free(WT_SESSION_IMPL *session, WT_CKPT *ckptbase); extern void __wt_meta_checkpoint_free(WT_SESSION_IMPL *session, WT_CKPT *ckpt); -extern int __wt_ext_metadata_insert(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *key, const char *value); -extern int __wt_ext_metadata_remove( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *key); -extern int __wt_ext_metadata_search(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *key, char **valuep); -extern int __wt_ext_metadata_update(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *key, const char *value); -extern int __wt_metadata_get_ckptlist( WT_SESSION *session, const char *name, WT_CKPT **ckptbasep); +extern int __wt_ext_metadata_insert(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *key, const char *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_metadata_remove( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_metadata_search(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *key, char **valuep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_metadata_update(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *key, const char *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_metadata_get_ckptlist( WT_SESSION *session, const char *name, WT_CKPT **ckptbasep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_metadata_free_ckptlist(WT_SESSION *session, WT_CKPT *ckptbase); -extern int __wt_metadata_cursor_open( WT_SESSION_IMPL *session, const char *config, WT_CURSOR **cursorp); -extern int __wt_metadata_cursor(WT_SESSION_IMPL *session, WT_CURSOR **cursorp); -extern int __wt_metadata_cursor_release(WT_SESSION_IMPL *session, WT_CURSOR **cursorp); -extern int __wt_metadata_insert( WT_SESSION_IMPL *session, const char *key, const char *value); -extern int __wt_metadata_update( WT_SESSION_IMPL *session, const char *key, const char *value); -extern int __wt_metadata_remove(WT_SESSION_IMPL *session, const char *key); -extern int __wt_metadata_search(WT_SESSION_IMPL *session, const char *key, char **valuep); +extern int __wt_metadata_cursor_open( WT_SESSION_IMPL *session, const char *config, WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_metadata_cursor(WT_SESSION_IMPL *session, WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_metadata_cursor_release(WT_SESSION_IMPL *session, WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_metadata_insert( WT_SESSION_IMPL *session, const char *key, const char *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_metadata_update( WT_SESSION_IMPL *session, const char *key, const char *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_metadata_remove(WT_SESSION_IMPL *session, const char *key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_metadata_search(WT_SESSION_IMPL *session, const char *key, char **valuep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_meta_track_discard(WT_SESSION_IMPL *session); -extern int __wt_meta_track_on(WT_SESSION_IMPL *session); -extern int __wt_meta_track_off(WT_SESSION_IMPL *session, bool need_sync, bool unroll); -extern int __wt_meta_track_sub_on(WT_SESSION_IMPL *session); -extern int __wt_meta_track_sub_off(WT_SESSION_IMPL *session); -extern int __wt_meta_track_checkpoint(WT_SESSION_IMPL *session); -extern int __wt_meta_track_insert(WT_SESSION_IMPL *session, const char *key); -extern int __wt_meta_track_update(WT_SESSION_IMPL *session, const char *key); -extern int __wt_meta_track_fileop( WT_SESSION_IMPL *session, const char *olduri, const char *newuri); -extern int __wt_meta_track_drop( WT_SESSION_IMPL *session, const char *filename); -extern int __wt_meta_track_handle_lock(WT_SESSION_IMPL *session, bool created); -extern int __wt_meta_track_init(WT_SESSION_IMPL *session); -extern int __wt_meta_track_destroy(WT_SESSION_IMPL *session); -extern int __wt_turtle_init(WT_SESSION_IMPL *session); -extern int __wt_turtle_read(WT_SESSION_IMPL *session, const char *key, char **valuep); -extern int __wt_turtle_update(WT_SESSION_IMPL *session, const char *key, const char *value); -extern int __wt_filename(WT_SESSION_IMPL *session, const char *name, char **path); -extern int __wt_nfilename( WT_SESSION_IMPL *session, const char *name, size_t namelen, char **path); -extern int __wt_remove_if_exists(WT_SESSION_IMPL *session, const char *name, bool durable); -extern int __wt_copy_and_sync(WT_SESSION *wt_session, const char *from, const char *to); +extern int __wt_meta_track_on(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_track_off(WT_SESSION_IMPL *session, bool need_sync, bool unroll) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_track_sub_on(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_track_sub_off(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_track_checkpoint(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_track_insert(WT_SESSION_IMPL *session, const char *key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_track_update(WT_SESSION_IMPL *session, const char *key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_track_fileop( WT_SESSION_IMPL *session, const char *olduri, const char *newuri) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_track_drop( WT_SESSION_IMPL *session, const char *filename) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_track_handle_lock(WT_SESSION_IMPL *session, bool created) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_track_init(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_track_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_turtle_init(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_turtle_read(WT_SESSION_IMPL *session, const char *key, char **valuep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_turtle_update(WT_SESSION_IMPL *session, const char *key, const char *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_filename(WT_SESSION_IMPL *session, const char *name, char **path) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_nfilename( WT_SESSION_IMPL *session, const char *name, size_t namelen, char **path) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_remove_if_exists(WT_SESSION_IMPL *session, const char *name, bool durable) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_copy_and_sync(WT_SESSION *wt_session, const char *from, const char *to) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_abort(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn)); -extern int __wt_calloc(WT_SESSION_IMPL *session, size_t number, size_t size, void *retp); -extern int __wt_malloc(WT_SESSION_IMPL *session, size_t bytes_to_allocate, void *retp); -extern int __wt_realloc(WT_SESSION_IMPL *session, size_t *bytes_allocated_ret, size_t bytes_to_allocate, void *retp); -extern int __wt_realloc_noclear(WT_SESSION_IMPL *session, size_t *bytes_allocated_ret, size_t bytes_to_allocate, void *retp); -extern int __wt_realloc_aligned(WT_SESSION_IMPL *session, size_t *bytes_allocated_ret, size_t bytes_to_allocate, void *retp); -extern int __wt_strndup(WT_SESSION_IMPL *session, const void *str, size_t len, void *retp); +extern int __wt_calloc(WT_SESSION_IMPL *session, size_t number, size_t size, void *retp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_malloc(WT_SESSION_IMPL *session, size_t bytes_to_allocate, void *retp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_realloc(WT_SESSION_IMPL *session, size_t *bytes_allocated_ret, size_t bytes_to_allocate, void *retp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_realloc_noclear(WT_SESSION_IMPL *session, size_t *bytes_allocated_ret, size_t bytes_to_allocate, void *retp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_realloc_aligned(WT_SESSION_IMPL *session, size_t *bytes_allocated_ret, size_t bytes_to_allocate, void *retp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_strndup(WT_SESSION_IMPL *session, const void *str, size_t len, void *retp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_free_int(WT_SESSION_IMPL *session, const void *p_arg); -extern int __wt_errno(void); +extern int __wt_errno(void) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern const char *__wt_strerror(WT_SESSION_IMPL *session, int error, char *errbuf, size_t errlen); -extern int __wt_ext_map_windows_error( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, uint32_t windows_error); +extern int __wt_ext_map_windows_error( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, uint32_t windows_error) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern bool __wt_handle_is_open(WT_SESSION_IMPL *session, const char *name); -extern int __wt_open(WT_SESSION_IMPL *session, const char *name, WT_FS_OPEN_FILE_TYPE file_type, u_int flags, WT_FH **fhp); -extern int __wt_close(WT_SESSION_IMPL *session, WT_FH **fhp); -extern int __wt_close_connection_close(WT_SESSION_IMPL *session); -extern int __wt_os_inmemory(WT_SESSION_IMPL *session); -extern int __wt_fopen(WT_SESSION_IMPL *session, const char *name, uint32_t open_flags, uint32_t flags, WT_FSTREAM **fstrp); -extern int __wt_os_stdio(WT_SESSION_IMPL *session); -extern int __wt_getopt( const char *progname, int nargc, char *const *nargv, const char *ostr); +extern int __wt_open(WT_SESSION_IMPL *session, const char *name, WT_FS_OPEN_FILE_TYPE file_type, u_int flags, WT_FH **fhp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_close(WT_SESSION_IMPL *session, WT_FH **fhp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_close_connection_close(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_os_inmemory(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_fopen(WT_SESSION_IMPL *session, const char *name, uint32_t open_flags, uint32_t flags, WT_FSTREAM **fstrp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_os_stdio(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_getopt( const char *progname, int nargc, char *const *nargv, const char *ostr) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern uint64_t __wt_strtouq(const char *nptr, char **endptr, int base); -extern int __wt_ext_struct_pack(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, void *buffer, size_t size, const char *fmt, ...); -extern int __wt_ext_struct_size(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, size_t *sizep, const char *fmt, ...); -extern int __wt_ext_struct_unpack(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const void *buffer, size_t size, const char *fmt, ...); -extern int __wt_struct_check(WT_SESSION_IMPL *session, const char *fmt, size_t len, bool *fixedp, uint32_t *fixed_lenp); -extern int __wt_struct_confchk(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *v); -extern int __wt_struct_size(WT_SESSION_IMPL *session, size_t *sizep, const char *fmt, ...); -extern int __wt_struct_pack(WT_SESSION_IMPL *session, void *buffer, size_t size, const char *fmt, ...); -extern int __wt_struct_unpack(WT_SESSION_IMPL *session, const void *buffer, size_t size, const char *fmt, ...); -extern int __wt_struct_repack(WT_SESSION_IMPL *session, const char *infmt, const char *outfmt, const WT_ITEM *inbuf, WT_ITEM *outbuf); -extern int __wt_ext_pack_start(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *format, void *buffer, size_t size, WT_PACK_STREAM **psp); -extern int __wt_ext_unpack_start(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *format, const void *buffer, size_t size, WT_PACK_STREAM **psp); -extern int __wt_ext_pack_close(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, size_t *usedp); -extern int __wt_ext_pack_item(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, WT_ITEM *item); -extern int __wt_ext_pack_int(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, int64_t i); -extern int __wt_ext_pack_str(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, const char *s); -extern int __wt_ext_pack_uint(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, uint64_t u); -extern int __wt_ext_unpack_item(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, WT_ITEM *item); -extern int __wt_ext_unpack_int(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, int64_t *ip); -extern int __wt_ext_unpack_str(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, const char **sp); -extern int __wt_ext_unpack_uint(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, uint64_t *up); -extern int __wt_ovfl_discard_add(WT_SESSION_IMPL *session, WT_PAGE *page, WT_CELL *cell); +extern int __wt_ext_struct_pack(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, void *buffer, size_t size, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_struct_size(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, size_t *sizep, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_struct_unpack(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const void *buffer, size_t size, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_struct_check(WT_SESSION_IMPL *session, const char *fmt, size_t len, bool *fixedp, uint32_t *fixed_lenp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_struct_confchk(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *v) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_struct_size(WT_SESSION_IMPL *session, size_t *sizep, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_struct_pack(WT_SESSION_IMPL *session, void *buffer, size_t size, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_struct_unpack(WT_SESSION_IMPL *session, const void *buffer, size_t size, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_struct_repack(WT_SESSION_IMPL *session, const char *infmt, const char *outfmt, const WT_ITEM *inbuf, WT_ITEM *outbuf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_pack_start(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *format, void *buffer, size_t size, WT_PACK_STREAM **psp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_unpack_start(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *format, const void *buffer, size_t size, WT_PACK_STREAM **psp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_pack_close(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, size_t *usedp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_pack_item(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, WT_ITEM *item) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_pack_int(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, int64_t i) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_pack_str(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, const char *s) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_pack_uint(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, uint64_t u) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_unpack_item(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, WT_ITEM *item) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_unpack_int(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, int64_t *ip) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_unpack_str(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, const char **sp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_unpack_uint(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, uint64_t *up) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ovfl_discard_add(WT_SESSION_IMPL *session, WT_PAGE *page, WT_CELL *cell) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_ovfl_discard_free(WT_SESSION_IMPL *session, WT_PAGE *page); -extern int __wt_ovfl_reuse_search(WT_SESSION_IMPL *session, WT_PAGE *page, uint8_t **addrp, size_t *addr_sizep, const void *value, size_t value_size); -extern int __wt_ovfl_reuse_add(WT_SESSION_IMPL *session, WT_PAGE *page, const uint8_t *addr, size_t addr_size, const void *value, size_t value_size); +extern int __wt_ovfl_reuse_search(WT_SESSION_IMPL *session, WT_PAGE *page, uint8_t **addrp, size_t *addr_sizep, const void *value, size_t value_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ovfl_reuse_add(WT_SESSION_IMPL *session, WT_PAGE *page, const uint8_t *addr, size_t addr_size, const void *value, size_t value_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_ovfl_reuse_free(WT_SESSION_IMPL *session, WT_PAGE *page); -extern int __wt_ovfl_txnc_search( WT_PAGE *page, const uint8_t *addr, size_t addr_size, WT_ITEM *store); -extern int __wt_ovfl_txnc_add(WT_SESSION_IMPL *session, WT_PAGE *page, const uint8_t *addr, size_t addr_size, const void *value, size_t value_size); +extern int __wt_ovfl_txnc_search( WT_PAGE *page, const uint8_t *addr, size_t addr_size, WT_ITEM *store) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ovfl_txnc_add(WT_SESSION_IMPL *session, WT_PAGE *page, const uint8_t *addr, size_t addr_size, const void *value, size_t value_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_ovfl_txnc_free(WT_SESSION_IMPL *session, WT_PAGE *page); -extern int __wt_ovfl_track_wrapup(WT_SESSION_IMPL *session, WT_PAGE *page); -extern int __wt_ovfl_track_wrapup_err(WT_SESSION_IMPL *session, WT_PAGE *page); -extern int __wt_reconcile(WT_SESSION_IMPL *session, WT_REF *ref, WT_SALVAGE_COOKIE *salvage, uint32_t flags); +extern int __wt_ovfl_track_wrapup(WT_SESSION_IMPL *session, WT_PAGE *page) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ovfl_track_wrapup_err(WT_SESSION_IMPL *session, WT_PAGE *page) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_reconcile(WT_SESSION_IMPL *session, WT_REF *ref, WT_SALVAGE_COOKIE *salvage, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern uint32_t __wt_split_page_size(WT_BTREE *btree, uint32_t maxpagesize); -extern int __wt_bulk_init(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk); -extern int __wt_bulk_wrapup(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk); -extern int __wt_bulk_insert_row(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk); -extern int __wt_bulk_insert_fix( WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, bool deleted); -extern int __wt_bulk_insert_fix_bitmap(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk); -extern int __wt_bulk_insert_var( WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, bool deleted); -extern int __wt_direct_io_size_check(WT_SESSION_IMPL *session, const char **cfg, const char *config_name, uint32_t *allocsizep); -extern int __wt_schema_colgroup_source(WT_SESSION_IMPL *session, WT_TABLE *table, const char *cgname, const char *config, WT_ITEM *buf); -extern int __wt_schema_index_source(WT_SESSION_IMPL *session, WT_TABLE *table, const char *idxname, const char *config, WT_ITEM *buf); -extern int __wt_schema_create( WT_SESSION_IMPL *session, const char *uri, const char *config); -extern int __wt_schema_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[]); -extern int __wt_schema_get_table(WT_SESSION_IMPL *session, const char *name, size_t namelen, bool ok_incomplete, WT_TABLE **tablep); +extern int __wt_bulk_init(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bulk_wrapup(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bulk_insert_row(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bulk_insert_fix( WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, bool deleted) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bulk_insert_fix_bitmap(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bulk_insert_var( WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, bool deleted) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_direct_io_size_check(WT_SESSION_IMPL *session, const char **cfg, const char *config_name, uint32_t *allocsizep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_colgroup_source(WT_SESSION_IMPL *session, WT_TABLE *table, const char *cgname, const char *config, WT_ITEM *buf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_index_source(WT_SESSION_IMPL *session, WT_TABLE *table, const char *idxname, const char *config, WT_ITEM *buf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_create( WT_SESSION_IMPL *session, const char *uri, const char *config) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_get_table(WT_SESSION_IMPL *session, const char *name, size_t namelen, bool ok_incomplete, WT_TABLE **tablep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_schema_release_table(WT_SESSION_IMPL *session, WT_TABLE *table); extern void __wt_schema_destroy_colgroup(WT_SESSION_IMPL *session, WT_COLGROUP **colgroupp); -extern int __wt_schema_destroy_index(WT_SESSION_IMPL *session, WT_INDEX **idxp); -extern int __wt_schema_destroy_table(WT_SESSION_IMPL *session, WT_TABLE **tablep); -extern int __wt_schema_remove_table(WT_SESSION_IMPL *session, WT_TABLE *table); -extern int __wt_schema_close_tables(WT_SESSION_IMPL *session); -extern int __wt_schema_colgroup_name(WT_SESSION_IMPL *session, WT_TABLE *table, const char *cgname, size_t len, WT_ITEM *buf); -extern int __wt_schema_open_colgroups(WT_SESSION_IMPL *session, WT_TABLE *table); -extern int __wt_schema_open_index(WT_SESSION_IMPL *session, WT_TABLE *table, const char *idxname, size_t len, WT_INDEX **indexp); -extern int __wt_schema_open_indices(WT_SESSION_IMPL *session, WT_TABLE *table); -extern int __wt_schema_get_colgroup(WT_SESSION_IMPL *session, const char *uri, bool quiet, WT_TABLE **tablep, WT_COLGROUP **colgroupp); -extern int __wt_schema_get_index(WT_SESSION_IMPL *session, const char *uri, bool quiet, WT_TABLE **tablep, WT_INDEX **indexp); -extern int __wt_schema_open_table(WT_SESSION_IMPL *session, const char *name, size_t namelen, bool ok_incomplete, WT_TABLE **tablep); -extern int __wt_schema_colcheck(WT_SESSION_IMPL *session, const char *key_format, const char *value_format, WT_CONFIG_ITEM *colconf, u_int *kcolsp, u_int *vcolsp); -extern int __wt_table_check(WT_SESSION_IMPL *session, WT_TABLE *table); -extern int __wt_struct_plan(WT_SESSION_IMPL *session, WT_TABLE *table, const char *columns, size_t len, bool value_only, WT_ITEM *plan); -extern int __wt_struct_reformat(WT_SESSION_IMPL *session, WT_TABLE *table, const char *columns, size_t len, const char *extra_cols, bool value_only, WT_ITEM *format); -extern int __wt_struct_truncate(WT_SESSION_IMPL *session, const char *input_fmt, u_int ncols, WT_ITEM *format); -extern int __wt_schema_project_in(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, va_list ap); -extern int __wt_schema_project_out(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, va_list ap); -extern int __wt_schema_project_slice(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, bool key_only, const char *vformat, WT_ITEM *value); -extern int __wt_schema_project_merge(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, const char *vformat, WT_ITEM *value); -extern int __wt_schema_rename(WT_SESSION_IMPL *session, const char *uri, const char *newuri, const char *cfg[]); -extern int __wt_curstat_colgroup_init(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR_STAT *cst); -extern int __wt_curstat_index_init(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR_STAT *cst); -extern int __wt_curstat_table_init(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR_STAT *cst); -extern int __wt_schema_truncate( WT_SESSION_IMPL *session, const char *uri, const char *cfg[]); -extern int __wt_range_truncate(WT_CURSOR *start, WT_CURSOR *stop); -extern int __wt_schema_range_truncate( WT_SESSION_IMPL *session, WT_CURSOR *start, WT_CURSOR *stop); +extern int __wt_schema_destroy_index(WT_SESSION_IMPL *session, WT_INDEX **idxp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_destroy_table(WT_SESSION_IMPL *session, WT_TABLE **tablep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_remove_table(WT_SESSION_IMPL *session, WT_TABLE *table) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_close_tables(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_colgroup_name(WT_SESSION_IMPL *session, WT_TABLE *table, const char *cgname, size_t len, WT_ITEM *buf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_open_colgroups(WT_SESSION_IMPL *session, WT_TABLE *table) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_open_index(WT_SESSION_IMPL *session, WT_TABLE *table, const char *idxname, size_t len, WT_INDEX **indexp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_open_indices(WT_SESSION_IMPL *session, WT_TABLE *table) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_get_colgroup(WT_SESSION_IMPL *session, const char *uri, bool quiet, WT_TABLE **tablep, WT_COLGROUP **colgroupp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_get_index(WT_SESSION_IMPL *session, const char *uri, bool quiet, WT_TABLE **tablep, WT_INDEX **indexp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_open_table(WT_SESSION_IMPL *session, const char *name, size_t namelen, bool ok_incomplete, WT_TABLE **tablep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_colcheck(WT_SESSION_IMPL *session, const char *key_format, const char *value_format, WT_CONFIG_ITEM *colconf, u_int *kcolsp, u_int *vcolsp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_table_check(WT_SESSION_IMPL *session, WT_TABLE *table) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_struct_plan(WT_SESSION_IMPL *session, WT_TABLE *table, const char *columns, size_t len, bool value_only, WT_ITEM *plan) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_struct_reformat(WT_SESSION_IMPL *session, WT_TABLE *table, const char *columns, size_t len, const char *extra_cols, bool value_only, WT_ITEM *format) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_struct_truncate(WT_SESSION_IMPL *session, const char *input_fmt, u_int ncols, WT_ITEM *format) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_project_in(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, va_list ap) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_project_out(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, va_list ap) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_project_slice(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, bool key_only, const char *vformat, WT_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_project_merge(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, const char *vformat, WT_ITEM *value) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_rename(WT_SESSION_IMPL *session, const char *uri, const char *newuri, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curstat_colgroup_init(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR_STAT *cst) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curstat_index_init(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR_STAT *cst) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_curstat_table_init(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR_STAT *cst) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_truncate( WT_SESSION_IMPL *session, const char *uri, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_range_truncate(WT_CURSOR *start, WT_CURSOR *stop) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_range_truncate( WT_SESSION_IMPL *session, WT_CURSOR *start, WT_CURSOR *stop) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern WT_DATA_SOURCE *__wt_schema_get_source(WT_SESSION_IMPL *session, const char *name); -extern int __wt_str_name_check(WT_SESSION_IMPL *session, const char *str); -extern int __wt_name_check(WT_SESSION_IMPL *session, const char *str, size_t len); -extern int __wt_schema_worker(WT_SESSION_IMPL *session, const char *uri, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[], uint32_t open_flags); -extern int __wt_session_notsup(WT_SESSION_IMPL *session); -extern int __wt_session_reset_cursors(WT_SESSION_IMPL *session, bool free_buffers); -extern int __wt_session_copy_values(WT_SESSION_IMPL *session); -extern int __wt_session_release_resources(WT_SESSION_IMPL *session); -extern int __wt_open_cursor(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp); -extern int __wt_session_create( WT_SESSION_IMPL *session, const char *uri, const char *config); -extern int __wt_session_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[]); -extern int __wt_session_range_truncate(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *start, WT_CURSOR *stop); +extern int __wt_str_name_check(WT_SESSION_IMPL *session, const char *str) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_name_check(WT_SESSION_IMPL *session, const char *str, size_t len) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_schema_worker(WT_SESSION_IMPL *session, const char *uri, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[], uint32_t open_flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_notsup(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_reset_cursors(WT_SESSION_IMPL *session, bool free_buffers) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_copy_values(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_release_resources(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_open_cursor(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_create( WT_SESSION_IMPL *session, const char *uri, const char *config) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_range_truncate(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *start, WT_CURSOR *stop) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern const char *__wt_session_strerror(WT_SESSION *wt_session, int error); -extern int __wt_open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const char *config, bool open_metadata, WT_SESSION_IMPL **sessionp); -extern int __wt_open_internal_session(WT_CONNECTION_IMPL *conn, const char *name, bool open_metadata, uint32_t session_flags, WT_SESSION_IMPL **sessionp); -extern int __wt_session_compact( WT_SESSION *wt_session, const char *uri, const char *config); -extern int __wt_session_compact_readonly( WT_SESSION *wt_session, const char *uri, const char *config); -extern int __wt_session_lock_dhandle( WT_SESSION_IMPL *session, uint32_t flags, bool *is_deadp); -extern int __wt_session_release_btree(WT_SESSION_IMPL *session); -extern int __wt_session_get_btree_ckpt(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], uint32_t flags); +extern int __wt_open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const char *config, bool open_metadata, WT_SESSION_IMPL **sessionp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_open_internal_session(WT_CONNECTION_IMPL *conn, const char *name, bool open_metadata, uint32_t session_flags, WT_SESSION_IMPL **sessionp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_compact( WT_SESSION *wt_session, const char *uri, const char *config) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_compact_readonly( WT_SESSION *wt_session, const char *uri, const char *config) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_lock_dhandle( WT_SESSION_IMPL *session, uint32_t flags, bool *is_deadp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_release_btree(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_get_btree_ckpt(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_session_close_cache(WT_SESSION_IMPL *session); -extern int __wt_session_get_btree(WT_SESSION_IMPL *session, const char *uri, const char *checkpoint, const char *cfg[], uint32_t flags); -extern int __wt_session_lock_checkpoint(WT_SESSION_IMPL *session, const char *checkpoint); -extern int __wt_salvage(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_cond_auto_alloc( WT_SESSION_IMPL *session, const char *name, bool is_signalled, uint64_t min, uint64_t max, WT_CONDVAR **condp); -extern int __wt_cond_auto_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond); -extern int __wt_cond_auto_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, bool progress, bool *signalled); -extern int __wt_cond_auto_wait( WT_SESSION_IMPL *session, WT_CONDVAR *cond, bool progress); -extern int __wt_cond_auto_destroy(WT_SESSION_IMPL *session, WT_CONDVAR **condp); -extern int __wt_decrypt(WT_SESSION_IMPL *session, WT_ENCRYPTOR *encryptor, size_t skip, WT_ITEM *in, WT_ITEM *out); -extern int __wt_encrypt(WT_SESSION_IMPL *session, WT_KEYED_ENCRYPTOR *kencryptor, size_t skip, WT_ITEM *in, WT_ITEM *out); +extern int __wt_session_get_btree(WT_SESSION_IMPL *session, const char *uri, const char *checkpoint, const char *cfg[], uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_session_lock_checkpoint(WT_SESSION_IMPL *session, const char *checkpoint) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_salvage(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cond_auto_alloc( WT_SESSION_IMPL *session, const char *name, bool is_signalled, uint64_t min, uint64_t max, WT_CONDVAR **condp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_cond_auto_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond); +extern void __wt_cond_auto_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, bool progress, bool *signalled); +extern void __wt_cond_auto_wait( WT_SESSION_IMPL *session, WT_CONDVAR *cond, bool progress); +extern int __wt_cond_auto_destroy(WT_SESSION_IMPL *session, WT_CONDVAR **condp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_decrypt(WT_SESSION_IMPL *session, WT_ENCRYPTOR *encryptor, size_t skip, WT_ITEM *in, WT_ITEM *out) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_encrypt(WT_SESSION_IMPL *session, WT_KEYED_ENCRYPTOR *kencryptor, size_t skip, WT_ITEM *in, WT_ITEM *out) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_encrypt_size(WT_SESSION_IMPL *session, WT_KEYED_ENCRYPTOR *kencryptor, size_t incoming_size, size_t *sizep); extern void __wt_event_handler_set(WT_SESSION_IMPL *session, WT_EVENT_HANDLER *handler); -extern int __wt_eventv(WT_SESSION_IMPL *session, bool msg_event, int error, const char *file_name, int line_number, const char *fmt, va_list ap); -extern void __wt_err(WT_SESSION_IMPL *session, int error, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))); -extern void __wt_errx(WT_SESSION_IMPL *session, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 2, 3))); -extern int __wt_ext_err_printf( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))); -extern int __wt_msg(WT_SESSION_IMPL *session, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 2, 3))); -extern int __wt_ext_msg_printf( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))); +extern int __wt_eventv(WT_SESSION_IMPL *session, bool msg_event, int error, const char *file_name, int line_number, const char *fmt, va_list ap) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_err(WT_SESSION_IMPL *session, int error, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((cold)) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))); +extern void __wt_errx(WT_SESSION_IMPL *session, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((cold)) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 2, 3))); +extern int __wt_ext_err_printf( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_msg(WT_SESSION_IMPL *session, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((cold)) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 2, 3))) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_msg_printf( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern const char *__wt_ext_strerror(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, int error); -extern int __wt_progress(WT_SESSION_IMPL *session, const char *s, uint64_t v); +extern int __wt_progress(WT_SESSION_IMPL *session, const char *s, uint64_t v) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_assert(WT_SESSION_IMPL *session, int error, const char *file_name, int line_number, const char *fmt, ...) + WT_GCC_FUNC_DECL_ATTRIBUTE((cold)) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 5, 6))) #ifdef HAVE_DIAGNOSTIC WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn)) #endif ; -extern int __wt_panic(WT_SESSION_IMPL *session); -extern int __wt_illegal_value(WT_SESSION_IMPL *session, const char *name); -extern int __wt_object_unsupported(WT_SESSION_IMPL *session, const char *uri); -extern int __wt_bad_object_type(WT_SESSION_IMPL *session, const char *uri); -extern int __wt_library_init(void); -extern int __wt_breakpoint(void); +extern int __wt_panic(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((cold)) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_illegal_value(WT_SESSION_IMPL *session, const char *name) WT_GCC_FUNC_DECL_ATTRIBUTE((cold)) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_object_unsupported(WT_SESSION_IMPL *session, const char *uri) WT_GCC_FUNC_DECL_ATTRIBUTE((cold)) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_bad_object_type(WT_SESSION_IMPL *session, const char *uri) WT_GCC_FUNC_DECL_ATTRIBUTE((cold)) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_library_init(void) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_breakpoint(void); extern void __wt_attach(WT_SESSION_IMPL *session); extern uint64_t __wt_hash_city64(const void *s, size_t len); extern uint64_t __wt_hash_fnv64(const void *string, size_t len); @@ -645,39 +646,41 @@ __wt_hazard_set(WT_SESSION_IMPL *session, WT_REF *ref, bool *busyp , const char *file, int line #endif ); -extern int __wt_hazard_clear(WT_SESSION_IMPL *session, WT_PAGE *page); +extern int __wt_hazard_clear(WT_SESSION_IMPL *session, WT_PAGE *page) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_hazard_close(WT_SESSION_IMPL *session); +extern u_int __wt_hazard_count(WT_SESSION_IMPL *session, WT_PAGE *page); extern void __wt_fill_hex(const uint8_t *src, size_t src_max, uint8_t *dest, size_t dest_max, size_t *lenp); -extern int __wt_raw_to_hex( WT_SESSION_IMPL *session, const uint8_t *from, size_t size, WT_ITEM *to); -extern int __wt_raw_to_esc_hex( WT_SESSION_IMPL *session, const uint8_t *from, size_t size, WT_ITEM *to); -extern int __wt_hex2byte(const u_char *from, u_char *to); -extern int __wt_hex_to_raw(WT_SESSION_IMPL *session, const char *from, WT_ITEM *to); -extern int __wt_nhex_to_raw( WT_SESSION_IMPL *session, const char *from, size_t size, WT_ITEM *to); -extern int __wt_esc_hex_to_raw(WT_SESSION_IMPL *session, const char *from, WT_ITEM *to); -extern int __wt_huffman_open(WT_SESSION_IMPL *session, void *symbol_frequency_array, u_int symcnt, u_int numbytes, void *retp); +extern int __wt_raw_to_hex( WT_SESSION_IMPL *session, const uint8_t *from, size_t size, WT_ITEM *to) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_raw_to_esc_hex( WT_SESSION_IMPL *session, const uint8_t *from, size_t size, WT_ITEM *to) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_hex2byte(const u_char *from, u_char *to) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_hex_to_raw(WT_SESSION_IMPL *session, const char *from, WT_ITEM *to) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_nhex_to_raw( WT_SESSION_IMPL *session, const char *from, size_t size, WT_ITEM *to) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_esc_hex_to_raw(WT_SESSION_IMPL *session, const char *from, WT_ITEM *to) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_huffman_open(WT_SESSION_IMPL *session, void *symbol_frequency_array, u_int symcnt, u_int numbytes, void *retp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_huffman_close(WT_SESSION_IMPL *session, void *huffman_arg); -extern int __wt_print_huffman_code(void *huffman_arg, uint16_t symbol); -extern int __wt_huffman_encode(WT_SESSION_IMPL *session, void *huffman_arg, const uint8_t *from_arg, size_t from_len, WT_ITEM *to_buf); -extern int __wt_huffman_decode(WT_SESSION_IMPL *session, void *huffman_arg, const uint8_t *from_arg, size_t from_len, WT_ITEM *to_buf); -extern int __wt_rwlock_alloc( WT_SESSION_IMPL *session, WT_RWLOCK **rwlockp, const char *name); -extern int __wt_try_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock); -extern int __wt_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock); -extern int __wt_readunlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock); -extern int __wt_try_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock); -extern int __wt_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock); -extern int __wt_writeunlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock); -extern int __wt_rwlock_destroy(WT_SESSION_IMPL *session, WT_RWLOCK **rwlockp); +extern int __wt_print_huffman_code(void *huffman_arg, uint16_t symbol) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_huffman_encode(WT_SESSION_IMPL *session, void *huffman_arg, const uint8_t *from_arg, size_t from_len, WT_ITEM *to_buf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_huffman_decode(WT_SESSION_IMPL *session, void *huffman_arg, const uint8_t *from_arg, size_t from_len, WT_ITEM *to_buf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_rwlock_alloc( WT_SESSION_IMPL *session, WT_RWLOCK **rwlockp, const char *name) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_try_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock); +extern void __wt_readunlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock); +extern int __wt_try_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock); +extern void __wt_writeunlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock); +extern void __wt_rwlock_destroy(WT_SESSION_IMPL *session, WT_RWLOCK **rwlockp); +extern bool __wt_rwlock_islocked(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock); extern uint32_t __wt_nlpo2_round(uint32_t v); extern uint32_t __wt_nlpo2(uint32_t v); extern uint32_t __wt_log2_int(uint32_t n); extern bool __wt_ispo2(uint32_t v); extern uint32_t __wt_rduppo2(uint32_t n, uint32_t po2); extern void __wt_random_init(WT_RAND_STATE volatile *rnd_state); -extern int __wt_random_init_seed( WT_SESSION_IMPL *session, WT_RAND_STATE volatile *rnd_state); +extern int __wt_random_init_seed( WT_SESSION_IMPL *session, WT_RAND_STATE volatile *rnd_state) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern uint32_t __wt_random(WT_RAND_STATE volatile *rnd_state); -extern int __wt_buf_grow_worker(WT_SESSION_IMPL *session, WT_ITEM *buf, size_t size); -extern int __wt_buf_fmt(WT_SESSION_IMPL *session, WT_ITEM *buf, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))); -extern int __wt_buf_catfmt(WT_SESSION_IMPL *session, WT_ITEM *buf, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))); +extern int __wt_buf_grow_worker(WT_SESSION_IMPL *session, WT_ITEM *buf, size_t size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_buf_fmt(WT_SESSION_IMPL *session, WT_ITEM *buf, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_buf_catfmt(WT_SESSION_IMPL *session, WT_ITEM *buf, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern const char *__wt_buf_set_printable( WT_SESSION_IMPL *session, const void *p, size_t size, WT_ITEM *buf); extern const char *__wt_buf_set_size( WT_SESSION_IMPL *session, uint64_t size, bool exact, WT_ITEM *buf); extern int @@ -689,57 +692,62 @@ __wt_scr_alloc_func(WT_SESSION_IMPL *session, size_t size, WT_ITEM **scratchp extern void __wt_scr_discard(WT_SESSION_IMPL *session); extern void *__wt_ext_scr_alloc( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, size_t size); extern void __wt_ext_scr_free(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, void *p); -extern int __wt_stat_dsrc_desc(WT_CURSOR_STAT *cst, int slot, const char **p); +extern int __wt_stat_dsrc_desc(WT_CURSOR_STAT *cst, int slot, const char **p) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_stat_dsrc_init_single(WT_DSRC_STATS *stats); extern void __wt_stat_dsrc_init(WT_DATA_HANDLE *handle); extern void __wt_stat_dsrc_clear_single(WT_DSRC_STATS *stats); extern void __wt_stat_dsrc_clear_all(WT_DSRC_STATS **stats); extern void __wt_stat_dsrc_aggregate_single( WT_DSRC_STATS *from, WT_DSRC_STATS *to); extern void __wt_stat_dsrc_aggregate( WT_DSRC_STATS **from, WT_DSRC_STATS *to); -extern int __wt_stat_connection_desc(WT_CURSOR_STAT *cst, int slot, const char **p); +extern int __wt_stat_connection_desc(WT_CURSOR_STAT *cst, int slot, const char **p) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_stat_connection_init_single(WT_CONNECTION_STATS *stats); extern void __wt_stat_connection_init(WT_CONNECTION_IMPL *handle); extern void __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats); extern void __wt_stat_connection_clear_all(WT_CONNECTION_STATS **stats); extern void __wt_stat_connection_aggregate( WT_CONNECTION_STATS **from, WT_CONNECTION_STATS *to); -extern int __wt_stat_join_desc(WT_CURSOR_STAT *cst, int slot, const char **p); +extern int __wt_stat_join_desc(WT_CURSOR_STAT *cst, int slot, const char **p) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_stat_join_init_single(WT_JOIN_STATS *stats); extern void __wt_stat_join_clear_single(WT_JOIN_STATS *stats); extern void __wt_stat_join_clear_all(WT_JOIN_STATS **stats); extern void __wt_stat_join_aggregate( WT_JOIN_STATS **from, WT_JOIN_STATS *to); +extern WT_THREAD_RET __wt_thread_run(void *arg); +extern int __wt_thread_group_resize( WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, uint32_t new_min, uint32_t new_max, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_thread_group_create( WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, const char *name, uint32_t min, uint32_t max, uint32_t flags, int (*run_func)(WT_SESSION_IMPL *session, WT_THREAD *context)) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_thread_group_destroy( WT_SESSION_IMPL *session, WT_THREAD_GROUP *group) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_thread_group_start_one( WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, bool wait) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_txn_release_snapshot(WT_SESSION_IMPL *session); -extern int __wt_txn_get_snapshot(WT_SESSION_IMPL *session); -extern int __wt_txn_update_oldest(WT_SESSION_IMPL *session, uint32_t flags); -extern int __wt_txn_config(WT_SESSION_IMPL *session, const char *cfg[]); +extern int __wt_txn_get_snapshot(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_update_oldest(WT_SESSION_IMPL *session, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_config(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_txn_release(WT_SESSION_IMPL *session); -extern int __wt_txn_commit(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_txn_rollback(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_txn_init(WT_SESSION_IMPL *session); +extern int __wt_txn_commit(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_rollback(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_init(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_txn_stats_update(WT_SESSION_IMPL *session); extern void __wt_txn_destroy(WT_SESSION_IMPL *session); -extern int __wt_txn_global_init(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_txn_global_destroy(WT_SESSION_IMPL *session); -extern int __wt_checkpoint_get_handles(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_checkpoint_sync(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_checkpoint_close(WT_SESSION_IMPL *session, bool final); +extern int __wt_txn_global_init(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_txn_global_destroy(WT_SESSION_IMPL *session); +extern int __wt_checkpoint_get_handles(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_checkpoint_sync(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_checkpoint_close(WT_SESSION_IMPL *session, bool final) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern uint64_t __wt_ext_transaction_id(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session); -extern int __wt_ext_transaction_isolation_level( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session); -extern int __wt_ext_transaction_notify( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, WT_TXN_NOTIFY *notify); +extern int __wt_ext_transaction_isolation_level( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ext_transaction_notify( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, WT_TXN_NOTIFY *notify) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern uint64_t __wt_ext_transaction_oldest(WT_EXTENSION_API *wt_api); -extern int __wt_ext_transaction_visible( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, uint64_t transaction_id); +extern int __wt_ext_transaction_visible( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, uint64_t transaction_id) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_txn_op_free(WT_SESSION_IMPL *session, WT_TXN_OP *op); -extern int __wt_txn_log_op(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt); -extern int __wt_txn_log_commit(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_txn_checkpoint_logread( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, WT_LSN *ckpt_lsn); -extern int __wt_txn_checkpoint_log( WT_SESSION_IMPL *session, bool full, uint32_t flags, WT_LSN *lsnp); -extern int __wt_txn_truncate_log( WT_SESSION_IMPL *session, WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop); -extern int __wt_txn_truncate_end(WT_SESSION_IMPL *session); -extern int __wt_txn_printlog(WT_SESSION *wt_session, uint32_t flags); -extern int __wt_txn_named_snapshot_begin(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_txn_named_snapshot_drop(WT_SESSION_IMPL *session, const char *cfg[]); -extern int __wt_txn_named_snapshot_get(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *nameval); -extern int __wt_txn_named_snapshot_config(WT_SESSION_IMPL *session, const char *cfg[], bool *has_create, bool *has_drops); -extern int __wt_txn_named_snapshot_destroy(WT_SESSION_IMPL *session); -extern int __wt_txn_recover(WT_SESSION_IMPL *session); +extern int __wt_txn_log_op(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_log_commit(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_checkpoint_logread( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, WT_LSN *ckpt_lsn) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_checkpoint_log( WT_SESSION_IMPL *session, bool full, uint32_t flags, WT_LSN *lsnp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_truncate_log( WT_SESSION_IMPL *session, WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_truncate_end(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_printlog(WT_SESSION *wt_session, uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_named_snapshot_begin(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_named_snapshot_drop(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_named_snapshot_get(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *nameval) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_named_snapshot_config(WT_SESSION_IMPL *session, const char *cfg[], bool *has_create, bool *has_drops) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_named_snapshot_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_txn_recover(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); diff --git a/src/third_party/wiredtiger/src/include/extern_posix.h b/src/third_party/wiredtiger/src/include/extern_posix.h index 6fde537f36b..d2f74d2ffe4 100644 --- a/src/third_party/wiredtiger/src/include/extern_posix.h +++ b/src/third_party/wiredtiger/src/include/extern_posix.h @@ -1,31 +1,31 @@ /* DO NOT EDIT: automatically built by dist/s_prototypes. */ -extern int __wt_posix_directory_list(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *directory, const char *prefix, char ***dirlistp, uint32_t *countp); -extern int __wt_posix_directory_list_free(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, char **dirlist, uint32_t count); -extern int __wt_dlopen(WT_SESSION_IMPL *session, const char *path, WT_DLH **dlhp); -extern int __wt_dlsym(WT_SESSION_IMPL *session, WT_DLH *dlh, const char *name, bool fail, void *sym_ret); -extern int __wt_dlclose(WT_SESSION_IMPL *session, WT_DLH *dlh); -extern int __wt_posix_file_fallocate(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t offset, wt_off_t len); -extern int __wt_os_posix(WT_SESSION_IMPL *session); -extern int __wt_getenv(WT_SESSION_IMPL *session, const char *variable, const char **envp); -extern int __wt_posix_map(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, void *mapped_regionp, size_t *lenp, void *mapped_cookiep); -extern int __wt_posix_map_preload(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, const void *map, size_t length, void *mapped_cookie); -extern int __wt_posix_map_discard(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, void *map, size_t length, void *mapped_cookie); -extern int __wt_posix_unmap(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, void *mapped_region, size_t len, void *mapped_cookie); -extern int __wt_cond_alloc(WT_SESSION_IMPL *session, const char *name, bool is_signalled, WT_CONDVAR **condp); -extern int __wt_cond_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs, bool *signalled); -extern int __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond); -extern int __wt_cond_destroy(WT_SESSION_IMPL *session, WT_CONDVAR **condp); -extern int __wt_once(void (*init_routine)(void)); -extern int __wt_get_vm_pagesize(void); +extern int __wt_posix_directory_list(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *directory, const char *prefix, char ***dirlistp, uint32_t *countp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_posix_directory_list_free(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, char **dirlist, uint32_t count) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_dlopen(WT_SESSION_IMPL *session, const char *path, WT_DLH **dlhp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_dlsym(WT_SESSION_IMPL *session, WT_DLH *dlh, const char *name, bool fail, void *sym_ret) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_dlclose(WT_SESSION_IMPL *session, WT_DLH *dlh) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_posix_file_extend( WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t offset) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_os_posix(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_getenv(WT_SESSION_IMPL *session, const char *variable, const char **envp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_posix_map(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, void *mapped_regionp, size_t *lenp, void *mapped_cookiep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_posix_map_preload(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, const void *map, size_t length, void *mapped_cookie) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_posix_map_discard(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, void *map, size_t length, void *mapped_cookie) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_posix_unmap(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, void *mapped_region, size_t len, void *mapped_cookie) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cond_alloc(WT_SESSION_IMPL *session, const char *name, bool is_signalled, WT_CONDVAR **condp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_cond_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs, bool *signalled); +extern void __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond); +extern int __wt_cond_destroy(WT_SESSION_IMPL *session, WT_CONDVAR **condp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_once(void (*init_routine)(void)) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_get_vm_pagesize(void) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern bool __wt_absolute_path(const char *path); extern const char *__wt_path_separator(void); extern bool __wt_has_priv(void); extern void __wt_stream_set_line_buffer(FILE *fp); extern void __wt_stream_set_no_buffer(FILE *fp); extern void __wt_sleep(uint64_t seconds, uint64_t micro_seconds); -extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg); -extern int __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid); +extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_thread_id(char *buf, size_t buflen); -extern int __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp); +extern int __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_yield(void); diff --git a/src/third_party/wiredtiger/src/include/extern_win.h b/src/third_party/wiredtiger/src/include/extern_win.h index c5c2624db2c..8c2b19056e0 100644 --- a/src/third_party/wiredtiger/src/include/extern_win.h +++ b/src/third_party/wiredtiger/src/include/extern_win.h @@ -1,32 +1,34 @@ /* DO NOT EDIT: automatically built by dist/s_prototypes. */ -extern int __wt_win_directory_list(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *directory, const char *prefix, char ***dirlistp, uint32_t *countp); -extern int __wt_win_directory_list_free(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, char **dirlist, uint32_t count); -extern int __wt_dlopen(WT_SESSION_IMPL *session, const char *path, WT_DLH **dlhp); -extern int __wt_dlsym(WT_SESSION_IMPL *session, WT_DLH *dlh, const char *name, bool fail, void *sym_ret); -extern int __wt_dlclose(WT_SESSION_IMPL *session, WT_DLH *dlh); -extern int __wt_win_fs_size(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *name, wt_off_t *sizep); -extern int __wt_os_win(WT_SESSION_IMPL *session); -extern int __wt_getenv(WT_SESSION_IMPL *session, const char *variable, const char **envp); -extern int __wt_win_map(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, void *mapped_regionp, size_t *lenp, void *mapped_cookiep); -extern int __wt_win_unmap(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, void *mapped_region, size_t length, void *mapped_cookie); -extern int __wt_cond_alloc(WT_SESSION_IMPL *session, const char *name, bool is_signalled, WT_CONDVAR **condp); -extern int __wt_cond_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs, bool *signalled); -extern int __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond); -extern int __wt_cond_destroy(WT_SESSION_IMPL *session, WT_CONDVAR **condp); -extern int __wt_once(void (*init_routine)(void)); -extern int __wt_get_vm_pagesize(void); +extern int __wt_win_directory_list(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *directory, const char *prefix, char ***dirlistp, uint32_t *countp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_win_directory_list_free(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, char **dirlist, uint32_t count) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_dlopen(WT_SESSION_IMPL *session, const char *path, WT_DLH **dlhp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_dlsym(WT_SESSION_IMPL *session, WT_DLH *dlh, const char *name, bool fail, void *sym_ret) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_dlclose(WT_SESSION_IMPL *session, WT_DLH *dlh) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_win_fs_size(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *name, wt_off_t *sizep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_os_win(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_getenv(WT_SESSION_IMPL *session, const char *variable, const char **envp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_win_map(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, void *mapped_regionp, size_t *lenp, void *mapped_cookiep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_win_unmap(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, void *mapped_region, size_t length, void *mapped_cookie) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_cond_alloc(WT_SESSION_IMPL *session, const char *name, bool is_signalled, WT_CONDVAR **condp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_cond_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs, bool *signalled); +extern void __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond); +extern int __wt_cond_destroy(WT_SESSION_IMPL *session, WT_CONDVAR **condp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_once(void (*init_routine)(void)) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_get_vm_pagesize(void) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern bool __wt_absolute_path(const char *path); extern const char *__wt_path_separator(void); extern bool __wt_has_priv(void); extern void __wt_stream_set_line_buffer(FILE *fp); extern void __wt_stream_set_no_buffer(FILE *fp); extern void __wt_sleep(uint64_t seconds, uint64_t micro_seconds); -extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg); -extern int __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid); +extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_thread_id(char *buf, size_t buflen); -extern int __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp); +extern int __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_to_utf16_string( WT_SESSION_IMPL *session, const char*utf8, WT_ITEM **outbuf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_to_utf8_string( WT_SESSION_IMPL *session, const wchar_t*wide, WT_ITEM **outbuf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern DWORD __wt_getlasterror(void); -extern int __wt_map_windows_error(DWORD windows_error); +extern int __wt_map_windows_error(DWORD windows_error) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern const char *__wt_formatmessage(WT_SESSION_IMPL *session, DWORD windows_error); extern void __wt_yield(void); diff --git a/src/third_party/wiredtiger/src/include/flags.h b/src/third_party/wiredtiger/src/include/flags.h index 9346605ed24..5d718da473d 100644 --- a/src/third_party/wiredtiger/src/include/flags.h +++ b/src/third_party/wiredtiger/src/include/flags.h @@ -99,10 +99,11 @@ #define WT_VERB_SHARED_CACHE 0x00080000 #define WT_VERB_SPLIT 0x00100000 #define WT_VERB_TEMPORARY 0x00200000 -#define WT_VERB_TRANSACTION 0x00400000 -#define WT_VERB_VERIFY 0x00800000 -#define WT_VERB_VERSION 0x01000000 -#define WT_VERB_WRITE 0x02000000 +#define WT_VERB_THREAD_GROUP 0x00400000 +#define WT_VERB_TRANSACTION 0x00800000 +#define WT_VERB_VERIFY 0x01000000 +#define WT_VERB_VERSION 0x02000000 +#define WT_VERB_WRITE 0x04000000 #define WT_VISIBILITY_ERR 0x00000080 /* * flags section: END diff --git a/src/third_party/wiredtiger/src/include/log.h b/src/third_party/wiredtiger/src/include/log.h index 870c046252c..b91c7dffe60 100644 --- a/src/third_party/wiredtiger/src/include/log.h +++ b/src/third_party/wiredtiger/src/include/log.h @@ -256,7 +256,9 @@ struct __wt_log { #ifdef HAVE_DIAGNOSTIC uint64_t write_calls; /* Calls to log_write */ #endif -#define WT_LOG_OPENED 0x01 /* Log subsystem successfully open */ + +#define WT_LOG_OPENED 0x01 /* Log subsystem successfully open */ +#define WT_LOG_TRUNCATE_NOTSUP 0x02 /* File system truncate not supported */ uint32_t flags; }; diff --git a/src/third_party/wiredtiger/src/include/misc.h b/src/third_party/wiredtiger/src/include/misc.h index 1121b7dfa75..83e238b0529 100644 --- a/src/third_party/wiredtiger/src/include/misc.h +++ b/src/third_party/wiredtiger/src/include/misc.h @@ -11,6 +11,11 @@ * and unused function return values. */ #define WT_UNUSED(var) (void)(var) +#define WT_IGNORE_RET(call) do { \ + int __ignored_ret; \ + __ignored_ret = (call); \ + WT_UNUSED(__ignored_ret); \ +} while (0) #define WT_DIVIDER "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" diff --git a/src/third_party/wiredtiger/src/include/misc.i b/src/third_party/wiredtiger/src/include/misc.i index eaa7a328ff1..e1b882388e7 100644 --- a/src/third_party/wiredtiger/src/include/misc.i +++ b/src/third_party/wiredtiger/src/include/misc.i @@ -10,12 +10,12 @@ * __wt_cond_wait -- * Wait on a mutex, optionally timing out. */ -static inline int +static inline void __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs) { bool notused; - return (__wt_cond_wait_signal(session, cond, usecs, ¬used)); + __wt_cond_wait_signal(session, cond, usecs, ¬used); } /* @@ -49,24 +49,22 @@ __wt_seconds(WT_SESSION_IMPL *session, time_t *timep) * __wt_verbose -- * Verbose message. */ -static inline int +static inline void __wt_verbose(WT_SESSION_IMPL *session, int flag, const char *fmt, ...) WT_GCC_FUNC_ATTRIBUTE((format (printf, 2, 3))) + WT_GCC_FUNC_ATTRIBUTE((cold)) { #ifdef HAVE_VERBOSE - WT_DECL_RET; va_list ap; if (WT_VERBOSE_ISSET(session, flag)) { va_start(ap, fmt); - ret = __wt_eventv(session, true, 0, NULL, 0, fmt, ap); + WT_IGNORE_RET(__wt_eventv(session, true, 0, NULL, 0, fmt, ap)); va_end(ap); } - return (ret); #else WT_UNUSED(session); WT_UNUSED(flag); WT_UNUSED(fmt); - return (0); #endif } diff --git a/src/third_party/wiredtiger/src/include/mutex.h b/src/third_party/wiredtiger/src/include/mutex.h index 04679884930..f0f8173bad4 100644 --- a/src/third_party/wiredtiger/src/include/mutex.h +++ b/src/third_party/wiredtiger/src/include/mutex.h @@ -42,7 +42,7 @@ typedef union { /* Read/write lock */ struct { uint16_t writers; /* Now serving for writers */ uint16_t readers; /* Now serving for readers */ - uint16_t users; /* Next available ticket number */ + uint16_t next; /* Next available ticket number */ uint16_t __notused; /* Padding */ } s; } wt_rwlock_t; @@ -59,24 +59,6 @@ struct __wt_rwlock { }; /* - * A light weight lock that can be used to replace spinlocks if fairness is - * necessary. Implements a ticket-based back off spin lock. - * The fields are available as a union to allow for atomically setting - * the state of the entire lock. - */ -struct __wt_fair_lock { - union { - uint32_t lock; - struct { - uint16_t owner; /* Ticket for current owner */ - uint16_t waiter; /* Last allocated ticket */ - } s; - } u; -#define fair_lock_owner u.s.owner -#define fair_lock_waiter u.s.waiter -}; - -/* * Spin locks: * * WiredTiger uses spinlocks for fast mutual exclusion (where operations done diff --git a/src/third_party/wiredtiger/src/include/mutex.i b/src/third_party/wiredtiger/src/include/mutex.i index 65956c13c08..cb1847d9991 100644 --- a/src/third_party/wiredtiger/src/include/mutex.i +++ b/src/third_party/wiredtiger/src/include/mutex.i @@ -154,9 +154,10 @@ __wt_spin_trylock(WT_SESSION_IMPL *session, WT_SPINLOCK *t) static inline void __wt_spin_lock(WT_SESSION_IMPL *session, WT_SPINLOCK *t) { - WT_UNUSED(session); + WT_DECL_RET; - (void)pthread_mutex_lock(&t->lock); + if ((ret = pthread_mutex_lock(&t->lock)) != 0) + WT_PANIC_MSG(session, ret, "pthread_mutex_lock: %s", t->name); } #endif @@ -167,16 +168,14 @@ __wt_spin_lock(WT_SESSION_IMPL *session, WT_SPINLOCK *t) static inline void __wt_spin_unlock(WT_SESSION_IMPL *session, WT_SPINLOCK *t) { - WT_UNUSED(session); + WT_DECL_RET; - (void)pthread_mutex_unlock(&t->lock); + if ((ret = pthread_mutex_unlock(&t->lock)) != 0) + WT_PANIC_MSG(session, ret, "pthread_mutex_unlock: %s", t->name); } #elif SPINLOCK_TYPE == SPINLOCK_MSVC -#define WT_SPINLOCK_REGISTER -1 -#define WT_SPINLOCK_REGISTER_FAILED -2 - /* * __wt_spin_init -- * Initialize a spinlock. @@ -184,13 +183,18 @@ __wt_spin_unlock(WT_SESSION_IMPL *session, WT_SPINLOCK *t) static inline int __wt_spin_init(WT_SESSION_IMPL *session, WT_SPINLOCK *t, const char *name) { - WT_UNUSED(session); + DWORD windows_error; + + if (InitializeCriticalSectionAndSpinCount(&t->lock, 4000) == 0) { + windows_error = __wt_getlasterror(); + __wt_errx(session, + "%s: InitializeCriticalSectionAndSpinCount: %s", + name, __wt_formatmessage(session, windows_error)); + return (__wt_map_windows_error(windows_error)); + } t->name = name; t->initialized = 1; - - InitializeCriticalSectionAndSpinCount(&t->lock, 4000); - return (0); } @@ -251,103 +255,3 @@ __wt_spin_unlock(WT_SESSION_IMPL *session, WT_SPINLOCK *t) #error Unknown spinlock type #endif - -/* - * __wt_fair_trylock -- - * Try to get a lock - give up if it is not immediately available. - */ -static inline int -__wt_fair_trylock(WT_SESSION_IMPL *session, WT_FAIR_LOCK *lock) -{ - WT_FAIR_LOCK new, old; - - WT_UNUSED(session); - - old = new = *lock; - - /* Exit early if there is no chance we can get the lock. */ - if (old.fair_lock_waiter != old.fair_lock_owner) - return (EBUSY); - - /* The replacement lock value is a result of allocating a new ticket. */ - ++new.fair_lock_waiter; - return (__wt_atomic_cas32( - &lock->u.lock, old.u.lock, new.u.lock) ? 0 : EBUSY); -} - -/* - * __wt_fair_lock -- - * Get a lock. - */ -static inline int -__wt_fair_lock(WT_SESSION_IMPL *session, WT_FAIR_LOCK *lock) -{ - uint16_t ticket; - int pause_cnt; - - WT_UNUSED(session); - - /* - * Possibly wrap: if we have more than 64K lockers waiting, the ticket - * value will wrap and two lockers will simultaneously be granted the - * lock. - */ - ticket = __wt_atomic_fetch_add16(&lock->fair_lock_waiter, 1); - for (pause_cnt = 0; ticket != lock->fair_lock_owner;) { - /* - * We failed to get the lock; pause before retrying and if we've - * paused enough, sleep so we don't burn CPU to no purpose. This - * situation happens if there are more threads than cores in the - * system and we're thrashing on shared resources. - */ - if (++pause_cnt < WT_THOUSAND) - WT_PAUSE(); - else - __wt_sleep(0, 10); - } - - /* - * Applications depend on a barrier here so that operations holding the - * lock see consistent data. - */ - WT_READ_BARRIER(); - - return (0); -} - -/* - * __wt_fair_unlock -- - * Release a shared lock. - */ -static inline int -__wt_fair_unlock(WT_SESSION_IMPL *session, WT_FAIR_LOCK *lock) -{ - WT_UNUSED(session); - - /* - * Ensure that all updates made while the lock was held are visible to - * the next thread to acquire the lock. - */ - WT_WRITE_BARRIER(); - - /* - * We have exclusive access - the update does not need to be atomic. - */ - ++lock->fair_lock_owner; - - return (0); -} - -#ifdef HAVE_DIAGNOSTIC -/* - * __wt_fair_islocked -- - * Test whether the lock is currently held. - */ -static inline bool -__wt_fair_islocked(WT_SESSION_IMPL *session, WT_FAIR_LOCK *lock) -{ - WT_UNUSED(session); - - return (lock->fair_lock_waiter != lock->fair_lock_owner); -} -#endif diff --git a/src/third_party/wiredtiger/src/include/os_fhandle.i b/src/third_party/wiredtiger/src/include/os_fhandle.i index 9bf5ce0e60b..78d25969508 100644 --- a/src/third_party/wiredtiger/src/include/os_fhandle.i +++ b/src/third_party/wiredtiger/src/include/os_fhandle.i @@ -18,8 +18,8 @@ __wt_fsync(WT_SESSION_IMPL *session, WT_FH *fh, bool block) WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY)); - WT_RET(__wt_verbose( - session, WT_VERB_HANDLEOPS, "%s: handle-sync", fh->handle->name)); + __wt_verbose( + session, WT_VERB_HANDLEOPS, "%s: handle-sync", fh->handle->name); handle = fh->handle; /* @@ -39,40 +39,32 @@ __wt_fsync(WT_SESSION_IMPL *session, WT_FH *fh, bool block) } /* - * __wt_fallocate -- + * __wt_fextend -- * Extend a file. */ static inline int -__wt_fallocate( - WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, wt_off_t len) +__wt_fextend(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset) { - WT_DECL_RET; WT_FILE_HANDLE *handle; WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY)); WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_IN_MEMORY)); - WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS, - "%s: handle-allocate: %" PRIuMAX " at %" PRIuMAX, - fh->handle->name, (uintmax_t)len, (uintmax_t)offset)); + __wt_verbose(session, WT_VERB_HANDLEOPS, + "%s: handle-extend: %" PRIuMAX " at %" PRIuMAX, + fh->handle->name, (uintmax_t)offset); /* * Our caller is responsible for handling any locking issues, all we * have to do is find a function to call. - * - * Be cautious, the underlying system might have configured the nolock - * flavor, that failed, and we have to fallback to the locking flavor. */ handle = fh->handle; - if (handle->fh_allocate_nolock != NULL) { - if ((ret = handle->fh_allocate_nolock( - handle, (WT_SESSION *)session, offset, len)) == 0) - return (0); - WT_RET_ERROR_OK(ret, ENOTSUP); - } - if (handle->fh_allocate != NULL) - return (handle->fh_allocate( - handle, (WT_SESSION *)session, offset, len)); + if (handle->fh_extend_nolock != NULL) + return (handle->fh_extend_nolock( + handle, (WT_SESSION *)session, offset)); + if (handle->fh_extend != NULL) + return (handle->fh_extend( + handle, (WT_SESSION *)session, offset)); return (ENOTSUP); } @@ -85,8 +77,8 @@ __wt_file_lock(WT_SESSION_IMPL * session, WT_FH *fh, bool lock) { WT_FILE_HANDLE *handle; - WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS, - "%s: handle-lock: %s", fh->handle->name, lock ? "lock" : "unlock")); + __wt_verbose(session, WT_VERB_HANDLEOPS, + "%s: handle-lock: %s", fh->handle->name, lock ? "lock" : "unlock"); handle = fh->handle; return (handle->fh_lock == NULL ? 0 : @@ -103,9 +95,9 @@ __wt_read( { WT_DECL_RET; - WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS, + __wt_verbose(session, WT_VERB_HANDLEOPS, "%s: handle-read: %" WT_SIZET_FMT " at %" PRIuMAX, - fh->handle->name, len, (uintmax_t)offset)); + fh->handle->name, len, (uintmax_t)offset); WT_STAT_FAST_CONN_INCR_ATOMIC(session, thread_read_active); WT_STAT_FAST_CONN_INCR(session, read_io); @@ -124,27 +116,36 @@ __wt_read( static inline int __wt_filesize(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t *sizep) { - WT_RET(__wt_verbose( - session, WT_VERB_HANDLEOPS, "%s: handle-size", fh->handle->name)); + __wt_verbose( + session, WT_VERB_HANDLEOPS, "%s: handle-size", fh->handle->name); return (fh->handle->fh_size(fh->handle, (WT_SESSION *)session, sizep)); } /* * __wt_ftruncate -- - * POSIX ftruncate. + * Truncate a file. */ static inline int -__wt_ftruncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t len) +__wt_ftruncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset) { + WT_FILE_HANDLE *handle; + WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY)); - WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS, - "%s: handle-truncate: %" PRIuMAX, - fh->handle->name, (uintmax_t)len)); + __wt_verbose(session, WT_VERB_HANDLEOPS, + "%s: handle-truncate: %" PRIuMAX " at %" PRIuMAX, + fh->handle->name, (uintmax_t)offset); - return (fh->handle->fh_truncate( - fh->handle, (WT_SESSION *)session, len)); + /* + * Our caller is responsible for handling any locking issues, all we + * have to do is find a function to call. + */ + handle = fh->handle; + if (handle->fh_truncate != NULL) + return (handle->fh_truncate( + handle, (WT_SESSION *)session, offset)); + return (ENOTSUP); } /* @@ -161,12 +162,19 @@ __wt_write(WT_SESSION_IMPL *session, WT_STRING_MATCH(fh->name, WT_SINGLETHREAD, strlen(WT_SINGLETHREAD))); - WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS, + __wt_verbose(session, WT_VERB_HANDLEOPS, "%s: handle-write: %" WT_SIZET_FMT " at %" PRIuMAX, - fh->handle->name, len, (uintmax_t)offset)); + fh->handle->name, len, (uintmax_t)offset); + + /* + * Do a final panic check before I/O, so we stop writing as quickly as + * possible if there's an unanticipated error. We aren't handling the + * error correctly by definition, and writing won't make things better. + */ + WT_RET(WT_SESSION_CHECK_PANIC(session)); - WT_STAT_FAST_CONN_INCR_ATOMIC(session, thread_write_active); WT_STAT_FAST_CONN_INCR(session, write_io); + WT_STAT_FAST_CONN_INCR_ATOMIC(session, thread_write_active); ret = fh->handle->fh_write( fh->handle, (WT_SESSION *)session, offset, len, buf); diff --git a/src/third_party/wiredtiger/src/include/os_fs.i b/src/third_party/wiredtiger/src/include/os_fs.i index a3a2fe29b65..3012422f33a 100644 --- a/src/third_party/wiredtiger/src/include/os_fs.i +++ b/src/third_party/wiredtiger/src/include/os_fs.i @@ -22,9 +22,9 @@ __wt_fs_directory_list(WT_SESSION_IMPL *session, *dirlistp = NULL; *countp = 0; - WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, + __wt_verbose(session, WT_VERB_FILEOPS, "%s: directory-list: %s prefix %s", - dir, prefix == NULL ? "all" : prefix)); + dir, prefix == NULL ? "all" : prefix); WT_RET(__wt_filename(session, dir, &path)); @@ -72,7 +72,7 @@ __wt_fs_exist(WT_SESSION_IMPL *session, const char *name, bool *existp) WT_SESSION *wt_session; char *path; - WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: file-exist", name)); + __wt_verbose(session, WT_VERB_FILEOPS, "%s: file-exist", name); WT_RET(__wt_filename(session, name, &path)); @@ -98,7 +98,7 @@ __wt_fs_remove(WT_SESSION_IMPL *session, const char *name, bool durable) WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY)); - WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: file-remove", name)); + __wt_verbose(session, WT_VERB_FILEOPS, "%s: file-remove", name); #ifdef HAVE_DIAGNOSTIC /* @@ -136,8 +136,8 @@ __wt_fs_rename( WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY)); - WT_RET(__wt_verbose( - session, WT_VERB_FILEOPS, "%s to %s: file-rename", from, to)); + __wt_verbose( + session, WT_VERB_FILEOPS, "%s to %s: file-rename", from, to); #ifdef HAVE_DIAGNOSTIC /* @@ -178,7 +178,7 @@ __wt_fs_size(WT_SESSION_IMPL *session, const char *name, wt_off_t *sizep) WT_SESSION *wt_session; char *path; - WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: file-size", name)); + __wt_verbose(session, WT_VERB_FILEOPS, "%s: file-size", name); WT_RET(__wt_filename(session, name, &path)); diff --git a/src/third_party/wiredtiger/src/include/os_fstream.i b/src/third_party/wiredtiger/src/include/os_fstream.i index 92274431011..a0ac4ef8b6a 100644 --- a/src/third_party/wiredtiger/src/include/os_fstream.i +++ b/src/third_party/wiredtiger/src/include/os_fstream.i @@ -49,8 +49,8 @@ static inline int __wt_vfprintf( WT_SESSION_IMPL *session, WT_FSTREAM *fstr, const char *fmt, va_list ap) { - WT_RET(__wt_verbose( - session, WT_VERB_HANDLEOPS, "%s: handle-printf", fstr->name)); + __wt_verbose( + session, WT_VERB_HANDLEOPS, "%s: handle-printf", fstr->name); return (fstr->fstr_printf(session, fstr, fmt, ap)); } diff --git a/src/third_party/wiredtiger/src/include/serial.i b/src/third_party/wiredtiger/src/include/serial.i index 67edc1c9ce1..982f196b0b8 100644 --- a/src/third_party/wiredtiger/src/include/serial.i +++ b/src/third_party/wiredtiger/src/include/serial.i @@ -316,11 +316,11 @@ __wt_update_serial(WT_SESSION_IMPL *session, WT_PAGE *page, } /* If we can't lock it, don't scan, that's okay. */ - if (__wt_fair_trylock(session, &page->page_lock) != 0) + if (__wt_try_writelock(session, &page->page_lock) != 0) return (0); obsolete = __wt_update_obsolete_check(session, page, upd->next); - WT_RET(__wt_fair_unlock(session, &page->page_lock)); + __wt_writeunlock(session, &page->page_lock); if (obsolete != NULL) __wt_update_obsolete_free(session, page, obsolete); diff --git a/src/third_party/wiredtiger/src/include/stat.h b/src/third_party/wiredtiger/src/include/stat.h index 1df24382236..e0d0a6eb780 100644 --- a/src/third_party/wiredtiger/src/include/stat.h +++ b/src/third_party/wiredtiger/src/include/stat.h @@ -289,10 +289,10 @@ struct __wt_connection_stats { int64_t cache_eviction_queue_empty; int64_t cache_eviction_queue_not_empty; int64_t cache_eviction_server_evicting; - int64_t cache_eviction_server_not_evicting; int64_t cache_eviction_server_toobig; int64_t cache_eviction_server_slept; int64_t cache_eviction_slow; + int64_t cache_eviction_state; int64_t cache_eviction_worker_evicting; int64_t cache_eviction_force_fail; int64_t cache_eviction_walks_active; diff --git a/src/third_party/wiredtiger/src/include/thread_group.h b/src/third_party/wiredtiger/src/include/thread_group.h new file mode 100644 index 00000000000..f946dcab144 --- /dev/null +++ b/src/third_party/wiredtiger/src/include/thread_group.h @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2014-2016 MongoDB, Inc. + * Copyright (c) 2008-2014 WiredTiger, Inc. + * All rights reserved. + * + * See the file LICENSE for redistribution information. + */ + +/* + * WT_THREAD -- + * Encapsulation of a thread that belongs to a thread group. + */ +struct __wt_thread { + WT_SESSION_IMPL *session; + u_int id; + wt_thread_t tid; +#define WT_THREAD_RUN 0x01 + uint32_t flags; + + /* The runner function used by all threads. */ + int (*run_func)(WT_SESSION_IMPL *session, WT_THREAD *context); +}; + +/* + * Flags for thread group functions. + */ +#define WT_THREAD_CAN_WAIT 0x01 +#define WT_THREAD_PANIC_FAIL 0x02 + +/* + * WT_THREAD_GROUP -- + * Encapsulation of a group of utility threads. + */ +struct __wt_thread_group { + uint32_t alloc; /* Size of allocated group */ + uint32_t max; /* Max threads in group */ + uint32_t min; /* Min threads in group */ + uint32_t current_threads;/* Number of active threads */ + + const char *name; /* Name */ + + WT_RWLOCK *lock; /* Protects group changes */ + + /* + * Condition signalled when wanting to wake up threads that are + * part of the group - for example when shutting down. This condition + * can also be used by group owners to ensure state changes are noticed. + */ + WT_CONDVAR *wait_cond; + + /* + * The threads need to be held in an array of arrays, not an array of + * structures because the array is reallocated as it grows, which + * causes threads to loose track of their context is realloc moves the + * memory. + */ + WT_THREAD **threads; + + /* The runner function used by all threads. */ + int (*run_func)(WT_SESSION_IMPL *session, WT_THREAD *context); +}; diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in index 0e022048835..10141cd34c1 100644 --- a/src/third_party/wiredtiger/src/include/wiredtiger.in +++ b/src/third_party/wiredtiger/src/include/wiredtiger.in @@ -1785,7 +1785,8 @@ struct __wt_connection { * Enabling the checkpoint server uses a session from the configured * session_max., a set of related configuration options defined below.} * @config{ log_size, wait for this amount of log - * record bytes to be written to the log between each checkpoint. A + * record bytes to be written to the log between each checkpoint. If + * non-zero\, this value will use a minimum of the log file size. A * database can configure both log_size and wait to set an upper bound * for checkpoints; setting this value above 0 configures periodic * checkpoints., an integer between 0 and 2GB; default \c 0.} @@ -1807,21 +1808,23 @@ struct __wt_connection { * number of threads currently running will vary depending on the * current eviction load., an integer between 1 and 20; default \c 1.} * @config{ ),,} - * @config{eviction_dirty_target, continue evicting until the cache has - * less dirty memory than the value\, as a percentage of the total cache - * size. Dirty pages will only be evicted if the cache is full enough - * to trigger eviction., an integer between 1 and 99; default \c 5.} - * @config{eviction_dirty_trigger, trigger eviction when the cache is - * using this much memory for dirty content\, as a percentage of the - * total cache size. This setting only alters behavior if it is lower - * than eviction_trigger., an integer between 1 and 99; default \c 20.} - * @config{eviction_target, continue evicting until the cache has less - * total memory than the value\, as a percentage of the total cache - * size. Must be less than \c eviction_trigger., an integer between 10 - * and 99; default \c 80.} - * @config{eviction_trigger, trigger eviction when the cache is using - * this much memory\, as a percentage of the total cache size., an - * integer between 10 and 99; default \c 95.} + * @config{eviction_dirty_target, perform eviction in worker threads + * when the cache contains at least this much dirty content\, expressed + * as a percentage of the total cache size., an integer between 1 and + * 99; default \c 5.} + * @config{eviction_dirty_trigger, trigger application threads to + * perform eviction when the cache contains at least this much dirty + * content\, expressed as a percentage of the total cache size. This + * setting only alters behavior if it is lower than eviction_trigger., + * an integer between 1 and 99; default \c 20.} + * @config{eviction_target, perform eviction in worker threads when the + * cache contains at least this much content\, expressed as a percentage + * of the total cache size. Must be less than \c eviction_trigger., an + * integer between 10 and 99; default \c 80.} + * @config{eviction_trigger, trigger application threads to perform + * eviction when the cache contains at least this much content\, + * expressed as a percentage of the total cache size., an integer + * between 10 and 99; default \c 95.} * @config{file_manager = (, control how file handles are managed., a * set of related configuration options defined below.} * @config{ close_handle_minimum, number of @@ -1924,8 +1927,8 @@ struct __wt_connection { * \c "lsm_manager"\, \c "metadata"\, \c "mutex"\, \c "overflow"\, \c * "read"\, \c "rebalance"\, \c "reconcile"\, \c "recovery"\, \c * "salvage"\, \c "shared_cache"\, \c "split"\, \c "temporary"\, \c - * "transaction"\, \c "verify"\, \c "version"\, \c "write"; default - * empty.} + * "thread_group"\, \c "transaction"\, \c "verify"\, \c "version"\, \c + * "write"; default empty.} * @configend * @errors */ @@ -2201,14 +2204,14 @@ struct __wt_connection { * checkpoint server uses a session from the configured session_max., a set of * related configuration options defined below.} * @config{ log_size, wait for this amount of log record - * bytes to be written to the log between each checkpoint. A database can - * configure both log_size and wait to set an upper bound for checkpoints; - * setting this value above 0 configures periodic checkpoints., an integer - * between 0 and 2GB; default \c 0.} - * @config{ wait, - * seconds to wait between each checkpoint; setting this value above 0 - * configures periodic checkpoints., an integer between 0 and 100000; default \c - * 0.} + * bytes to be written to the log between each checkpoint. If non-zero\, this + * value will use a minimum of the log file size. A database can configure both + * log_size and wait to set an upper bound for checkpoints; setting this value + * above 0 configures periodic checkpoints., an integer between 0 and 2GB; + * default \c 0.} + * @config{ wait, seconds to wait between + * each checkpoint; setting this value above 0 configures periodic checkpoints., + * an integer between 0 and 100000; default \c 0.} * @config{ ),,} * @config{checkpoint_sync, flush files to stable storage when closing or * writing checkpoints., a boolean flag; default \c true.} @@ -2266,20 +2269,22 @@ struct __wt_connection { * current eviction load., an integer between 1 and 20; default \c 1.} * @config{ * ),,} - * @config{eviction_dirty_target, continue evicting until the cache has less - * dirty memory than the value\, as a percentage of the total cache size. Dirty - * pages will only be evicted if the cache is full enough to trigger eviction., - * an integer between 1 and 99; default \c 5.} - * @config{eviction_dirty_trigger, trigger eviction when the cache is using this - * much memory for dirty content\, as a percentage of the total cache size. - * This setting only alters behavior if it is lower than eviction_trigger., an - * integer between 1 and 99; default \c 20.} - * @config{eviction_target, continue evicting until the cache has less total - * memory than the value\, as a percentage of the total cache size. Must be - * less than \c eviction_trigger., an integer between 10 and 99; default \c 80.} - * @config{eviction_trigger, trigger eviction when the cache is using this much - * memory\, as a percentage of the total cache size., an integer between 10 and - * 99; default \c 95.} + * @config{eviction_dirty_target, perform eviction in worker threads when the + * cache contains at least this much dirty content\, expressed as a percentage + * of the total cache size., an integer between 1 and 99; default \c 5.} + * @config{eviction_dirty_trigger, trigger application threads to perform + * eviction when the cache contains at least this much dirty content\, expressed + * as a percentage of the total cache size. This setting only alters behavior + * if it is lower than eviction_trigger., an integer between 1 and 99; default + * \c 20.} + * @config{eviction_target, perform eviction in worker threads when the cache + * contains at least this much content\, expressed as a percentage of the total + * cache size. Must be less than \c eviction_trigger., an integer between 10 + * and 99; default \c 80.} + * @config{eviction_trigger, trigger application threads to perform eviction + * when the cache contains at least this much content\, expressed as a + * percentage of the total cache size., an integer between 10 and 99; default \c + * 95.} * @config{exclusive, fail if the database already exists\, generally used with * the \c create option., a boolean flag; default \c false.} * @config{extensions, list of shared library extensions to load (using dlopen). @@ -2440,7 +2445,8 @@ struct __wt_connection { * \c "handleops"\, \c "log"\, \c "lsm"\, \c "lsm_manager"\, \c "metadata"\, \c * "mutex"\, \c "overflow"\, \c "read"\, \c "rebalance"\, \c "reconcile"\, \c * "recovery"\, \c "salvage"\, \c "shared_cache"\, \c "split"\, \c "temporary"\, - * \c "transaction"\, \c "verify"\, \c "version"\, \c "write"; default empty.} + * \c "thread_group"\, \c "transaction"\, \c "verify"\, \c "version"\, \c + * "write"; default empty.} * @config{write_through, Use \c FILE_FLAG_WRITE_THROUGH on Windows to write to * files. Ignored on non-Windows systems. Options are given as a list\, such * as <code>"write_through=[data]"</code>. Configuring \c write_through requires @@ -3923,48 +3929,54 @@ struct __wt_file_handle { WT_SESSION *session, wt_off_t offset, wt_off_t len, int advice); /*! - * Ensure disk space is allocated for the file, based on the POSIX - * 1003.1 standard fallocate. + * Extend the file. * * This method is not required, and should be set to NULL when not * supported by the file. * + * Any allocated disk space must read as 0 bytes, and no existing file + * data may change. Allocating all necessary underlying storage (not + * changing just the file's metadata), is likely to result in increased + * performance. + * * This method is not called by multiple threads concurrently (on the - * same file handle). If the file handle's fallocate method supports - * concurrent calls, set the WT_FILE_HANDLE::fallocate_nolock method - * instead. + * same file handle). If the file handle's extension method supports + * concurrent calls, set the WT_FILE_HANDLE::fh_extend_nolock method + * instead. See @ref custom_file_systems for more information. * * @errors * * @param file_handle the WT_FILE_HANDLE * @param session the current WiredTiger session - * @param offset the file offset - * @param len the size of the advisory + * @param offset desired file size after extension */ - int (*fh_allocate)(WT_FILE_HANDLE *file_handle, - WT_SESSION *session, wt_off_t, wt_off_t); + int (*fh_extend)( + WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t offset); /*! - * Ensure disk space is allocated for the file, based on the POSIX - * 1003.1 standard fallocate. + * Extend the file. * * This method is not required, and should be set to NULL when not * supported by the file. * + * Any allocated disk space must read as 0 bytes, and no existing file + * data may change. Allocating all necessary underlying storage (not + * only changing the file's metadata), is likely to result in increased + * performance. + * * This method may be called by multiple threads concurrently (on the - * same file handle). If the file handle's fallocate method does not - * support concurrent calls, set the WT_FILE_HANDLE::fallocate method - * instead. + * same file handle). If the file handle's extension method does not + * support concurrent calls, set the WT_FILE_HANDLE::fh_extend method + * instead. See @ref custom_file_systems for more information. * * @errors * * @param file_handle the WT_FILE_HANDLE * @param session the current WiredTiger session - * @param offset the file offset - * @param len the size of the advisory + * @param offset desired file size after extension */ - int (*fh_allocate_nolock)(WT_FILE_HANDLE *file_handle, - WT_SESSION *session, wt_off_t, wt_off_t); + int (*fh_extend_nolock)( + WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t offset); /*! * Lock/unlock a file from the perspective of other processes running @@ -4111,20 +4123,22 @@ struct __wt_file_handle { int (*fh_sync_nowait)(WT_FILE_HANDLE *file_handle, WT_SESSION *session); /*! - * Lengthen or shorten a file to the specified length, based on the - * POSIX 1003.1 standard ftruncate. + * Truncate the file. * - * This method is not required for read-only files, and should be set - * to NULL when not supported by the file. + * This method is not required, and should be set to NULL when not + * supported by the file. + * + * This method is not called by multiple threads concurrently (on the + * same file handle). * * @errors * * @param file_handle the WT_FILE_HANDLE * @param session the current WiredTiger session - * @param length desired file size after truncate + * @param offset desired file size after truncate */ int (*fh_truncate)( - WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t length); + WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t offset); /*! * Write to a file, based on the POSIX 1003.1 standard pwrite. @@ -4275,15 +4289,15 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection); #define WT_STAT_CONN_CACHE_EVICTION_QUEUE_NOT_EMPTY 1042 /*! cache: eviction server evicting pages */ #define WT_STAT_CONN_CACHE_EVICTION_SERVER_EVICTING 1043 -/*! cache: eviction server populating queue, but not evicting pages */ -#define WT_STAT_CONN_CACHE_EVICTION_SERVER_NOT_EVICTING 1044 /*! cache: eviction server skipped very large page */ -#define WT_STAT_CONN_CACHE_EVICTION_SERVER_TOOBIG 1045 +#define WT_STAT_CONN_CACHE_EVICTION_SERVER_TOOBIG 1044 /*! cache: eviction server slept, because we did not make progress with * eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SERVER_SLEPT 1046 +#define WT_STAT_CONN_CACHE_EVICTION_SERVER_SLEPT 1045 /*! cache: eviction server unable to reach eviction goal */ -#define WT_STAT_CONN_CACHE_EVICTION_SLOW 1047 +#define WT_STAT_CONN_CACHE_EVICTION_SLOW 1046 +/*! cache: eviction state */ +#define WT_STAT_CONN_CACHE_EVICTION_STATE 1047 /*! cache: eviction worker thread evicting pages */ #define WT_STAT_CONN_CACHE_EVICTION_WORKER_EVICTING 1048 /*! cache: failed eviction of pages that exceeded the in-memory maximum */ diff --git a/src/third_party/wiredtiger/src/include/wt_internal.h b/src/third_party/wiredtiger/src/include/wt_internal.h index c5337967f22..99180896611 100644 --- a/src/third_party/wiredtiger/src/include/wt_internal.h +++ b/src/third_party/wiredtiger/src/include/wt_internal.h @@ -170,14 +170,10 @@ struct __wt_evict_entry; typedef struct __wt_evict_entry WT_EVICT_ENTRY; struct __wt_evict_queue; typedef struct __wt_evict_queue WT_EVICT_QUEUE; -struct __wt_evict_worker; - typedef struct __wt_evict_worker WT_EVICT_WORKER; struct __wt_ext; typedef struct __wt_ext WT_EXT; struct __wt_extlist; typedef struct __wt_extlist WT_EXTLIST; -struct __wt_fair_lock; - typedef struct __wt_fair_lock WT_FAIR_LOCK; struct __wt_fh; typedef struct __wt_fh WT_FH; struct __wt_file_handle_inmem; @@ -286,6 +282,10 @@ struct __wt_split_stash; typedef struct __wt_split_stash WT_SPLIT_STASH; struct __wt_table; typedef struct __wt_table WT_TABLE; +struct __wt_thread; + typedef struct __wt_thread WT_THREAD; +struct __wt_thread_group; + typedef struct __wt_thread_group WT_THREAD_GROUP; struct __wt_txn; typedef struct __wt_txn WT_TXN; struct __wt_txn_global; @@ -350,6 +350,7 @@ union __wt_rand_state; #include "meta.h" #include "os.h" #include "schema.h" +#include "thread_group.h" #include "txn.h" #include "session.h" /* required by connection.h */ diff --git a/src/third_party/wiredtiger/src/log/log.c b/src/third_party/wiredtiger/src/log/log.c index 8ec910115ac..14cb2b8c064 100644 --- a/src/third_party/wiredtiger/src/log/log.c +++ b/src/third_party/wiredtiger/src/log/log.c @@ -25,7 +25,7 @@ static int __log_write_internal( * Record the given LSN as the checkpoint LSN and signal the archive * thread as needed. */ -int +void __wt_log_ckpt(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn) { WT_CONNECTION_IMPL *conn; @@ -35,8 +35,7 @@ __wt_log_ckpt(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn) log = conn->log; log->ckpt_lsn = *ckp_lsn; if (conn->log_cond != NULL) - WT_RET(__wt_cond_auto_signal(session, conn->log_cond)); - return (0); + __wt_cond_auto_signal(session, conn->log_cond); } /* @@ -53,7 +52,7 @@ __wt_log_flush_lsn(WT_SESSION_IMPL *session, WT_LSN *lsn, bool start) conn = S2C(session); log = conn->log; WT_RET(__wt_log_force_write(session, 1, NULL)); - WT_RET(__wt_log_wrlsn(session, NULL)); + __wt_log_wrlsn(session, NULL); if (start) *lsn = log->write_start_lsn; else @@ -66,7 +65,7 @@ __wt_log_flush_lsn(WT_SESSION_IMPL *session, WT_LSN *lsn, bool start) * Record the given LSN as the background LSN and signal the * thread as needed. */ -int +void __wt_log_background(WT_SESSION_IMPL *session, WT_LSN *lsn) { WT_CONNECTION_IMPL *conn; @@ -78,7 +77,7 @@ __wt_log_background(WT_SESSION_IMPL *session, WT_LSN *lsn) * If a thread already set the LSN to a bigger LSN, we're done. */ if (__wt_log_cmp(&session->bg_sync_lsn, lsn) > 0) - return (0); + return; session->bg_sync_lsn = *lsn; /* @@ -89,7 +88,7 @@ __wt_log_background(WT_SESSION_IMPL *session, WT_LSN *lsn) if (__wt_log_cmp(lsn, &log->bg_sync_lsn) > 0) log->bg_sync_lsn = *lsn; __wt_spin_unlock(session, &log->log_sync_lock); - return (__wt_cond_signal(session, conn->log_file_cond)); + __wt_cond_signal(session, conn->log_file_cond); } /* @@ -115,9 +114,8 @@ __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn) * log file ready to close. */ while (log->sync_lsn.l.file < min_lsn->l.file) { - WT_ERR(__wt_cond_signal(session, - S2C(session)->log_file_cond)); - WT_ERR(__wt_cond_wait(session, log->log_sync_cond, 10000)); + __wt_cond_signal(session, S2C(session)->log_file_cond); + __wt_cond_wait(session, log->log_sync_cond, 10000); } __wt_spin_lock(session, &log->log_sync_lock); WT_ASSERT(session, log->log_dir_fh != NULL); @@ -126,10 +124,10 @@ __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn) * into the directory. */ if (log->sync_dir_lsn.l.file < min_lsn->l.file) { - WT_ERR(__wt_verbose(session, WT_VERB_LOG, + __wt_verbose(session, WT_VERB_LOG, "log_force_sync: sync directory %s to LSN %" PRIu32 "/%" PRIu32, - log->log_dir_fh->name, min_lsn->l.file, min_lsn->l.offset)); + log->log_dir_fh->name, min_lsn->l.file, min_lsn->l.offset); WT_ERR(__wt_epoch(session, &fsync_start)); WT_ERR(__wt_fsync(session, log->log_dir_fh, true)); WT_ERR(__wt_epoch(session, &fsync_stop)); @@ -151,9 +149,9 @@ __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn) */ WT_ERR(__log_openfile(session, &log_fh, WT_LOG_FILENAME, min_lsn->l.file, 0)); - WT_ERR(__wt_verbose(session, WT_VERB_LOG, + __wt_verbose(session, WT_VERB_LOG, "log_force_sync: sync %s to LSN %" PRIu32 "/%" PRIu32, - log_fh->name, min_lsn->l.file, min_lsn->l.offset)); + log_fh->name, min_lsn->l.file, min_lsn->l.offset); WT_ERR(__wt_epoch(session, &fsync_start)); WT_ERR(__wt_fsync(session, log_fh, true)); WT_ERR(__wt_epoch(session, &fsync_stop)); @@ -163,7 +161,7 @@ __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn) WT_STAT_FAST_CONN_INCRV(session, log_sync_duration, fsync_duration_usecs); WT_ERR(__wt_close(session, &log_fh)); - WT_ERR(__wt_cond_signal(session, log->log_sync_cond)); + __wt_cond_signal(session, log->log_sync_cond); } err: __wt_spin_unlock(session, &log->log_sync_lock); @@ -460,7 +458,7 @@ __log_prealloc(WT_SESSION_IMPL *session, WT_FH *fh) /* * If the user configured zero filling, pre-allocate the log file - * manually. Otherwise use either fallocate or ftruncate to create + * manually. Otherwise use the file extension method to create * and zero the log file based on what is available. */ if (FLD_ISSET(conn->log_flags, WT_CONN_LOG_ZERO_FILL)) @@ -471,13 +469,8 @@ __log_prealloc(WT_SESSION_IMPL *session, WT_FH *fh) * We have exclusive access to the log file and there are no other * writes happening concurrently, so there are no locking issues. */ - if ((ret = __wt_fallocate( - session, fh, WT_LOG_FIRST_RECORD, - conn->log_file_max - WT_LOG_FIRST_RECORD)) == 0) - return (0); - WT_RET_ERROR_OK(ret, ENOTSUP); - - return (__wt_ftruncate(session, fh, conn->log_file_max)); + ret = __wt_fextend(session, fh, conn->log_file_max); + return (ret == EBUSY || ret == ENOTSUP ? 0 : ret); } /* @@ -706,8 +699,8 @@ __log_openfile(WT_SESSION_IMPL *session, allocsize = log->allocsize; WT_RET(__wt_scr_alloc(session, 0, &buf)); WT_ERR(__log_filename(session, id, file_prefix, buf)); - WT_ERR(__wt_verbose(session, WT_VERB_LOG, - "opening log %s", (const char *)buf->data)); + __wt_verbose(session, WT_VERB_LOG, + "opening log %s", (const char *)buf->data); wtopen_flags = 0; if (LF_ISSET(WT_LOG_OPEN_CREATE_OK)) FLD_SET(wtopen_flags, WT_FS_OPEN_CREATE); @@ -778,9 +771,9 @@ __log_alloc_prealloc(WT_SESSION_IMPL *session, uint32_t to_num) WT_ERR(__wt_scr_alloc(session, 0, &to_path)); WT_ERR(__log_filename(session, from_num, WT_LOG_PREPNAME, from_path)); WT_ERR(__log_filename(session, to_num, WT_LOG_FILENAME, to_path)); - WT_ERR(__wt_verbose(session, WT_VERB_LOG, + __wt_verbose(session, WT_VERB_LOG, "log_alloc_prealloc: rename log %s to %s", - (char *)from_path->data, (char *)to_path->data)); + (const char *)from_path->data, (const char *)to_path->data); WT_STAT_FAST_CONN_INCR(session, log_prealloc_used); /* * All file setup, writing the header and pre-allocation was done @@ -823,7 +816,7 @@ __log_newfile(WT_SESSION_IMPL *session, bool conn_open, bool *created) WT_ASSERT(session, F_ISSET(session, WT_SESSION_LOCKED_SLOT)); while (log->log_close_fh != NULL) { WT_STAT_FAST_CONN_INCR(session, log_close_yields); - WT_RET(__wt_log_wrlsn(session, NULL)); + __wt_log_wrlsn(session, NULL); if (++yield_cnt > 10000) return (EBUSY); __wt_yield(); @@ -864,8 +857,7 @@ __log_newfile(WT_SESSION_IMPL *session, bool conn_open, bool *created) if (create_log) { WT_STAT_FAST_CONN_INCR(session, log_prealloc_missed); if (conn->log_cond != NULL) - WT_RET(__wt_cond_auto_signal( - session, conn->log_cond)); + __wt_cond_auto_signal(session, conn->log_cond); } } /* @@ -960,6 +952,33 @@ __wt_log_acquire(WT_SESSION_IMPL *session, uint64_t recsize, WT_LOGSLOT *slot) } /* + * __log_truncate_file -- + * Truncate a log file to the specified offset. + * + * If the underlying file system doesn't support truncate then we need to + * zero out the rest of the file, doing an effective truncate. + */ +static int +__log_truncate_file(WT_SESSION_IMPL *session, WT_FH *log_fh, wt_off_t offset) +{ + WT_CONNECTION_IMPL *conn; + WT_DECL_RET; + WT_LOG *log; + + conn = S2C(session); + log = conn->log; + + if (!F_ISSET(log, WT_LOG_TRUNCATE_NOTSUP)) { + if ((ret = __wt_ftruncate(session, log_fh, offset)) != ENOTSUP) + return (ret); + + F_SET(log, WT_LOG_TRUNCATE_NOTSUP); + } + + return (__log_zero(session, log_fh, offset, conn->log_file_max)); +} + +/* * __log_truncate -- * Truncate the log to the given LSN. If this_log is set, it will only * truncate the log file indicated in the given LSN. If not set, @@ -989,10 +1008,15 @@ __log_truncate(WT_SESSION_IMPL *session, /* * Truncate the log file to the given LSN. - */ - WT_ERR(__log_openfile(session, - &log_fh, file_prefix, lsn->l.file, 0)); - WT_ERR(__wt_ftruncate(session, log_fh, lsn->l.offset)); + * + * It's possible the underlying file system doesn't support truncate + * (there are existing examples), which is fine, but we don't want to + * repeatedly do the setup work just to find that out every time. Check + * before doing work, and if there's a not-supported error, turn off + * future truncates. + */ + WT_ERR(__log_openfile(session, &log_fh, file_prefix, lsn->l.file, 0)); + WT_ERR(__log_truncate_file(session, log_fh, lsn->l.offset)); WT_ERR(__wt_fsync(session, log_fh, true)); WT_ERR(__wt_close(session, &log_fh)); @@ -1013,8 +1037,8 @@ __log_truncate(WT_SESSION_IMPL *session, * If there are intervening files pre-allocated, * truncate them to the end of the log file header. */ - WT_ERR(__wt_ftruncate(session, - log_fh, WT_LOG_FIRST_RECORD)); + WT_ERR(__log_truncate_file( + session, log_fh, WT_LOG_FIRST_RECORD)); WT_ERR(__wt_fsync(session, log_fh, true)); WT_ERR(__wt_close(session, &log_fh)); } @@ -1066,9 +1090,9 @@ __wt_log_allocfile( WT_ERR(__log_prealloc(session, log_fh)); WT_ERR(__wt_fsync(session, log_fh, true)); WT_ERR(__wt_close(session, &log_fh)); - WT_ERR(__wt_verbose(session, WT_VERB_LOG, + __wt_verbose(session, WT_VERB_LOG, "log_prealloc: rename %s to %s", - (char *)from_path->data, (char *)to_path->data)); + (const char *)from_path->data, (const char *)to_path->data); /* * Rename it into place and make it available. */ @@ -1093,8 +1117,8 @@ __wt_log_remove(WT_SESSION_IMPL *session, WT_RET(__wt_scr_alloc(session, 0, &path)); WT_ERR(__log_filename(session, lognum, file_prefix, path)); - WT_ERR(__wt_verbose(session, WT_VERB_LOG, - "log_remove: remove log %s", (char *)path->data)); + __wt_verbose(session, WT_VERB_LOG, + "log_remove: remove log %s", (const char *)path->data); WT_ERR(__wt_fs_remove(session, path->data, false)); err: __wt_scr_free(session, &path); return (ret); @@ -1128,8 +1152,8 @@ __wt_log_open(WT_SESSION_IMPL *session) * Open up a file handle to the log directory if we haven't. */ if (log->log_dir_fh == NULL) { - WT_RET(__wt_verbose(session, WT_VERB_LOG, - "log_open: open fh to directory %s", conn->log_path)); + __wt_verbose(session, WT_VERB_LOG, + "log_open: open fh to directory %s", conn->log_path); WT_RET(__wt_open(session, conn->log_path, WT_FS_OPEN_FILE_TYPE_DIRECTORY, 0, &log->log_dir_fh)); } @@ -1172,9 +1196,9 @@ __wt_log_open(WT_SESSION_IMPL *session) firstlog = WT_MIN(firstlog, lognum); } log->fileid = lastlog; - WT_ERR(__wt_verbose(session, WT_VERB_LOG, + __wt_verbose(session, WT_VERB_LOG, "log_open: first log %" PRIu32 " last log %" PRIu32, - firstlog, lastlog)); + firstlog, lastlog); if (firstlog == UINT32_MAX) { WT_ASSERT(session, logcount == 0); WT_INIT_LSN(&log->first_lsn); @@ -1217,23 +1241,23 @@ __wt_log_close(WT_SESSION_IMPL *session) log = conn->log; if (log->log_close_fh != NULL && log->log_close_fh != log->log_fh) { - WT_RET(__wt_verbose(session, WT_VERB_LOG, - "closing old log %s", log->log_close_fh->name)); + __wt_verbose(session, WT_VERB_LOG, + "closing old log %s", log->log_close_fh->name); if (!F_ISSET(conn, WT_CONN_READONLY)) WT_RET(__wt_fsync(session, log->log_close_fh, true)); WT_RET(__wt_close(session, &log->log_close_fh)); } if (log->log_fh != NULL) { - WT_RET(__wt_verbose(session, WT_VERB_LOG, - "closing log %s", log->log_fh->name)); + __wt_verbose(session, WT_VERB_LOG, + "closing log %s", log->log_fh->name); if (!F_ISSET(conn, WT_CONN_READONLY)) WT_RET(__wt_fsync(session, log->log_fh, true)); WT_RET(__wt_close(session, &log->log_fh)); log->log_fh = NULL; } if (log->log_dir_fh != NULL) { - WT_RET(__wt_verbose(session, WT_VERB_LOG, - "closing log directory %s", log->log_dir_fh->name)); + __wt_verbose(session, WT_VERB_LOG, + "closing log directory %s", log->log_dir_fh->name); if (!F_ISSET(conn, WT_CONN_READONLY)) WT_RET(__wt_fsync(session, log->log_dir_fh, true)); WT_RET(__wt_close(session, &log->log_dir_fh)); @@ -1384,28 +1408,27 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep) */ if (F_ISSET(session, WT_SESSION_LOCKED_SLOT)) __wt_spin_unlock(session, &log->log_slot_lock); - WT_ERR(__wt_cond_auto_signal(session, conn->log_wrlsn_cond)); + __wt_cond_auto_signal(session, conn->log_wrlsn_cond); if (++yield_count < WT_THOUSAND) __wt_yield(); else - ret = __wt_cond_wait(session, log->log_write_cond, 200); + __wt_cond_wait(session, log->log_write_cond, 200); if (F_ISSET(session, WT_SESSION_LOCKED_SLOT)) __wt_spin_lock(session, &log->log_slot_lock); - WT_ERR(ret); } log->write_start_lsn = slot->slot_start_lsn; log->write_lsn = slot->slot_end_lsn; WT_ASSERT(session, slot != log->active_slot); - WT_ERR(__wt_cond_signal(session, log->log_write_cond)); + __wt_cond_signal(session, log->log_write_cond); F_CLR(slot, WT_SLOT_FLUSH); /* * Signal the close thread if needed. */ if (F_ISSET(slot, WT_SLOT_CLOSEFH)) - WT_ERR(__wt_cond_signal(session, conn->log_file_cond)); + __wt_cond_signal(session, conn->log_file_cond); /* * Try to consolidate calls to fsync to wait less. Acquire a spin lock @@ -1420,8 +1443,7 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep) */ if (log->sync_lsn.l.file < slot->slot_end_lsn.l.file || __wt_spin_trylock(session, &log->log_sync_lock) != 0) { - WT_ERR(__wt_cond_wait( - session, log->log_sync_cond, 10000)); + __wt_cond_wait(session, log->log_sync_cond, 10000); continue; } locked = true; @@ -1440,11 +1462,11 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep) if (F_ISSET(slot, WT_SLOT_SYNC_DIR) && (log->sync_dir_lsn.l.file < sync_lsn.l.file)) { WT_ASSERT(session, log->log_dir_fh != NULL); - WT_ERR(__wt_verbose(session, WT_VERB_LOG, + __wt_verbose(session, WT_VERB_LOG, "log_release: sync directory %s to LSN %" PRIu32 "/%" PRIu32, log->log_dir_fh->name, - sync_lsn.l.file, sync_lsn.l.offset)); + sync_lsn.l.file, sync_lsn.l.offset); WT_ERR(__wt_epoch(session, &fsync_start)); WT_ERR(__wt_fsync(session, log->log_dir_fh, true)); WT_ERR(__wt_epoch(session, &fsync_stop)); @@ -1461,11 +1483,11 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep) */ if (F_ISSET(slot, WT_SLOT_SYNC) && __wt_log_cmp(&log->sync_lsn, &slot->slot_end_lsn) < 0) { - WT_ERR(__wt_verbose(session, WT_VERB_LOG, + __wt_verbose(session, WT_VERB_LOG, "log_release: sync log %s to LSN %" PRIu32 "/%" PRIu32, log->log_fh->name, - sync_lsn.l.file, sync_lsn.l.offset)); + sync_lsn.l.file, sync_lsn.l.offset); WT_STAT_FAST_CONN_INCR(session, log_sync); WT_ERR(__wt_epoch(session, &fsync_start)); WT_ERR(__wt_fsync(session, log->log_fh, true)); @@ -1475,7 +1497,7 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep) WT_STAT_FAST_CONN_INCRV(session, log_sync_duration, fsync_duration_usecs); log->sync_lsn = sync_lsn; - WT_ERR(__wt_cond_signal(session, log->log_sync_cond)); + __wt_cond_signal(session, log->log_sync_cond); } /* * Clear the flags before leaving the loop. @@ -1535,9 +1557,9 @@ __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags, return (0); if (LF_ISSET(WT_LOGSCAN_RECOVER)) - WT_RET(__wt_verbose(session, WT_VERB_LOG, + __wt_verbose(session, WT_VERB_LOG, "__wt_log_scan truncating to %" PRIu32 "/%" PRIu32, - log->trunc_lsn.l.file, log->trunc_lsn.l.offset)); + log->trunc_lsn.l.file, log->trunc_lsn.l.offset); if (log != NULL) { allocsize = log->allocsize; @@ -2085,7 +2107,7 @@ __log_write_internal(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, * XXX I've seen times when conditions are NULL. */ if (conn->log_cond != NULL) { - WT_ERR(__wt_cond_auto_signal(session, conn->log_cond)); + __wt_cond_auto_signal(session, conn->log_cond); __wt_yield(); } else WT_ERR(__wt_log_force_write(session, 1, NULL)); @@ -2094,21 +2116,19 @@ __log_write_internal(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, /* Wait for our writes to reach the OS */ while (__wt_log_cmp(&log->write_lsn, &lsn) <= 0 && myslot.slot->slot_error == 0) - (void)__wt_cond_wait( - session, log->log_write_cond, 10000); + __wt_cond_wait(session, log->log_write_cond, 10000); } else if (LF_ISSET(WT_LOG_FSYNC)) { /* Wait for our writes to reach disk */ while (__wt_log_cmp(&log->sync_lsn, &lsn) <= 0 && myslot.slot->slot_error == 0) - (void)__wt_cond_wait( - session, log->log_sync_cond, 10000); + __wt_cond_wait(session, log->log_sync_cond, 10000); } /* * Advance the background sync LSN if needed. */ if (LF_ISSET(WT_LOG_BACKGROUND)) - WT_ERR(__wt_log_background(session, &lsn)); + __wt_log_background(session, &lsn); err: if (ret == 0 && lsnp != NULL) @@ -2176,8 +2196,8 @@ __wt_log_vprintf(WT_SESSION_IMPL *session, const char *fmt, va_list ap) (void)vsnprintf((char *)logrec->data + logrec->size, len, fmt, ap); - WT_ERR(__wt_verbose(session, WT_VERB_LOG, - "log_printf: %s", (char *)logrec->data + logrec->size)); + __wt_verbose(session, WT_VERB_LOG, + "log_printf: %s", (char *)logrec->data + logrec->size); logrec->size += len; WT_ERR(__wt_log_write(session, logrec, NULL, 0)); @@ -2223,16 +2243,16 @@ __wt_log_flush(WT_SESSION_IMPL *session, uint32_t flags) while (__wt_log_cmp(&last_lsn, &lsn) > 0) WT_RET(__wt_log_flush_lsn(session, &lsn, false)); - WT_RET(__wt_verbose(session, WT_VERB_LOG, + __wt_verbose(session, WT_VERB_LOG, "log_flush: flags %#" PRIx32 " LSN %" PRIu32 "/%" PRIu32, - flags, lsn.l.file, lsn.l.offset)); + flags, lsn.l.file, lsn.l.offset); /* * If the user wants write-no-sync, there is nothing more to do. * If the user wants background sync, set the LSN and we're done. * If the user wants sync, force it now. */ if (LF_ISSET(WT_LOG_BACKGROUND)) - WT_RET(__wt_log_background(session, &lsn)); + __wt_log_background(session, &lsn); else if (LF_ISSET(WT_LOG_FSYNC)) WT_RET(__wt_log_force_sync(session, &lsn)); return (0); diff --git a/src/third_party/wiredtiger/src/log/log_slot.c b/src/third_party/wiredtiger/src/log/log_slot.c index 47071211450..58377aff6f5 100644 --- a/src/third_party/wiredtiger/src/log/log_slot.c +++ b/src/third_party/wiredtiger/src/log/log_slot.c @@ -262,7 +262,7 @@ __wt_log_slot_new(WT_SESSION_IMPL *session) /* * If we didn't find any free slots signal the worker thread. */ - (void)__wt_cond_auto_signal(session, conn->log_wrlsn_cond); + __wt_cond_auto_signal(session, conn->log_wrlsn_cond); __wt_yield(); } /* NOTREACHED */ diff --git a/src/third_party/wiredtiger/src/lsm/lsm_cursor.c b/src/third_party/wiredtiger/src/lsm/lsm_cursor.c index bedef6a8596..78d77884d40 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_cursor.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_cursor.c @@ -40,7 +40,7 @@ __wt_clsm_request_switch(WT_CURSOR_LSM *clsm) * to switching multiple times when only one switch is * required, creating very small chunks. */ - WT_RET(__wt_lsm_tree_readlock(session, lsm_tree)); + __wt_lsm_tree_readlock(session, lsm_tree); if (lsm_tree->nchunks == 0 || (clsm->dsk_gen == lsm_tree->dsk_gen && !F_ISSET(lsm_tree, WT_LSM_TREE_NEED_SWITCH))) { @@ -48,7 +48,7 @@ __wt_clsm_request_switch(WT_CURSOR_LSM *clsm) ret = __wt_lsm_manager_push_entry( session, WT_LSM_WORK_SWITCH, 0, lsm_tree); } - WT_TRET(__wt_lsm_tree_readunlock(session, lsm_tree)); + __wt_lsm_tree_readunlock(session, lsm_tree); } return (ret); @@ -458,7 +458,7 @@ __clsm_open_cursors( F_CLR(clsm, WT_CLSM_ITERATE_NEXT | WT_CLSM_ITERATE_PREV); - WT_RET(__wt_lsm_tree_readlock(session, lsm_tree)); + __wt_lsm_tree_readlock(session, lsm_tree); locked = true; /* Merge cursors have already figured out how many chunks they need. */ @@ -577,10 +577,10 @@ retry: if (F_ISSET(clsm, WT_CLSM_MERGE)) { if (close_range_end > close_range_start) { saved_gen = lsm_tree->dsk_gen; locked = false; - WT_ERR(__wt_lsm_tree_readunlock(session, lsm_tree)); + __wt_lsm_tree_readunlock(session, lsm_tree); WT_ERR(__clsm_close_cursors( clsm, close_range_start, close_range_end)); - WT_ERR(__wt_lsm_tree_readlock(session, lsm_tree)); + __wt_lsm_tree_readlock(session, lsm_tree); locked = true; if (lsm_tree->dsk_gen != saved_gen) goto retry; @@ -698,7 +698,7 @@ err: } #endif if (locked) - WT_TRET(__wt_lsm_tree_readunlock(session, lsm_tree)); + __wt_lsm_tree_readunlock(session, lsm_tree); return (ret); } diff --git a/src/third_party/wiredtiger/src/lsm/lsm_manager.c b/src/third_party/wiredtiger/src/lsm/lsm_manager.c index 943a5894ab3..bafab9abaa3 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_manager.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_manager.c @@ -358,7 +358,7 @@ __lsm_manager_worker_shutdown(WT_SESSION_IMPL *session) */ for (i = 1; i < manager->lsm_workers; i++) { WT_ASSERT(session, manager->lsm_worker_cookies[i].tid != 0); - WT_TRET(__wt_cond_signal(session, manager->work_cond)); + __wt_cond_signal(session, manager->work_cond); WT_TRET(__wt_thread_join( session, manager->lsm_worker_cookies[i].tid)); } @@ -431,7 +431,7 @@ __lsm_manager_run_server(WT_SESSION_IMPL *session) session, WT_LSM_WORK_FLUSH, 0, lsm_tree)); WT_ERR(__wt_lsm_manager_push_entry( session, WT_LSM_WORK_BLOOM, 0, lsm_tree)); - WT_ERR(__wt_verbose(session, + __wt_verbose(session, WT_VERB_LSM_MANAGER, "MGR %s: queue %" PRIu32 " mod %d " "nchunks %" PRIu32 @@ -442,7 +442,7 @@ __lsm_manager_run_server(WT_SESSION_IMPL *session) lsm_tree->modified, lsm_tree->nchunks, lsm_tree->flags, lsm_tree->merge_aggressiveness, - pushms, fillms)); + pushms, fillms); WT_ERR(__wt_lsm_manager_push_entry( session, WT_LSM_WORK_MERGE, 0, lsm_tree)); } @@ -617,10 +617,8 @@ int __wt_lsm_manager_push_entry(WT_SESSION_IMPL *session, uint32_t type, uint32_t flags, WT_LSM_TREE *lsm_tree) { - WT_DECL_RET; WT_LSM_MANAGER *manager; WT_LSM_WORK_UNIT *entry; - bool pushed; manager = &S2C(session)->lsm_manager; @@ -655,9 +653,8 @@ __wt_lsm_manager_push_entry(WT_SESSION_IMPL *session, return (0); } - pushed = false; - WT_ERR(__wt_epoch(session, &lsm_tree->work_push_ts)); - WT_ERR(__wt_calloc_one(session, &entry)); + WT_RET(__wt_epoch(session, &lsm_tree->work_push_ts)); + WT_RET(__wt_calloc_one(session, &entry)); entry->type = type; entry->flags = flags; entry->lsm_tree = lsm_tree; @@ -672,12 +669,7 @@ __wt_lsm_manager_push_entry(WT_SESSION_IMPL *session, else LSM_PUSH_ENTRY(&manager->appqh, &manager->app_lock, lsm_work_queue_app); - pushed = true; - WT_ERR(__wt_cond_signal(session, manager->work_cond)); + __wt_cond_signal(session, manager->work_cond); return (0); -err: - if (!pushed) - (void)__wt_atomic_sub32(&lsm_tree->queue_ref, 1); - return (ret); } diff --git a/src/third_party/wiredtiger/src/lsm/lsm_merge.c b/src/third_party/wiredtiger/src/lsm/lsm_merge.c index 1ff0a216c02..ccad6c90449 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_merge.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_merge.c @@ -124,13 +124,13 @@ __lsm_merge_aggressive_update(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) ++new_aggressive; if (new_aggressive > lsm_tree->merge_aggressiveness) { - WT_RET(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "LSM merge %s got aggressive " "(old %" PRIu32 " new %" PRIu32 "), " "merge_min %u, %" PRIu64 " / %" PRIu64, lsm_tree->name, lsm_tree->merge_aggressiveness, new_aggressive, lsm_tree->merge_min, - msec_since_last_merge, lsm_tree->chunk_fill_ms)); + msec_since_last_merge, lsm_tree->chunk_fill_ms); lsm_tree->merge_aggressiveness = new_aggressive; } return (0); @@ -372,7 +372,7 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id) * avoid holding it while the merge is in progress: that may take a * long time. */ - WT_RET(__wt_lsm_tree_writelock(session, lsm_tree)); + __wt_lsm_tree_writelock(session, lsm_tree); locked = true; WT_ERR(__lsm_merge_span(session, @@ -387,7 +387,7 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id) generation = WT_MAX(generation, lsm_tree->chunk[start_chunk + i]->generation + 1); - WT_ERR(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); locked = false; /* Allocate an ID for the merge. */ @@ -399,20 +399,20 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id) * in the normal path. */ if (WT_VERBOSE_ISSET(session, WT_VERB_LSM)) { - WT_ERR(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "Merging %s chunks %u-%u into %u (%" PRIu64 " records)" ", generation %" PRIu32, lsm_tree->name, - start_chunk, end_chunk, dest_id, record_count, generation)); - for (verb = start_chunk; verb <= end_chunk; verb++) - WT_ERR(__wt_verbose(session, WT_VERB_LSM, + start_chunk, end_chunk, dest_id, record_count, generation); + for (verb = start_chunk; verb < end_chunk + 1; verb++) + __wt_verbose(session, WT_VERB_LSM, "Merging %s: Chunk[%u] id %" PRIu32 ", gen: %" PRIu32 ", size: %" PRIu64 ", records: %" PRIu64, lsm_tree->name, verb, lsm_tree->chunk[verb]->id, lsm_tree->chunk[verb]->generation, lsm_tree->chunk[verb]->size, - lsm_tree->chunk[verb]->count)); + lsm_tree->chunk[verb]->count); } WT_ERR(__wt_calloc_one(session, &chunk)); @@ -478,9 +478,9 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id) WT_STAT_FAST_CONN_INCRV(session, lsm_rows_merged, insert_count % LSM_MERGE_CHECK_INTERVAL); ++lsm_tree->merge_progressing; - WT_ERR(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "Bloom size for %" PRIu64 " has %" PRIu64 " items inserted", - record_count, insert_count)); + record_count, insert_count); /* * Closing and syncing the files can take a while. Set the @@ -543,7 +543,7 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id) WT_ERR_NOTFOUND_OK(ret); WT_ERR(__wt_lsm_tree_set_chunk_size(session, chunk)); - WT_ERR(__wt_lsm_tree_writelock(session, lsm_tree)); + __wt_lsm_tree_writelock(session, lsm_tree); locked = true; /* @@ -592,7 +592,7 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id) session, WT_LSM_WORK_DROP, 0, lsm_tree)); err: if (locked) - WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); if (in_sync) (void)__wt_atomic_sub32(&lsm_tree->merge_syncing, 1); if (src != NULL) @@ -620,12 +620,12 @@ err: if (locked) __wt_free(session, chunk); if (ret == EINTR) - WT_TRET(__wt_verbose(session, WT_VERB_LSM, - "Merge aborted due to close")); + __wt_verbose(session, WT_VERB_LSM, + "Merge aborted due to close"); else - WT_TRET(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "Merge failed with %s", - __wt_strerror(session, ret, NULL, 0))); + __wt_strerror(session, ret, NULL, 0)); } F_CLR(session, WT_SESSION_NO_CACHE | WT_SESSION_NO_EVICTION); return (ret); diff --git a/src/third_party/wiredtiger/src/lsm/lsm_stat.c b/src/third_party/wiredtiger/src/lsm/lsm_stat.c index 76e2ca6185e..95909ce30e8 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_stat.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_stat.c @@ -51,7 +51,7 @@ __curstat_lsm_init( } /* Hold the LSM lock so that we can safely walk through the chunks. */ - WT_ERR(__wt_lsm_tree_readlock(session, lsm_tree)); + __wt_lsm_tree_readlock(session, lsm_tree); locked = true; /* @@ -155,7 +155,7 @@ __curstat_lsm_init( __wt_curstat_dsrc_final(cst); err: if (locked) - WT_TRET(__wt_lsm_tree_readunlock(session, lsm_tree)); + __wt_lsm_tree_readunlock(session, lsm_tree); __wt_lsm_tree_release(session, lsm_tree); __wt_scr_free(session, &uribuf); diff --git a/src/third_party/wiredtiger/src/lsm/lsm_tree.c b/src/third_party/wiredtiger/src/lsm/lsm_tree.c index 2ecfb614eee..c84f5c519cf 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_tree.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_tree.c @@ -55,7 +55,7 @@ __lsm_tree_discard(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, bool final) __wt_free(session, lsm_tree->bloom_config); __wt_free(session, lsm_tree->file_config); - WT_TRET(__wt_rwlock_destroy(session, &lsm_tree->rwlock)); + __wt_rwlock_destroy(session, &lsm_tree->rwlock); for (i = 0; i < lsm_tree->nchunks; i++) { if ((chunk = lsm_tree->chunk[i]) == NULL) @@ -730,7 +730,7 @@ __wt_lsm_tree_switch(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) uint32_t chunks_moved, nchunks, new_id; bool first_switch; - WT_RET(__wt_lsm_tree_writelock(session, lsm_tree)); + __wt_lsm_tree_writelock(session, lsm_tree); nchunks = lsm_tree->nchunks; @@ -755,10 +755,10 @@ __wt_lsm_tree_switch(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) WT_ERR(__wt_realloc_def(session, &lsm_tree->chunk_alloc, nchunks + 1, &lsm_tree->chunk)); - WT_ERR(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "Tree %s switch to: %" PRIu32 ", checkpoint throttle %" PRIu64 ", merge throttle %" PRIu64, lsm_tree->name, - new_id, lsm_tree->ckpt_throttle, lsm_tree->merge_throttle)); + new_id, lsm_tree->ckpt_throttle, lsm_tree->merge_throttle); WT_ERR(__wt_calloc_one(session, &chunk)); chunk->id = new_id; @@ -811,7 +811,7 @@ __wt_lsm_tree_switch(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) session, WT_LSM_WORK_DROP, 0, lsm_tree)); } -err: WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree)); +err: __wt_lsm_tree_writeunlock(session, lsm_tree); /* * Errors that happen during a tree switch leave the tree in a state * where we can't make progress. Error out of WiredTiger. @@ -874,7 +874,7 @@ __wt_lsm_tree_drop( WT_ASSERT(session, !lsm_tree->active); /* Prevent any new opens. */ - WT_ERR(__wt_lsm_tree_writelock(session, lsm_tree)); + __wt_lsm_tree_writelock(session, lsm_tree); locked = true; /* Drop the chunks. */ @@ -897,12 +897,12 @@ __wt_lsm_tree_drop( } locked = false; - WT_ERR(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); ret = __wt_metadata_remove(session, name); WT_ASSERT(session, !lsm_tree->active); err: if (locked) - WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); WT_WITH_HANDLE_LIST_LOCK(session, tret = __lsm_tree_discard(session, lsm_tree, false)); WT_TRET(tret); @@ -934,7 +934,7 @@ __wt_lsm_tree_rename(WT_SESSION_IMPL *session, WT_RET(ret); /* Prevent any new opens. */ - WT_ERR(__wt_lsm_tree_writelock(session, lsm_tree)); + __wt_lsm_tree_writelock(session, lsm_tree); locked = true; /* Set the new name. */ @@ -965,11 +965,11 @@ __wt_lsm_tree_rename(WT_SESSION_IMPL *session, WT_ERR(__wt_lsm_meta_write(session, lsm_tree)); locked = false; - WT_ERR(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); WT_ERR(__wt_metadata_remove(session, olduri)); err: if (locked) - WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); __wt_free(session, old); /* @@ -1006,7 +1006,7 @@ __wt_lsm_tree_truncate( WT_RET(ret); /* Prevent any new opens. */ - WT_ERR(__wt_lsm_tree_writelock(session, lsm_tree)); + __wt_lsm_tree_writelock(session, lsm_tree); locked = true; /* Create the new chunk. */ @@ -1021,14 +1021,14 @@ __wt_lsm_tree_truncate( WT_ERR(__wt_lsm_meta_write(session, lsm_tree)); locked = false; - WT_ERR(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); __wt_lsm_tree_release(session, lsm_tree); err: if (locked) - WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); if (ret != 0) { if (chunk != NULL) { - (void)__wt_schema_drop(session, chunk->uri, NULL); + WT_TRET(__wt_schema_drop(session, chunk->uri, NULL)); __wt_free(session, chunk); } /* @@ -1048,66 +1048,56 @@ err: if (locked) * __wt_lsm_tree_readlock -- * Acquire a shared lock on an LSM tree. */ -int +void __wt_lsm_tree_readlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) { - WT_RET(__wt_readlock(session, lsm_tree->rwlock)); + __wt_readlock(session, lsm_tree->rwlock); /* * Diagnostic: avoid deadlocks with the schema lock: if we need it for * an operation, we should already have it. */ F_SET(session, WT_SESSION_NO_EVICTION | WT_SESSION_NO_SCHEMA_LOCK); - return (0); } /* * __wt_lsm_tree_readunlock -- * Release a shared lock on an LSM tree. */ -int +void __wt_lsm_tree_readunlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) { - WT_DECL_RET; - F_CLR(session, WT_SESSION_NO_EVICTION | WT_SESSION_NO_SCHEMA_LOCK); - if ((ret = __wt_readunlock(session, lsm_tree->rwlock)) != 0) - WT_PANIC_RET(session, ret, "Unlocking an LSM tree"); - return (0); + __wt_readunlock(session, lsm_tree->rwlock); } /* * __wt_lsm_tree_writelock -- * Acquire an exclusive lock on an LSM tree. */ -int +void __wt_lsm_tree_writelock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) { - WT_RET(__wt_writelock(session, lsm_tree->rwlock)); + __wt_writelock(session, lsm_tree->rwlock); /* * Diagnostic: avoid deadlocks with the schema lock: if we need it for * an operation, we should already have it. */ F_SET(session, WT_SESSION_NO_EVICTION | WT_SESSION_NO_SCHEMA_LOCK); - return (0); } /* * __wt_lsm_tree_writeunlock -- * Release an exclusive lock on an LSM tree. */ -int +void __wt_lsm_tree_writeunlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) { - WT_DECL_RET; - F_CLR(session, WT_SESSION_NO_EVICTION | WT_SESSION_NO_SCHEMA_LOCK); - if ((ret = __wt_writeunlock(session, lsm_tree->rwlock)) != 0) - WT_PANIC_RET(session, ret, "Unlocking an LSM tree"); - return (0); + __wt_writeunlock(session, lsm_tree->rwlock); } /* @@ -1173,7 +1163,7 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp) */ /* Lock the tree: single-thread compaction. */ - WT_ERR(__wt_lsm_tree_writelock(session, lsm_tree)); + __wt_lsm_tree_writelock(session, lsm_tree); locked = true; /* Clear any merge throttle: compact throws out that calculation. */ @@ -1210,13 +1200,13 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp) } locked = false; - WT_ERR(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); if (chunk != NULL) { - WT_ERR(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "Compact force flush %s flags 0x%" PRIx32 " chunk %" PRIu32 " flags 0x%" PRIx32, - name, lsm_tree->flags, chunk->id, chunk->flags)); + name, lsm_tree->flags, chunk->id, chunk->flags); flushing = true; /* * Make sure the in-memory chunk gets flushed do not push a @@ -1233,8 +1223,8 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp) compacting = true; progress = lsm_tree->merge_progressing; F_SET(lsm_tree, WT_LSM_TREE_COMPACTING); - WT_ERR(__wt_verbose(session, WT_VERB_LSM, - "COMPACT: Start compacting %s", lsm_tree->name)); + __wt_verbose(session, WT_VERB_LSM, + "COMPACT: Start compacting %s", lsm_tree->name); } /* Wait for the work unit queues to drain. */ @@ -1247,21 +1237,21 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp) if (flushing) { WT_ASSERT(session, chunk != NULL); if (F_ISSET(chunk, WT_LSM_CHUNK_ONDISK)) { - WT_ERR(__wt_verbose(session, + __wt_verbose(session, WT_VERB_LSM, "Compact flush done %s chunk %" PRIu32 ". " "Start compacting progress %" PRIu64, name, chunk->id, - lsm_tree->merge_progressing)); + lsm_tree->merge_progressing); (void)__wt_atomic_sub32(&chunk->refcnt, 1); flushing = ref = false; compacting = true; F_SET(lsm_tree, WT_LSM_TREE_COMPACTING); progress = lsm_tree->merge_progressing; } else { - WT_ERR(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "Compact flush retry %s chunk %" PRIu32, - name, chunk->id)); + name, chunk->id); WT_ERR(__wt_lsm_manager_push_entry(session, WT_LSM_WORK_FLUSH, WT_LSM_WORK_FORCE, lsm_tree)); @@ -1313,10 +1303,10 @@ err: lsm_tree->merge_aggressiveness = 0; } if (locked) - WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); - WT_TRET(__wt_verbose(session, WT_VERB_LSM, - "Compact %s complete, return %d", name, ret)); + __wt_verbose(session, WT_VERB_LSM, + "Compact %s complete, return %d", name, ret); __wt_lsm_tree_release(session, lsm_tree); return (ret); @@ -1350,9 +1340,10 @@ __wt_lsm_tree_worker(WT_SESSION_IMPL *session, * with merges so that merging doesn't change the chunk * array out from underneath us. */ - WT_ERR(exclusive ? - __wt_lsm_tree_writelock(session, lsm_tree) : - __wt_lsm_tree_readlock(session, lsm_tree)); + if (exclusive) + __wt_lsm_tree_writelock(session, lsm_tree); + else + __wt_lsm_tree_readlock(session, lsm_tree); locked = true; for (i = 0; i < lsm_tree->nchunks; i++) { chunk = lsm_tree->chunk[i]; @@ -1371,10 +1362,12 @@ __wt_lsm_tree_worker(WT_SESSION_IMPL *session, WT_ERR(__wt_schema_worker(session, chunk->bloom_uri, file_func, name_func, cfg, open_flags)); } -err: if (locked) - WT_TRET(exclusive ? - __wt_lsm_tree_writeunlock(session, lsm_tree) : - __wt_lsm_tree_readunlock(session, lsm_tree)); +err: if (locked) { + if (exclusive) + __wt_lsm_tree_writeunlock(session, lsm_tree); + else + __wt_lsm_tree_readunlock(session, lsm_tree); + } __wt_lsm_tree_release(session, lsm_tree); return (ret); } diff --git a/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c b/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c index 0f2a407c70d..bfca09b3807 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c @@ -28,9 +28,11 @@ __lsm_copy_chunks(WT_SESSION_IMPL *session, /* Always return zero chunks on error. */ cookie->nchunks = 0; - WT_RET(__wt_lsm_tree_readlock(session, lsm_tree)); - if (!lsm_tree->active) - return (__wt_lsm_tree_readunlock(session, lsm_tree)); + __wt_lsm_tree_readlock(session, lsm_tree); + if (!lsm_tree->active) { + __wt_lsm_tree_readunlock(session, lsm_tree); + return (0); + } /* Take a copy of the current state of the LSM tree. */ nchunks = old_chunks ? lsm_tree->nold_chunks : lsm_tree->nchunks; @@ -55,7 +57,7 @@ __lsm_copy_chunks(WT_SESSION_IMPL *session, for (i = 0; i < nchunks; i++) (void)__wt_atomic_add32(&cookie->chunk_array[i]->refcnt, 1); -err: WT_TRET(__wt_lsm_tree_readunlock(session, lsm_tree)); +err: __wt_lsm_tree_readunlock(session, lsm_tree); if (ret == 0) cookie->nchunks = nchunks; @@ -78,9 +80,11 @@ __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session, chunk = evict_chunk = flush_chunk = NULL; WT_ASSERT(session, lsm_tree->queue_ref > 0); - WT_RET(__wt_lsm_tree_readlock(session, lsm_tree)); - if (!lsm_tree->active || lsm_tree->nchunks == 0) - return (__wt_lsm_tree_readunlock(session, lsm_tree)); + __wt_lsm_tree_readlock(session, lsm_tree); + if (!lsm_tree->active || lsm_tree->nchunks == 0) { + __wt_lsm_tree_readunlock(session, lsm_tree); + return (0); + } /* Search for a chunk to evict and/or a chunk to flush. */ for (i = 0; i < lsm_tree->nchunks; i++) { @@ -117,15 +121,15 @@ __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session, chunk = (evict_chunk != NULL) ? evict_chunk : flush_chunk; if (chunk != NULL) { - WT_ERR(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "Flush%s: return chunk %" PRIu32 " of %" PRIu32 ": %s", force ? " w/ force" : "", - i, lsm_tree->nchunks, chunk->uri)); + i, lsm_tree->nchunks, chunk->uri); (void)__wt_atomic_add32(&chunk->refcnt, 1); } -err: WT_RET(__wt_lsm_tree_readunlock(session, lsm_tree)); +err: __wt_lsm_tree_readunlock(session, lsm_tree); *chunkp = chunk; return (ret); @@ -282,9 +286,9 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session, WT_RET_MSG(session, ret, "discard handle"); } if (F_ISSET(chunk, WT_LSM_CHUNK_ONDISK)) { - WT_RET(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "LSM worker %s already on disk", - chunk->uri)); + chunk->uri); return (0); } @@ -293,9 +297,9 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session, session, WT_TXN_OLDEST_STRICT | WT_TXN_OLDEST_WAIT)); if (chunk->switch_txn == WT_TXN_NONE || !__wt_txn_visible_all(session, chunk->switch_txn)) { - WT_RET(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "LSM worker %s: running transaction, return", - chunk->uri)); + chunk->uri); return (0); } @@ -303,8 +307,8 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session, return (0); flush_set = true; - WT_ERR(__wt_verbose(session, WT_VERB_LSM, "LSM worker flushing %s", - chunk->uri)); + __wt_verbose(session, WT_VERB_LSM, "LSM worker flushing %s", + chunk->uri); /* * Flush the file before checkpointing: this is the expensive part in @@ -329,8 +333,8 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session, } WT_ERR(ret); - WT_ERR(__wt_verbose(session, WT_VERB_LSM, "LSM worker checkpointing %s", - chunk->uri)); + __wt_verbose(session, WT_VERB_LSM, "LSM worker checkpointing %s", + chunk->uri); /* * Turn on metadata tracking to ensure the checkpoint gets the @@ -358,14 +362,14 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session, ++lsm_tree->chunks_flushed; /* Lock the tree, mark the chunk as on disk and update the metadata. */ - WT_ERR(__wt_lsm_tree_writelock(session, lsm_tree)); + __wt_lsm_tree_writelock(session, lsm_tree); F_SET(chunk, WT_LSM_CHUNK_ONDISK); ret = __wt_lsm_meta_write(session, lsm_tree); ++lsm_tree->dsk_gen; /* Update the throttle time. */ __wt_lsm_tree_throttle(session, lsm_tree, true); - WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); if (ret != 0) WT_ERR_MSG(session, ret, "LSM metadata write"); @@ -385,8 +389,8 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session, /* Make sure we aren't pinning a transaction ID. */ __wt_txn_release_snapshot(session); - WT_ERR(__wt_verbose(session, WT_VERB_LSM, "LSM worker checkpointed %s", - chunk->uri)); + __wt_verbose(session, WT_VERB_LSM, "LSM worker checkpointed %s", + chunk->uri); /* Schedule a bloom filter create for our newly flushed chunk. */ if (!FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_OFF)) @@ -457,17 +461,17 @@ __lsm_bloom_create(WT_SESSION_IMPL *session, WT_CLEAR(key); WT_ERR_NOTFOUND_OK(__wt_bloom_get(bloom, &key)); - WT_ERR(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "LSM worker created bloom filter %s. " "Expected %" PRIu64 " items, got %" PRIu64, - chunk->bloom_uri, chunk->count, insert_count)); + chunk->bloom_uri, chunk->count, insert_count); /* Ensure the bloom filter is in the metadata. */ - WT_ERR(__wt_lsm_tree_writelock(session, lsm_tree)); + __wt_lsm_tree_writelock(session, lsm_tree); F_SET(chunk, WT_LSM_CHUNK_BLOOM); ret = __wt_lsm_meta_write(session, lsm_tree); ++lsm_tree->dsk_gen; - WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); if (ret != 0) WT_ERR_MSG(session, ret, "LSM bloom worker metadata write"); @@ -527,11 +531,11 @@ __lsm_drop_file(WT_SESSION_IMPL *session, const char *uri) if (ret == 0) ret = __wt_fs_remove(session, uri + strlen("file:"), false); - WT_RET(__wt_verbose(session, WT_VERB_LSM, "Dropped %s", uri)); + __wt_verbose(session, WT_VERB_LSM, "Dropped %s", uri); if (ret == EBUSY || ret == ENOENT) - WT_RET(__wt_verbose(session, WT_VERB_LSM, - "LSM worker drop of %s failed with %d", uri, ret)); + __wt_verbose(session, WT_VERB_LSM, + "LSM worker drop of %s failed with %d", uri, ret); return (ret); } @@ -623,7 +627,7 @@ __wt_lsm_free_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) } /* Lock the tree to clear out the old chunk information. */ - WT_ERR(__wt_lsm_tree_writelock(session, lsm_tree)); + __wt_lsm_tree_writelock(session, lsm_tree); /* * The chunk we are looking at should be the first one in the @@ -643,7 +647,7 @@ __wt_lsm_free_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) lsm_tree->old_chunks[lsm_tree->nold_chunks] = NULL; } - WT_ERR(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); /* * Clear the chunk in the cookie so we don't attempt to @@ -654,9 +658,9 @@ __wt_lsm_free_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) err: /* Flush the metadata unless the system is in panic */ if (flush_metadata && ret != WT_PANIC) { - WT_TRET(__wt_lsm_tree_writelock(session, lsm_tree)); + __wt_lsm_tree_writelock(session, lsm_tree); WT_TRET(__wt_lsm_meta_write(session, lsm_tree)); - WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree)); + __wt_lsm_tree_writeunlock(session, lsm_tree); } __lsm_unpin_chunks(session, &cookie); __wt_free(session, cookie.chunk_array); diff --git a/src/third_party/wiredtiger/src/lsm/lsm_worker.c b/src/third_party/wiredtiger/src/lsm/lsm_worker.c index 0874da8db13..b0d0758775d 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_worker.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_worker.c @@ -19,8 +19,8 @@ static WT_THREAD_RET __lsm_worker(void *); int __wt_lsm_worker_start(WT_SESSION_IMPL *session, WT_LSM_WORKER_ARGS *args) { - WT_RET(__wt_verbose(session, WT_VERB_LSM_MANAGER, - "Start LSM worker %u type %#" PRIx32, args->id, args->type)); + __wt_verbose(session, WT_VERB_LSM_MANAGER, + "Start LSM worker %u type %#" PRIx32, args->id, args->type); return (__wt_thread_create(session, &args->tid, __lsm_worker, args)); } @@ -58,9 +58,9 @@ __lsm_worker_general_op( * If we got a chunk to flush, checkpoint it. */ if (chunk != NULL) { - WT_ERR(__wt_verbose(session, WT_VERB_LSM, + __wt_verbose(session, WT_VERB_LSM, "Flush%s chunk %" PRIu32 " %s", - force ? " w/ force" : "", chunk->id, chunk->uri)); + force ? " w/ force" : "", chunk->id, chunk->uri); ret = __wt_lsm_checkpoint_chunk( session, entry->lsm_tree, chunk); WT_ASSERT(session, chunk->refcnt > 0); @@ -154,8 +154,7 @@ __lsm_worker(void *arg) /* Don't busy wait if there was any work to do. */ if (!progress) { - WT_ERR( - __wt_cond_wait(session, cookie->work_cond, 10000)); + __wt_cond_wait(session, cookie->work_cond, 10000); continue; } } diff --git a/src/third_party/wiredtiger/src/meta/meta_table.c b/src/third_party/wiredtiger/src/meta/meta_table.c index d39df163daf..58842c756d1 100644 --- a/src/third_party/wiredtiger/src/meta/meta_table.c +++ b/src/third_party/wiredtiger/src/meta/meta_table.c @@ -159,10 +159,10 @@ __wt_metadata_insert( WT_CURSOR *cursor; WT_DECL_RET; - WT_RET(__wt_verbose(session, WT_VERB_METADATA, + __wt_verbose(session, WT_VERB_METADATA, "Insert: key: %s, value: %s, tracking: %s, %s" "turtle", key, value, WT_META_TRACKING(session) ? "true" : "false", - __metadata_turtle(key) ? "" : "not ")); + __metadata_turtle(key) ? "" : "not "); if (__metadata_turtle(key)) WT_RET_MSG(session, EINVAL, @@ -189,10 +189,10 @@ __wt_metadata_update( WT_CURSOR *cursor; WT_DECL_RET; - WT_RET(__wt_verbose(session, WT_VERB_METADATA, + __wt_verbose(session, WT_VERB_METADATA, "Update: key: %s, value: %s, tracking: %s, %s" "turtle", key, value, WT_META_TRACKING(session) ? "true" : "false", - __metadata_turtle(key) ? "" : "not ")); + __metadata_turtle(key) ? "" : "not "); if (__metadata_turtle(key)) { WT_WITH_TURTLE_LOCK(session, ret, @@ -224,10 +224,10 @@ __wt_metadata_remove(WT_SESSION_IMPL *session, const char *key) WT_CURSOR *cursor; WT_DECL_RET; - WT_RET(__wt_verbose(session, WT_VERB_METADATA, + __wt_verbose(session, WT_VERB_METADATA, "Remove: key: %s, tracking: %s, %s" "turtle", key, WT_META_TRACKING(session) ? "true" : "false", - __metadata_turtle(key) ? "" : "not ")); + __metadata_turtle(key) ? "" : "not "); if (__metadata_turtle(key)) WT_RET_MSG(session, EINVAL, @@ -257,10 +257,10 @@ __wt_metadata_search(WT_SESSION_IMPL *session, const char *key, char **valuep) *valuep = NULL; - WT_RET(__wt_verbose(session, WT_VERB_METADATA, + __wt_verbose(session, WT_VERB_METADATA, "Search: key: %s, tracking: %s, %s" "turtle", key, WT_META_TRACKING(session) ? "true" : "false", - __metadata_turtle(key) ? "" : "not ")); + __metadata_turtle(key) ? "" : "not "); if (__metadata_turtle(key)) return (__wt_turtle_read(session, key, valuep)); diff --git a/src/third_party/wiredtiger/src/os_common/os_fhandle.c b/src/third_party/wiredtiger/src/os_common/os_fhandle.c index 184a9df0e72..3fd5b5db773 100644 --- a/src/third_party/wiredtiger/src/os_common/os_fhandle.c +++ b/src/third_party/wiredtiger/src/os_common/os_fhandle.c @@ -24,23 +24,22 @@ __fhandle_method_finalize( "a WT_FILE_HANDLE.%s method must be configured", #name) WT_HANDLE_METHOD_REQ(close); - /* not required: fadvise */ - /* not required: fallocate */ - /* not required: fallocate_nolock */ + /* not required: fh_advise */ + /* not required: fh_extend */ + /* not required: fh_extend_nolock */ WT_HANDLE_METHOD_REQ(fh_lock); - /* not required: map */ - /* not required: map_discard */ - /* not required: map_preload */ - /* not required: map_unmap */ + /* not required: fh_map */ + /* not required: fh_map_discard */ + /* not required: fh_map_preload */ + /* not required: fh_unmap */ WT_HANDLE_METHOD_REQ(fh_read); WT_HANDLE_METHOD_REQ(fh_size); if (!readonly) WT_HANDLE_METHOD_REQ(fh_sync); - /* not required: sync_nowait */ - if (!readonly) { - WT_HANDLE_METHOD_REQ(fh_truncate); + /* not required: fh_sync_nowait */ + /* not required: fh_truncate */ + if (!readonly) WT_HANDLE_METHOD_REQ(fh_write); - } return (0); } @@ -188,7 +187,7 @@ __open_verbose( if (tmp->size != 0) WT_ERR(__wt_buf_catfmt(session, tmp, ")")); - ret = __wt_verbose(session, WT_VERB_FILEOPS, + __wt_verbose(session, WT_VERB_FILEOPS, "%s: file-open: type %s%s", name, file_type_tag, tmp->size == 0 ? "" : (char *)tmp->data); @@ -301,8 +300,7 @@ __wt_close(WT_SESSION_IMPL *session, WT_FH **fhp) *fhp = NULL; /* Track handle-close as a file operation, so open and close match. */ - WT_RET(__wt_verbose( - session, WT_VERB_FILEOPS, "%s: file-close", fh->name)); + __wt_verbose(session, WT_VERB_FILEOPS, "%s: file-close", fh->name); /* * If the reference count hasn't gone to 0, or if it's an in-memory diff --git a/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c b/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c index 178adc1dac8..70a82007300 100644 --- a/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c +++ b/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c @@ -391,41 +391,6 @@ __im_file_sync(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session) } /* - * __im_file_truncate -- - * POSIX ftruncate. - */ -static int -__im_file_truncate( - WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t offset) -{ - WT_DECL_RET; - WT_FILE_HANDLE_INMEM *im_fh; - WT_FILE_SYSTEM_INMEM *im_fs; - WT_SESSION_IMPL *session; - size_t off; - - im_fh = (WT_FILE_HANDLE_INMEM *)file_handle; - im_fs = (WT_FILE_SYSTEM_INMEM *)file_handle->file_system; - session = (WT_SESSION_IMPL *)wt_session; - - __wt_spin_lock(session, &im_fs->lock); - - /* - * Grow the buffer as necessary, clear any new space in the file, and - * reset the file's data length. - */ - off = (size_t)offset; - WT_ERR(__wt_buf_grow(session, &im_fh->buf, off)); - if (im_fh->buf.size < off) - memset((uint8_t *)im_fh->buf.data + im_fh->buf.size, - 0, off - im_fh->buf.size); - im_fh->buf.size = off; - -err: __wt_spin_unlock(session, &im_fs->lock); - return (ret); -} - -/* * __im_file_write -- * POSIX pwrite. */ @@ -526,7 +491,6 @@ __im_file_open(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, file_handle->fh_read = __im_file_read; file_handle->fh_size = __im_file_size; file_handle->fh_sync = __im_file_sync; - file_handle->fh_truncate = __im_file_truncate; file_handle->fh_write = __im_file_write; *file_handlep = file_handle; diff --git a/src/third_party/wiredtiger/src/os_posix/os_fallocate.c b/src/third_party/wiredtiger/src/os_posix/os_fallocate.c index 9e5d9519900..111f6558816 100644 --- a/src/third_party/wiredtiger/src/os_posix/os_fallocate.c +++ b/src/third_party/wiredtiger/src/os_posix/os_fallocate.c @@ -18,8 +18,8 @@ * Linux fallocate call. */ static int -__posix_std_fallocate(WT_FILE_HANDLE *file_handle, - WT_SESSION *wt_session, wt_off_t offset, wt_off_t len) +__posix_std_fallocate( + WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t offset) { #if defined(HAVE_FALLOCATE) WT_DECL_RET; @@ -29,13 +29,12 @@ __posix_std_fallocate(WT_FILE_HANDLE *file_handle, pfh = (WT_FILE_HANDLE_POSIX *)file_handle; - WT_SYSCALL_RETRY(fallocate(pfh->fd, 0, offset, len), ret); + WT_SYSCALL_RETRY(fallocate(pfh->fd, 0, (wt_off_t)0, offset), ret); return (ret); #else WT_UNUSED(file_handle); WT_UNUSED(wt_session); WT_UNUSED(offset); - WT_UNUSED(len); return (ENOTSUP); #endif } @@ -45,8 +44,8 @@ __posix_std_fallocate(WT_FILE_HANDLE *file_handle, * Linux fallocate call (system call version). */ static int -__posix_sys_fallocate(WT_FILE_HANDLE *file_handle, - WT_SESSION *wt_session, wt_off_t offset, wt_off_t len) +__posix_sys_fallocate( + WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t offset) { #if defined(__linux__) && defined(SYS_fallocate) WT_DECL_RET; @@ -62,13 +61,13 @@ __posix_sys_fallocate(WT_FILE_HANDLE *file_handle, * Linux versions (RHEL 5.5), but not in the version of the C library. * This allows it to work everywhere the kernel supports it. */ - WT_SYSCALL_RETRY(syscall(SYS_fallocate, pfh->fd, 0, offset, len), ret); + WT_SYSCALL_RETRY( + syscall(SYS_fallocate, pfh->fd, 0, (wt_off_t)0, offset), ret); return (ret); #else WT_UNUSED(file_handle); WT_UNUSED(wt_session); WT_UNUSED(offset); - WT_UNUSED(len); return (ENOTSUP); #endif } @@ -78,8 +77,8 @@ __posix_sys_fallocate(WT_FILE_HANDLE *file_handle, * POSIX fallocate call. */ static int -__posix_posix_fallocate(WT_FILE_HANDLE *file_handle, - WT_SESSION *wt_session, wt_off_t offset, wt_off_t len) +__posix_posix_fallocate( + WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t offset) { #if defined(HAVE_POSIX_FALLOCATE) WT_DECL_RET; @@ -89,64 +88,72 @@ __posix_posix_fallocate(WT_FILE_HANDLE *file_handle, pfh = (WT_FILE_HANDLE_POSIX *)file_handle; - WT_SYSCALL_RETRY(posix_fallocate(pfh->fd, offset, len), ret); + WT_SYSCALL_RETRY(posix_fallocate(pfh->fd, (wt_off_t)0, offset), ret); return (ret); #else WT_UNUSED(file_handle); WT_UNUSED(wt_session); WT_UNUSED(offset); - WT_UNUSED(len); return (ENOTSUP); #endif } /* - * __wt_posix_file_fallocate -- - * POSIX fallocate. + * __wt_posix_file_extend -- + * Extend the file. */ int -__wt_posix_file_fallocate(WT_FILE_HANDLE *file_handle, - WT_SESSION *wt_session, wt_off_t offset, wt_off_t len) +__wt_posix_file_extend( + WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t offset) { /* - * The first fallocate call: figure out what fallocate call this system - * supports, if any. + * The first file extension call: figure out what this system has. * - * The function is configured as a locking fallocate call, so we know - * we're single-threaded through here. Set the nolock function first, - * then publish the NULL replacement to ensure the handle functions are + * This function is configured as a locking call, so we know we're + * single-threaded through here. Set the nolock function first, then + * publish the NULL replacement to ensure the handle functions are * always correct. * - * We've seen Linux systems where posix_fallocate has corrupted - * existing file data (even though that is explicitly disallowed - * by POSIX). FreeBSD and Solaris support posix_fallocate, and - * so far we've seen no problems leaving it unlocked. Check for - * fallocate (and the system call version of fallocate) first to - * avoid locking on Linux if at all possible. + * We've seen Linux systems where posix_fallocate has corrupted existing + * file data (even though that is explicitly disallowed by POSIX). + * FreeBSD and Solaris support posix_fallocate, and so far we've seen + * no problems leaving it unlocked. Check for fallocate (and the system + * call version of fallocate) first to avoid locking on Linux if at all + * possible. */ - if (__posix_std_fallocate(file_handle, wt_session, offset, len) == 0) { - file_handle->fh_allocate_nolock = __posix_std_fallocate; - WT_PUBLISH(file_handle->fh_allocate, NULL); + if (__posix_std_fallocate(file_handle, wt_session, offset) == 0) { + file_handle->fh_extend_nolock = __posix_std_fallocate; + WT_PUBLISH(file_handle->fh_extend, NULL); return (0); } - if (__posix_sys_fallocate(file_handle, wt_session, offset, len) == 0) { - file_handle->fh_allocate_nolock = __posix_sys_fallocate; - WT_PUBLISH(file_handle->fh_allocate, NULL); + if (__posix_sys_fallocate(file_handle, wt_session, offset) == 0) { + file_handle->fh_extend_nolock = __posix_sys_fallocate; + WT_PUBLISH(file_handle->fh_extend, NULL); return (0); } - if (__posix_posix_fallocate( - file_handle, wt_session, offset, len) == 0) { + if (__posix_posix_fallocate(file_handle, wt_session, offset) == 0) { #if defined(__linux__) - file_handle->fh_allocate = __posix_posix_fallocate; + file_handle->fh_extend = __posix_posix_fallocate; WT_WRITE_BARRIER(); #else - file_handle->fh_allocate_nolock = __posix_posix_fallocate; - WT_PUBLISH(file_handle->fh_allocate, NULL); + file_handle->fh_extend_nolock = __posix_posix_fallocate; + WT_PUBLISH(file_handle->fh_extend, NULL); #endif return (0); } - file_handle->fh_allocate = NULL; + /* + * Use the POSIX ftruncate call if there's nothing else, it can extend + * files. Note ftruncate requires locking. + */ + if (file_handle->fh_truncate != NULL && + file_handle->fh_truncate(file_handle, wt_session, offset) == 0) { + file_handle->fh_extend = file_handle->fh_truncate; + WT_WRITE_BARRIER(); + return (0); + } + + file_handle->fh_extend = NULL; WT_WRITE_BARRIER(); return (ENOTSUP); } diff --git a/src/third_party/wiredtiger/src/os_posix/os_fs.c b/src/third_party/wiredtiger/src/os_posix/os_fs.c index 11f38ec063b..c6272b5da52 100644 --- a/src/third_party/wiredtiger/src/os_posix/os_fs.c +++ b/src/third_party/wiredtiger/src/os_posix/os_fs.c @@ -469,6 +469,7 @@ __posix_file_sync_nowait(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session) } #endif +#ifdef HAVE_FTRUNCATE /* * __posix_file_truncate -- * POSIX ftruncate. @@ -490,6 +491,7 @@ __posix_file_truncate( WT_RET_MSG(session, ret, "%s: handle-truncate: ftruncate", file_handle->name); } +#endif /* * __posix_file_write -- @@ -536,7 +538,7 @@ __posix_file_write(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, static inline int __posix_open_file_cloexec(WT_SESSION_IMPL *session, int fd, const char *name) { -#if defined(HAVE_FCNTL) && defined(FD_CLOEXEC) && !defined(O_CLOEXEC) +#if defined(FD_CLOEXEC) && !defined(O_CLOEXEC) int f; /* @@ -701,7 +703,7 @@ directory_open: if (!pfh->direct_io) file_handle->fh_advise = __posix_file_advise; #endif - file_handle->fh_allocate = __wt_posix_file_fallocate; + file_handle->fh_extend = __wt_posix_file_extend; file_handle->fh_lock = __posix_file_lock; #ifdef WORDS_BIGENDIAN /* @@ -722,7 +724,9 @@ directory_open: #ifdef HAVE_SYNC_FILE_RANGE file_handle->fh_sync_nowait = __posix_file_sync_nowait; #endif +#ifdef HAVE_FTRUNCATE file_handle->fh_truncate = __posix_file_truncate; +#endif file_handle->fh_write = __posix_file_write; *file_handlep = file_handle; diff --git a/src/third_party/wiredtiger/src/os_posix/os_map.c b/src/third_party/wiredtiger/src/os_posix/os_map.c index b33f6d82e34..91ccc04ff7e 100644 --- a/src/third_party/wiredtiger/src/os_posix/os_map.c +++ b/src/third_party/wiredtiger/src/os_posix/os_map.c @@ -43,7 +43,7 @@ __wt_posix_map(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, WT_RET(fh->fh_size(fh, wt_session, &file_size)); len = (size_t)file_size; - (void)__wt_verbose(session, WT_VERB_HANDLEOPS, + __wt_verbose(session, WT_VERB_HANDLEOPS, "%s: memory-map: %" WT_SIZET_FMT " bytes", fh->name, len); if ((map = mmap(NULL, len, @@ -162,7 +162,7 @@ __wt_posix_unmap(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, session = (WT_SESSION_IMPL *)wt_session; - (void)__wt_verbose(session, WT_VERB_HANDLEOPS, + __wt_verbose(session, WT_VERB_HANDLEOPS, "%s: memory-unmap: %" WT_SIZET_FMT " bytes", fh->name, len); if (munmap(mapped_region, len) == 0) diff --git a/src/third_party/wiredtiger/src/os_posix/os_mtx_cond.c b/src/third_party/wiredtiger/src/os_posix/os_mtx_cond.c index 5f4e9a7cf2b..fb5a0f018cf 100644 --- a/src/third_party/wiredtiger/src/os_posix/os_mtx_cond.c +++ b/src/third_party/wiredtiger/src/os_posix/os_mtx_cond.c @@ -42,10 +42,10 @@ err: __wt_free(session, cond); /* * __wt_cond_wait_signal -- - * Wait on a mutex, optionally timing out. If we get it - * before the time out period expires, let the caller know. + * Wait on a mutex, optionally timing out. If we get it before the time + * out period expires, let the caller know. */ -int +void __wt_cond_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs, bool *signalled) { @@ -58,15 +58,15 @@ __wt_cond_wait_signal( /* Fast path if already signalled. */ *signalled = true; if (__wt_atomic_addi32(&cond->waiters, 1) == 0) - return (0); + return; /* * !!! * This function MUST handle a NULL session handle. */ if (session != NULL) { - WT_RET(__wt_verbose(session, WT_VERB_MUTEX, - "wait %s cond (%p)", cond->name, cond)); + __wt_verbose( + session, WT_VERB_MUTEX, "wait %s", cond->name, cond); WT_STAT_FAST_CONN_INCR(session, cond_wait); } @@ -96,20 +96,21 @@ __wt_cond_wait_signal( ret = 0; } - (void)__wt_atomic_subi32(&cond->waiters, 1); +err: (void)__wt_atomic_subi32(&cond->waiters, 1); -err: if (locked) + if (locked) WT_TRET(pthread_mutex_unlock(&cond->mtx)); if (ret == 0) - return (0); - WT_RET_MSG(session, ret, "pthread_cond_wait"); + return; + + WT_PANIC_MSG(session, ret, "pthread_cond_wait: %s", cond->name); } /* * __wt_cond_signal -- * Signal a waiting thread. */ -int +void __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) { WT_DECL_RET; @@ -122,12 +123,11 @@ __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) * This function MUST handle a NULL session handle. */ if (session != NULL) - WT_RET(__wt_verbose(session, WT_VERB_MUTEX, - "signal %s cond (%p)", cond->name, cond)); + __wt_verbose(session, WT_VERB_MUTEX, "signal %s", cond->name); /* Fast path if already signalled. */ if (cond->waiters == -1) - return (0); + return; if (cond->waiters > 0 || !__wt_atomic_casi32(&cond->waiters, 0, -1)) { WT_ERR(pthread_mutex_lock(&cond->mtx)); @@ -138,8 +138,9 @@ __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) err: if (locked) WT_TRET(pthread_mutex_unlock(&cond->mtx)); if (ret == 0) - return (0); - WT_RET_MSG(session, ret, "pthread_cond_broadcast"); + return; + + WT_PANIC_MSG(session, ret, "pthread_cond_broadcast: %s", cond->name); } /* diff --git a/src/third_party/wiredtiger/src/os_win/os_dir.c b/src/third_party/wiredtiger/src/os_win/os_dir.c index dccacc1e446..f024d131387 100644 --- a/src/third_party/wiredtiger/src/os_win/os_dir.c +++ b/src/third_party/wiredtiger/src/os_win/os_dir.c @@ -19,11 +19,14 @@ __wt_win_directory_list(WT_FILE_SYSTEM *file_system, { DWORD windows_error; HANDLE findhandle; - WIN32_FIND_DATA finddata; + WIN32_FIND_DATAW finddata; WT_DECL_ITEM(pathbuf); + WT_DECL_ITEM(file_utf8); + WT_DECL_ITEM(pathbuf_wide); + WT_DECL_ITEM(prefix_wide); WT_DECL_RET; WT_SESSION_IMPL *session; - size_t dirallocsz, pathlen; + size_t dirallocsz, pathlen, prefix_widelen; uint32_t count; char *dir_copy, **entries; @@ -45,7 +48,11 @@ __wt_win_directory_list(WT_FILE_SYSTEM *file_system, WT_ERR(__wt_scr_alloc(session, pathlen + 3, &pathbuf)); WT_ERR(__wt_buf_fmt(session, pathbuf, "%s\\*", dir_copy)); - findhandle = FindFirstFileA(pathbuf->data, &finddata); + WT_ERR(__wt_to_utf16_string(session, pathbuf->data, &pathbuf_wide)); + WT_ERR(__wt_to_utf16_string(session, prefix, &prefix_wide)); + prefix_widelen = wcslen(prefix_wide->data); + + findhandle = FindFirstFileW(pathbuf_wide->data, &finddata); if (findhandle == INVALID_HANDLE_VALUE) { windows_error = __wt_getlasterror(); __wt_errx(session, @@ -59,21 +66,25 @@ __wt_win_directory_list(WT_FILE_SYSTEM *file_system, /* * Skip . and .. */ - if (strcmp(finddata.cFileName, ".") == 0 || - strcmp(finddata.cFileName, "..") == 0) + if (wcscmp(finddata.cFileName, L".") == 0 || + wcscmp(finddata.cFileName, L"..") == 0) continue; /* The list of files is optionally filtered by a prefix. */ if (prefix != NULL && - !WT_PREFIX_MATCH(finddata.cFileName, prefix)) + wcsncmp(finddata.cFileName, prefix_wide->data, + prefix_widelen) != 0) continue; WT_ERR(__wt_realloc_def( session, &dirallocsz, count + 1, &entries)); - WT_ERR(__wt_strdup( - session, finddata.cFileName, &entries[count])); + + WT_ERR(__wt_to_utf8_string( + session, finddata.cFileName, &file_utf8)); + WT_ERR(__wt_strdup(session, file_utf8->data, &entries[count])); ++count; - } while (FindNextFileA(findhandle, &finddata) != 0); + __wt_scr_free(session, &file_utf8); + } while (FindNextFileW(findhandle, &finddata) != 0); *dirlistp = entries; *countp = count; @@ -91,6 +102,9 @@ err: if (findhandle != INVALID_HANDLE_VALUE) __wt_free(session, dir_copy); __wt_scr_free(session, &pathbuf); + __wt_scr_free(session, &file_utf8); + __wt_scr_free(session, &pathbuf_wide); + __wt_scr_free(session, &prefix_wide); if (ret == 0) return (0); diff --git a/src/third_party/wiredtiger/src/os_win/os_dlopen.c b/src/third_party/wiredtiger/src/os_win/os_dlopen.c index 3da47bf23a3..6857be2a05e 100644 --- a/src/third_party/wiredtiger/src/os_win/os_dlopen.c +++ b/src/third_party/wiredtiger/src/os_win/os_dlopen.c @@ -25,11 +25,11 @@ __wt_dlopen(WT_SESSION_IMPL *session, const char *path, WT_DLH **dlhp) /* NULL means load from the current binary */ if (path == NULL) { - if (GetModuleHandleExA( + if (GetModuleHandleExW( 0, NULL, (HMODULE *)&dlh->handle) == FALSE) { windows_error = __wt_getlasterror(); __wt_errx(session, - "GetModuleHandleEx: %s: %s", + "GetModuleHandleExW: %s: %s", path, __wt_formatmessage(session, windows_error)); WT_ERR(__wt_map_windows_error(windows_error)); } diff --git a/src/third_party/wiredtiger/src/os_win/os_fs.c b/src/third_party/wiredtiger/src/os_win/os_fs.c index fc03e0a2595..7ab7178114b 100644 --- a/src/third_party/wiredtiger/src/os_win/os_fs.c +++ b/src/third_party/wiredtiger/src/os_win/os_fs.c @@ -17,17 +17,20 @@ __win_fs_exist(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *name, bool *existp) { WT_DECL_RET; + WT_DECL_ITEM(name_wide); WT_SESSION_IMPL *session; WT_UNUSED(file_system); session = (WT_SESSION_IMPL *)wt_session; + *existp = false; - if (GetFileAttributesA(name) != INVALID_FILE_ATTRIBUTES) + WT_RET(__wt_to_utf16_string(session, name, &name_wide)); + + if (GetFileAttributesW(name_wide->data) != INVALID_FILE_ATTRIBUTES) *existp = true; - else - *existp = false; + __wt_scr_free(session, &name_wide); return (0); } @@ -40,6 +43,8 @@ __win_fs_remove(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *name, uint32_t flags) { DWORD windows_error; + WT_DECL_RET; + WT_DECL_ITEM(name_wide); WT_SESSION_IMPL *session; WT_UNUSED(file_system); @@ -47,14 +52,18 @@ __win_fs_remove(WT_FILE_SYSTEM *file_system, session = (WT_SESSION_IMPL *)wt_session; - if (DeleteFileA(name) == FALSE) { + WT_RET(__wt_to_utf16_string(session, name, &name_wide)); + + if (DeleteFileW(name_wide->data) == FALSE) { windows_error = __wt_getlasterror(); __wt_errx(session, - "%s: file-remove: DeleteFileA: %s", + "%s: file-remove: DeleteFileW: %s", name, __wt_formatmessage(session, windows_error)); - return (__wt_map_windows_error(windows_error)); + WT_ERR(__wt_map_windows_error(windows_error)); } - return (0); + +err: __wt_scr_free(session, &name_wide); + return (ret); } /* @@ -66,35 +75,42 @@ __win_fs_rename(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *from, const char *to, uint32_t flags) { DWORD windows_error; + WT_DECL_RET; + WT_DECL_ITEM(from_wide); + WT_DECL_ITEM(to_wide); WT_SESSION_IMPL *session; WT_UNUSED(file_system); WT_UNUSED(flags); - session = (WT_SESSION_IMPL *)wt_session; + WT_ERR(__wt_to_utf16_string(session, from, &from_wide)); + WT_ERR(__wt_to_utf16_string(session, to, &to_wide)); + /* * Check if file exists since Windows does not override the file if * it exists. */ - if (GetFileAttributesA(to) != INVALID_FILE_ATTRIBUTES) - if (DeleteFileA(to) == FALSE) { + if (GetFileAttributesW(to_wide->data) != INVALID_FILE_ATTRIBUTES) + if (DeleteFileW(to_wide->data) == FALSE) { windows_error = __wt_getlasterror(); __wt_errx(session, - "%s: file-rename: DeleteFileA: %s", + "%s: file-rename: DeleteFileW: %s", to, __wt_formatmessage(session, windows_error)); - return (__wt_map_windows_error(windows_error)); + WT_ERR(__wt_map_windows_error(windows_error)); } - if (MoveFileA(from, to) == FALSE) { + if (MoveFileW(from_wide->data, to_wide->data) == FALSE) { windows_error = __wt_getlasterror(); __wt_errx(session, - "%s to %s: file-rename: MoveFileA: %s", + "%s to %s: file-rename: MoveFileW: %s", from, to, __wt_formatmessage(session, windows_error)); - return (__wt_map_windows_error(windows_error)); + WT_ERR(__wt_map_windows_error(windows_error)); } - return (0); +err: __wt_scr_free(session, &from_wide); + __wt_scr_free(session, &to_wide); + return (ret); } /* @@ -106,24 +122,29 @@ __wt_win_fs_size(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *name, wt_off_t *sizep) { DWORD windows_error; + WT_DECL_RET; WIN32_FILE_ATTRIBUTE_DATA data; + WT_DECL_ITEM(name_wide); WT_SESSION_IMPL *session; WT_UNUSED(file_system); - session = (WT_SESSION_IMPL *)wt_session; - if (GetFileAttributesExA(name, GetFileExInfoStandard, &data) != 0) { - *sizep = - ((int64_t)data.nFileSizeHigh << 32) | data.nFileSizeLow; - return (0); + WT_RET(__wt_to_utf16_string(session, name, &name_wide)); + + if (GetFileAttributesExW( + name_wide->data, GetFileExInfoStandard, &data) == 0) { + windows_error = __wt_getlasterror(); + __wt_errx(session, + "%s: file-size: GetFileAttributesEx: %s", + name, __wt_formatmessage(session, windows_error)); + WT_ERR(__wt_map_windows_error(windows_error)); } - windows_error = __wt_getlasterror(); - __wt_errx(session, - "%s: file-size: GetFileAttributesEx: %s", - name, __wt_formatmessage(session, windows_error)); - return (__wt_map_windows_error(windows_error)); + *sizep = ((int64_t)data.nFileSizeHigh << 32) | data.nFileSizeLow; + +err: __wt_scr_free(session, &name_wide); + return (ret); } /* @@ -330,11 +351,11 @@ __win_file_sync(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session) } /* - * __win_file_truncate -- - * Truncate a file. + * __win_file_set_end -- + * Truncate or extend a file. */ static int -__win_file_truncate( +__win_file_set_end( WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t len) { DWORD windows_error; @@ -349,13 +370,14 @@ __win_file_truncate( if (win_fh->filehandle_secondary == INVALID_HANDLE_VALUE) WT_RET_MSG(session, EINVAL, - "%s: handle-truncate: read-only", file_handle->name); + "%s: handle-set-end: no secondary handle", + file_handle->name); if (SetFilePointerEx(win_fh->filehandle_secondary, largeint, NULL, FILE_BEGIN) == FALSE) { windows_error = __wt_getlasterror(); __wt_errx(session, - "%s: handle-truncate: SetFilePointerEx: %s", + "%s: handle-set-end: SetFilePointerEx: %s", file_handle->name, __wt_formatmessage(session, windows_error)); return (__wt_map_windows_error(windows_error)); @@ -366,7 +388,7 @@ __win_file_truncate( return (EBUSY); windows_error = __wt_getlasterror(); __wt_errx(session, - "%s: handle-truncate: SetEndOfFile: %s", + "%s: handle-set-end: SetEndOfFile: %s", file_handle->name, __wt_formatmessage(session, windows_error)); return (__wt_map_windows_error(windows_error)); @@ -434,26 +456,26 @@ __win_open_file(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, DWORD dwCreationDisposition, windows_error; WT_CONNECTION_IMPL *conn; WT_DECL_RET; + WT_DECL_ITEM(name_wide); WT_FILE_HANDLE *file_handle; WT_FILE_HANDLE_WIN *win_fh; WT_SESSION_IMPL *session; int desired_access, f; WT_UNUSED(file_system); - - *file_handlep = NULL; - session = (WT_SESSION_IMPL *)wt_session; conn = S2C(session); + *file_handlep = NULL; WT_RET(__wt_calloc_one(session, &win_fh)); - win_fh->direct_io = false; /* Set up error handling. */ win_fh->filehandle = win_fh->filehandle_secondary = INVALID_HANDLE_VALUE; + WT_ERR(__wt_to_utf16_string(session, name, &name_wide)); + /* * Opening a file handle on a directory is only to support filesystems * that require a directory sync for durability, and Windows doesn't @@ -503,41 +525,41 @@ __win_open_file(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, if (file_type == WT_FS_OPEN_FILE_TYPE_DATA) f |= FILE_FLAG_RANDOM_ACCESS; - win_fh->filehandle = CreateFileA(name, desired_access, + win_fh->filehandle = CreateFileW(name_wide->data, desired_access, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, dwCreationDisposition, f, NULL); if (win_fh->filehandle == INVALID_HANDLE_VALUE) { if (LF_ISSET(WT_FS_OPEN_CREATE) && GetLastError() == ERROR_FILE_EXISTS) - win_fh->filehandle = CreateFileA(name, desired_access, - FILE_SHARE_READ | FILE_SHARE_WRITE, + win_fh->filehandle = CreateFileW(name_wide->data, + desired_access, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, f, NULL); if (win_fh->filehandle == INVALID_HANDLE_VALUE) { windows_error = __wt_getlasterror(); __wt_errx(session, win_fh->direct_io ? - "%s: handle-open: CreateFileA: failed with direct " + "%s: handle-open: CreateFileW: failed with direct " "I/O configured, some filesystem types do not " "support direct I/O: %s" : - "%s: handle-open: CreateFileA: %s", + "%s: handle-open: CreateFileW: %s", name, __wt_formatmessage(session, windows_error)); WT_ERR(__wt_map_windows_error(windows_error)); } } /* - * Open a second handle to file to support allocation/truncation - * concurrently with reads on the file. Writes would also move the file - * pointer. + * Open a second handle to file to support file extension/truncation + * concurrently with reads on the file. Writes would also move the + * file pointer. */ if (!LF_ISSET(WT_FS_OPEN_READONLY)) { - win_fh->filehandle_secondary = CreateFileA(name, desired_access, - FILE_SHARE_READ | FILE_SHARE_WRITE, + win_fh->filehandle_secondary = CreateFileW(name_wide->data, + desired_access, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, f, NULL); if (win_fh->filehandle_secondary == INVALID_HANDLE_VALUE) { windows_error = __wt_getlasterror(); __wt_errx(session, - "%s: handle-open: CreateFileA: secondary: %s", + "%s: handle-open: Creatively: secondary: %s", name, __wt_formatmessage(session, windows_error)); WT_ERR(__wt_map_windows_error(windows_error)); } @@ -562,14 +584,20 @@ directory_open: file_handle->fh_read = __win_file_read; file_handle->fh_size = __win_file_size; file_handle->fh_sync = __win_file_sync; - file_handle->fh_truncate = __win_file_truncate; + + /* Extend and truncate share the same implementation. */ + file_handle->fh_extend = __win_file_set_end; + file_handle->fh_truncate = __win_file_set_end; + file_handle->fh_write = __win_file_write; *file_handlep = file_handle; + __wt_scr_free(session, &name_wide); return (0); -err: WT_TRET(__win_file_close((WT_FILE_HANDLE *)win_fh, wt_session)); +err: __wt_scr_free(session, &name_wide); + WT_TRET(__win_file_close((WT_FILE_HANDLE *)win_fh, wt_session)); return (ret); } diff --git a/src/third_party/wiredtiger/src/os_win/os_map.c b/src/third_party/wiredtiger/src/os_win/os_map.c index 8f5b289062d..a03e6cc3e52 100644 --- a/src/third_party/wiredtiger/src/os_win/os_map.c +++ b/src/third_party/wiredtiger/src/os_win/os_map.c @@ -35,15 +35,15 @@ __wt_win_map(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_session, file_handle->name, &file_size)); len = (size_t)file_size; - (void)__wt_verbose(session, WT_VERB_HANDLEOPS, + __wt_verbose(session, WT_VERB_HANDLEOPS, "%s: memory-map: %" WT_SIZET_FMT " bytes", file_handle->name, len); - mapped_cookie = CreateFileMappingA( + mapped_cookie = CreateFileMappingW( win_fh->filehandle, NULL, PAGE_READONLY, 0, 0, NULL); if (mapped_cookie == NULL) { windows_error = __wt_getlasterror(); __wt_errx(session, - "%s: memory-map: CreateFileMappingA: %s", + "%s: memory-map: CreateFileMappingW: %s", file_handle->name, __wt_formatmessage(session, windows_error)); return (__wt_map_windows_error(windows_error)); @@ -85,7 +85,7 @@ __wt_win_unmap(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, win_fh = (WT_FILE_HANDLE_WIN *)file_handle; session = (WT_SESSION_IMPL *)wt_session; - (void)__wt_verbose(session, WT_VERB_HANDLEOPS, + __wt_verbose(session, WT_VERB_HANDLEOPS, "%s: memory-unmap: %" WT_SIZET_FMT " bytes", file_handle->name, length); diff --git a/src/third_party/wiredtiger/src/os_win/os_mtx_cond.c b/src/third_party/wiredtiger/src/os_win/os_mtx_cond.c index 8645fdaccb3..da61904443f 100644 --- a/src/third_party/wiredtiger/src/os_win/os_mtx_cond.c +++ b/src/third_party/wiredtiger/src/os_win/os_mtx_cond.c @@ -38,10 +38,10 @@ __wt_cond_alloc(WT_SESSION_IMPL *session, /* * __wt_cond_wait_signal -- - * Wait on a mutex, optionally timing out. If we get it - * before the time out period expires, let the caller know. + * Wait on a mutex, optionally timing out. If we get it before the time + * out period expires, let the caller know. */ -int +void __wt_cond_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs, bool *signalled) { @@ -55,15 +55,14 @@ __wt_cond_wait_signal( /* Fast path if already signalled. */ *signalled = true; if (__wt_atomic_addi32(&cond->waiters, 1) == 0) - return (0); + return; /* * !!! * This function MUST handle a NULL session handle. */ if (session != NULL) { - WT_RET(__wt_verbose(session, WT_VERB_MUTEX, - "wait %s cond (%p)", cond->name, cond)); + __wt_verbose(session, WT_VERB_MUTEX, "wait %s", cond->name); WT_STAT_FAST_CONN_INCR(session, cond_wait); } @@ -112,18 +111,19 @@ __wt_cond_wait_signal( LeaveCriticalSection(&cond->mtx); if (sleepret != 0) - return (0); + return; - __wt_errx(session, "SleepConditionVariableCS: %s", - __wt_formatmessage(session, windows_error)); - return (__wt_map_windows_error(windows_error)); + __wt_errx(session, "SleepConditionVariableCS: %s: %s", + cond->name, __wt_formatmessage(session, windows_error)); + WT_PANIC_MSG(session, __wt_map_windows_error(windows_error), + "SleepConditionVariableCS: %s", cond->name); } /* * __wt_cond_signal -- * Signal a waiting thread. */ -int +void __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) { WT_DECL_RET; @@ -136,12 +136,11 @@ __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) * This function MUST handle a NULL session handle. */ if (session != NULL) - WT_RET(__wt_verbose(session, WT_VERB_MUTEX, - "signal %s cond (%p)", cond->name, cond)); + __wt_verbose(session, WT_VERB_MUTEX, "signal %s", cond->name); /* Fast path if already signalled. */ if (cond->waiters == -1) - return (0); + return; if (cond->waiters > 0 || !__wt_atomic_casi32(&cond->waiters, 0, -1)) { EnterCriticalSection(&cond->mtx); @@ -152,8 +151,9 @@ __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) if (locked) LeaveCriticalSection(&cond->mtx); if (ret == 0) - return (0); - WT_RET_MSG(session, ret, "WakeAllConditionVariable"); + return; + + WT_PANIC_MSG(session, ret, "WakeAllConditionVariable: %s", cond->name); } /* diff --git a/src/third_party/wiredtiger/src/os_win/os_utf8.c b/src/third_party/wiredtiger/src/os_win/os_utf8.c new file mode 100644 index 00000000000..f7d11c24f03 --- /dev/null +++ b/src/third_party/wiredtiger/src/os_win/os_utf8.c @@ -0,0 +1,84 @@ +/*- + * Copyright (c) 2014-2016 MongoDB, Inc. + * Copyright (c) 2008-2014 WiredTiger, Inc. + * All rights reserved. + * + * See the file LICENSE for redistribution information. + */ + +#include "wt_internal.h" + +/* + * __wt_to_utf16_string -- + * Convert UTF-8 encoded string to UTF-16. + */ +int +__wt_to_utf16_string( + WT_SESSION_IMPL *session, const char* utf8, WT_ITEM **outbuf) +{ + DWORD windows_error; + int bufferSize; + WT_DECL_RET; + + bufferSize = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0); + windows_error = __wt_getlasterror(); + + if (bufferSize == 0 && windows_error != ERROR_INSUFFICIENT_BUFFER) { + __wt_errx(session, "MultiByteToWideChar: %s", + __wt_formatmessage(session, windows_error)); + return (__wt_map_windows_error(windows_error)); + } + + WT_RET(__wt_scr_alloc(session, bufferSize * sizeof(wchar_t), outbuf)); + bufferSize = MultiByteToWideChar( + CP_UTF8, 0, utf8, -1, (*outbuf)->mem, bufferSize); + + if (bufferSize == 0) { + windows_error = __wt_getlasterror(); + __wt_scr_free(session, outbuf); + __wt_errx(session, "MultiByteToWideChar: %s", + __wt_formatmessage(session, windows_error)); + return (__wt_map_windows_error(windows_error)); + } + + (*outbuf)->size = bufferSize; + return (0); +} + +/* + * __wt_to_utf8_string -- + * Convert UTF-16 encoded string to UTF-8. + */ +int +__wt_to_utf8_string( + WT_SESSION_IMPL *session, const wchar_t* wide, WT_ITEM **outbuf) +{ + DWORD windows_error; + int bufferSize; + WT_DECL_RET; + + bufferSize = WideCharToMultiByte( + CP_UTF8, 0, wide, -1, NULL, 0, NULL, NULL); + windows_error = __wt_getlasterror(); + + if (bufferSize == 0 && windows_error != ERROR_INSUFFICIENT_BUFFER) { + __wt_errx(session, "WideCharToMultiByte: %s", + __wt_formatmessage(session, windows_error)); + return (__wt_map_windows_error(windows_error)); + } + + WT_RET(__wt_scr_alloc(session, bufferSize, outbuf)); + + bufferSize = WideCharToMultiByte( + CP_UTF8, 0, wide, -1, (*outbuf)->mem, bufferSize, NULL, NULL); + if (bufferSize == 0) { + windows_error = __wt_getlasterror(); + __wt_scr_free(session, outbuf); + __wt_errx(session, "WideCharToMultiByte: %s", + __wt_formatmessage(session, windows_error)); + return (__wt_map_windows_error(windows_error)); + } + + (*outbuf)->size = bufferSize; + return (0); +} diff --git a/src/third_party/wiredtiger/src/reconcile/rec_track.c b/src/third_party/wiredtiger/src/reconcile/rec_track.c index 4a3a8a7e988..1515550deda 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_track.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_track.c @@ -42,14 +42,14 @@ __ovfl_discard_verbose( unpack = &_unpack; __wt_cell_unpack(cell, unpack); - WT_ERR(__wt_verbose(session, WT_VERB_OVERFLOW, + __wt_verbose(session, WT_VERB_OVERFLOW, "discard: %s%s%p %s", tag == NULL ? "" : tag, tag == NULL ? "" : ": ", page, - __wt_addr_string(session, unpack->data, unpack->size, tmp))); + __wt_addr_string(session, unpack->data, unpack->size, tmp)); -err: __wt_scr_free(session, &tmp); + __wt_scr_free(session, &tmp); return (ret); } @@ -176,7 +176,7 @@ __ovfl_reuse_verbose(WT_SESSION_IMPL *session, WT_RET(__wt_scr_alloc(session, 64, &tmp)); - WT_ERR(__wt_verbose(session, WT_VERB_OVERFLOW, + __wt_verbose(session, WT_VERB_OVERFLOW, "reuse: %s%s%p %s (%s%s%s) {%.*s}", tag == NULL ? "" : tag, tag == NULL ? "" : ": ", @@ -187,9 +187,9 @@ __ovfl_reuse_verbose(WT_SESSION_IMPL *session, F_ISSET(reuse, WT_OVFL_REUSE_INUSE) && F_ISSET(reuse, WT_OVFL_REUSE_JUST_ADDED) ? ", " : "", F_ISSET(reuse, WT_OVFL_REUSE_JUST_ADDED) ? "just-added" : "", - WT_MIN(reuse->value_size, 40), (char *)WT_OVFL_REUSE_VALUE(reuse))); + WT_MIN(reuse->value_size, 40), (char *)WT_OVFL_REUSE_VALUE(reuse)); -err: __wt_scr_free(session, &tmp); + __wt_scr_free(session, &tmp); return (ret); } @@ -574,7 +574,7 @@ __ovfl_txnc_verbose(WT_SESSION_IMPL *session, WT_RET(__wt_scr_alloc(session, 64, &tmp)); - WT_ERR(__wt_verbose(session, WT_VERB_OVERFLOW, + __wt_verbose(session, WT_VERB_OVERFLOW, "txn-cache: %s%s%p %s %" PRIu64 " {%.*s}", tag == NULL ? "" : tag, tag == NULL ? "" : ": ", @@ -582,9 +582,9 @@ __ovfl_txnc_verbose(WT_SESSION_IMPL *session, __wt_addr_string( session, WT_OVFL_TXNC_ADDR(txnc), txnc->addr_size, tmp), txnc->current, - WT_MIN(txnc->value_size, 40), (char *)WT_OVFL_TXNC_VALUE(txnc))); + WT_MIN(txnc->value_size, 40), (char *)WT_OVFL_TXNC_VALUE(txnc)); -err: __wt_scr_free(session, &tmp); + __wt_scr_free(session, &tmp); return (ret); } @@ -881,11 +881,11 @@ __wt_ovfl_track_wrapup(WT_SESSION_IMPL *session, WT_PAGE *page) WT_RET(__ovfl_reuse_wrapup(session, page)); if (track->ovfl_txnc[0] != NULL) { - WT_RET(__wt_writelock(session, S2BT(session)->ovfl_lock)); + __wt_writelock(session, S2BT(session)->ovfl_lock); ret = __ovfl_txnc_wrapup(session, page); - WT_TRET(__wt_writeunlock(session, S2BT(session)->ovfl_lock)); + __wt_writeunlock(session, S2BT(session)->ovfl_lock); } - return (0); + return (ret); } /* @@ -909,9 +909,9 @@ __wt_ovfl_track_wrapup_err(WT_SESSION_IMPL *session, WT_PAGE *page) WT_RET(__ovfl_reuse_wrapup_err(session, page)); if (track->ovfl_txnc[0] != NULL) { - WT_RET(__wt_writelock(session, S2BT(session)->ovfl_lock)); + __wt_writelock(session, S2BT(session)->ovfl_lock); ret = __ovfl_txnc_wrapup(session, page); - WT_TRET(__wt_writeunlock(session, S2BT(session)->ovfl_lock)); + __wt_writeunlock(session, S2BT(session)->ovfl_lock); } - return (0); + return (ret); } diff --git a/src/third_party/wiredtiger/src/reconcile/rec_write.c b/src/third_party/wiredtiger/src/reconcile/rec_write.c index b96b34594b0..9c742476910 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_write.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_write.c @@ -357,8 +357,8 @@ __wt_reconcile(WT_SESSION_IMPL *session, page = ref->page; mod = page->modify; - WT_RET(__wt_verbose(session, - WT_VERB_RECONCILE, "%s", __wt_page_type_string(page->type))); + __wt_verbose(session, + WT_VERB_RECONCILE, "%s", __wt_page_type_string(page->type)); /* We shouldn't get called with a clean page, that's an error. */ WT_ASSERT(session, __wt_page_is_modified(page)); @@ -372,7 +372,7 @@ __wt_reconcile(WT_SESSION_IMPL *session, * In-memory splits: reconciliation of an internal page cannot handle * a child page splitting during the reconciliation. */ - WT_RET(__wt_fair_lock(session, &page->page_lock)); + __wt_writelock(session, &page->page_lock); /* * Check that transaction time always moves forward for a given page. @@ -386,7 +386,7 @@ __wt_reconcile(WT_SESSION_IMPL *session, /* Initialize the reconciliation structure for each new run. */ if ((ret = __rec_write_init( session, ref, flags, salvage, &session->reconcile)) != 0) { - WT_TRET(__wt_fair_unlock(session, &page->page_lock)); + __wt_writeunlock(session, &page->page_lock); return (ret); } r = session->reconcile; @@ -427,7 +427,7 @@ __wt_reconcile(WT_SESSION_IMPL *session, WT_TRET(__rec_write_wrapup_err(session, r, page)); /* Release the reconciliation lock. */ - WT_TRET(__wt_fair_unlock(session, &page->page_lock)); + __wt_writeunlock(session, &page->page_lock); /* Update statistics. */ WT_STAT_FAST_CONN_INCR(session, rec_pages); @@ -640,8 +640,8 @@ __rec_root_write(WT_SESSION_IMPL *session, WT_PAGE *page, uint32_t flags) WT_ILLEGAL_VALUE(session); } - WT_RET(__wt_verbose(session, WT_VERB_SPLIT, - "root page split -> %" PRIu32 " pages", mod->mod_multi_entries)); + __wt_verbose(session, WT_VERB_SPLIT, + "root page split -> %" PRIu32 " pages", mod->mod_multi_entries); /* * Create a new root page, initialize the array of child references, @@ -3327,13 +3327,13 @@ supd_check_complete: #ifdef HAVE_VERBOSE /* Output a verbose message if we create a page without many entries */ if (WT_VERBOSE_ISSET(session, WT_VERB_SPLIT) && r->entries < 6) - WT_ERR(__wt_verbose(session, WT_VERB_SPLIT, + __wt_verbose(session, WT_VERB_SPLIT, "Reconciliation creating a page with %" PRIu32 " entries, memory footprint %" PRIu64 ", page count %" PRIu32 ", %s, split state: %d\n", r->entries, r->page->memory_footprint, r->bnd_next, F_ISSET(r, WT_EVICTING) ? "evict" : "checkpoint", - r->bnd_state)); + r->bnd_state); #endif WT_ERR(__wt_bt_write(session, buf, addr, &addr_size, @@ -5535,22 +5535,22 @@ __rec_split_dump_keys(WT_SESSION_IMPL *session, WT_PAGE *page, WT_RECONCILE *r) if (page->type == WT_PAGE_ROW_INT || page->type == WT_PAGE_ROW_LEAF) WT_RET(__wt_scr_alloc(session, 0, &tkey)); - WT_ERR(__wt_verbose( - session, WT_VERB_SPLIT, "split: %" PRIu32 " pages", r->bnd_next)); + __wt_verbose( + session, WT_VERB_SPLIT, "split: %" PRIu32 " pages", r->bnd_next); for (bnd = r->bnd, i = 0; i < r->bnd_next; ++bnd, ++i) switch (page->type) { case WT_PAGE_ROW_INT: case WT_PAGE_ROW_LEAF: - WT_ERR(__wt_verbose(session, WT_VERB_SPLIT, + __wt_verbose(session, WT_VERB_SPLIT, "starting key %s", __wt_buf_set_printable( - session, bnd->key.data, bnd->key.size, tkey))); + session, bnd->key.data, bnd->key.size, tkey)); break; case WT_PAGE_COL_FIX: case WT_PAGE_COL_INT: case WT_PAGE_COL_VAR: - WT_ERR(__wt_verbose(session, WT_VERB_SPLIT, - "starting recno %" PRIu64, bnd->recno)); + __wt_verbose(session, WT_VERB_SPLIT, + "starting recno %" PRIu64, bnd->recno); break; WT_ILLEGAL_VALUE_ERR(session); } @@ -5637,8 +5637,7 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) switch (r->bnd_next) { case 0: /* Page delete */ - WT_RET(__wt_verbose( - session, WT_VERB_RECONCILE, "page %p empty", page)); + __wt_verbose(session, WT_VERB_RECONCILE, "page %p empty", page); WT_STAT_FAST_CONN_INCR(session, rec_page_delete); WT_STAT_FAST_DATA_INCR(session, rec_page_delete); @@ -5698,9 +5697,9 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) mod->rec_result = WT_PM_REC_REPLACE; break; default: /* Page split */ - WT_RET(__wt_verbose(session, WT_VERB_RECONCILE, + __wt_verbose(session, WT_VERB_RECONCILE, "page %p reconciled into %" PRIu32 " pages", - page, r->bnd_next)); + page, r->bnd_next); switch (page->type) { case WT_PAGE_COL_INT: diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c index 0072d7e1445..82ce934c250 100644 --- a/src/third_party/wiredtiger/src/session/session_api.c +++ b/src/third_party/wiredtiger/src/session/session_api.c @@ -1500,7 +1500,7 @@ __session_transaction_sync(WT_SESSION *wt_session, const char *config) * our timeout. */ while (__wt_log_cmp(&session->bg_sync_lsn, &log->sync_lsn) > 0) { - WT_ERR(__wt_cond_signal(session, conn->log_file_cond)); + __wt_cond_signal(session, conn->log_file_cond); WT_ERR(__wt_epoch(session, &now)); waited_ms = WT_TIMEDIFF_MS(now, start); if (forever || waited_ms < timeout_ms) @@ -1511,8 +1511,7 @@ __session_transaction_sync(WT_SESSION *wt_session, const char *config) * computing the wait time in msecs and passing that * in, unchanged, as the usecs to wait). */ - WT_ERR(__wt_cond_wait( - session, log->log_sync_cond, waited_ms)); + __wt_cond_wait(session, log->log_sync_cond, waited_ms); else WT_ERR(ETIMEDOUT); } @@ -1627,7 +1626,7 @@ __session_snapshot(WT_SESSION *wt_session, const char *config) WT_ERR(__wt_txn_named_snapshot_config( session, cfg, &has_create, &has_drop)); - WT_ERR(__wt_writelock(session, txn_global->nsnap_rwlock)); + __wt_writelock(session, txn_global->nsnap_rwlock); /* Drop any snapshots to be removed first. */ if (has_drop) @@ -1637,7 +1636,7 @@ __session_snapshot(WT_SESSION *wt_session, const char *config) if (has_create) WT_ERR(__wt_txn_named_snapshot_begin(session, cfg)); -err: WT_TRET(__wt_writeunlock(session, txn_global->nsnap_rwlock)); +err: __wt_writeunlock(session, txn_global->nsnap_rwlock); API_END_RET_NOTFOUND_MAP(session, ret); } diff --git a/src/third_party/wiredtiger/src/session/session_dhandle.c b/src/third_party/wiredtiger/src/session/session_dhandle.c index ddf4d3dfa33..a899bad1b1f 100644 --- a/src/third_party/wiredtiger/src/session/session_dhandle.c +++ b/src/third_party/wiredtiger/src/session/session_dhandle.c @@ -183,17 +183,17 @@ __wt_session_lock_dhandle( */ if (F_ISSET(dhandle, WT_DHANDLE_OPEN) && (!want_exclusive || lock_busy)) { - WT_RET(__wt_readlock(session, dhandle->rwlock)); + __wt_readlock(session, dhandle->rwlock); if (F_ISSET(dhandle, WT_DHANDLE_DEAD)) { *is_deadp = 1; - return ( - __wt_readunlock(session, dhandle->rwlock)); + __wt_readunlock(session, dhandle->rwlock); + return (0); } is_open = F_ISSET(dhandle, WT_DHANDLE_OPEN); if (is_open && !want_exclusive) return (0); - WT_RET(__wt_readunlock(session, dhandle->rwlock)); + __wt_readunlock(session, dhandle->rwlock); } else is_open = false; @@ -206,8 +206,8 @@ __wt_session_lock_dhandle( if ((ret = __wt_try_writelock(session, dhandle->rwlock)) == 0) { if (F_ISSET(dhandle, WT_DHANDLE_DEAD)) { *is_deadp = 1; - return ( - __wt_writeunlock(session, dhandle->rwlock)); + __wt_writeunlock(session, dhandle->rwlock); + return (0); } /* @@ -217,8 +217,7 @@ __wt_session_lock_dhandle( if (F_ISSET(dhandle, WT_DHANDLE_OPEN) && !want_exclusive) { lock_busy = false; - WT_RET( - __wt_writeunlock(session, dhandle->rwlock)); + __wt_writeunlock(session, dhandle->rwlock); continue; } @@ -287,12 +286,11 @@ __wt_session_release_btree(WT_SESSION_IMPL *session) locked = false; } if (locked) { - if (write_locked) + if (write_locked) { F_CLR(dhandle, WT_DHANDLE_EXCLUSIVE); - - WT_TRET(write_locked ? - __wt_writeunlock(session, dhandle->rwlock): - __wt_readunlock(session, dhandle->rwlock)); + __wt_writeunlock(session, dhandle->rwlock); + } else + __wt_readunlock(session, dhandle->rwlock); } session->dhandle = NULL; @@ -514,7 +512,7 @@ __wt_session_get_btree(WT_SESSION_IMPL *session, dhandle->excl_session = NULL; dhandle->excl_ref = 0; F_CLR(dhandle, WT_DHANDLE_EXCLUSIVE); - WT_RET(__wt_writeunlock(session, dhandle->rwlock)); + __wt_writeunlock(session, dhandle->rwlock); WT_WITH_SCHEMA_LOCK(session, ret, WT_WITH_HANDLE_LIST_LOCK(session, @@ -536,7 +534,7 @@ __wt_session_get_btree(WT_SESSION_IMPL *session, dhandle->excl_session = NULL; dhandle->excl_ref = 0; F_CLR(dhandle, WT_DHANDLE_EXCLUSIVE); - WT_TRET(__wt_writeunlock(session, dhandle->rwlock)); + __wt_writeunlock(session, dhandle->rwlock); WT_RET(ret); } diff --git a/src/third_party/wiredtiger/src/support/cond_auto.c b/src/third_party/wiredtiger/src/support/cond_auto.c index ec95622f333..69114b066ae 100644 --- a/src/third_party/wiredtiger/src/support/cond_auto.c +++ b/src/third_party/wiredtiger/src/support/cond_auto.c @@ -58,12 +58,12 @@ __wt_cond_auto_alloc( * __wt_cond_auto_signal -- * Signal a condition variable. */ -int +void __wt_cond_auto_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) { WT_ASSERT(session, cond->min_wait != 0); - return (__wt_cond_signal(session, cond)); + __wt_cond_signal(session, cond); } /* @@ -73,7 +73,7 @@ __wt_cond_auto_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) * TODO: Can this version of the API be removed, now that we have the * auto adjusting condition variables? */ -int +void __wt_cond_auto_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, bool progress, bool *signalled) { @@ -94,15 +94,12 @@ __wt_cond_auto_wait_signal( cond->max_wait, cond->prev_wait + delta); } - WT_RET(__wt_cond_wait_signal( - session, cond, cond->prev_wait, signalled)); + __wt_cond_wait_signal(session, cond, cond->prev_wait, signalled); if (progress || *signalled) WT_STAT_FAST_CONN_INCR(session, cond_auto_wait_reset); if (*signalled) cond->prev_wait = cond->min_wait; - - return (0); } /* @@ -110,7 +107,7 @@ __wt_cond_auto_wait_signal( * Wait on a mutex, optionally timing out. If we get it before the time * out period expires, let the caller know. */ -int +void __wt_cond_auto_wait( WT_SESSION_IMPL *session, WT_CONDVAR *cond, bool progress) { @@ -120,9 +117,7 @@ __wt_cond_auto_wait( * Call the signal version so the wait period is reset if the * condition is woken explicitly. */ - WT_RET(__wt_cond_auto_wait_signal(session, cond, progress, &signalled)); - - return (0); + __wt_cond_auto_wait_signal(session, cond, progress, &signalled); } /* diff --git a/src/third_party/wiredtiger/src/support/err.c b/src/third_party/wiredtiger/src/support/err.c index 60fc53cecd0..0be428602bc 100644 --- a/src/third_party/wiredtiger/src/support/err.c +++ b/src/third_party/wiredtiger/src/support/err.c @@ -314,6 +314,7 @@ __wt_eventv(WT_SESSION_IMPL *session, bool msg_event, int error, */ void __wt_err(WT_SESSION_IMPL *session, int error, const char *fmt, ...) + WT_GCC_FUNC_ATTRIBUTE((cold)) WT_GCC_FUNC_ATTRIBUTE((format (printf, 3, 4))) { va_list ap; @@ -323,7 +324,7 @@ __wt_err(WT_SESSION_IMPL *session, int error, const char *fmt, ...) * an error value to return. */ va_start(ap, fmt); - (void)__wt_eventv(session, false, error, NULL, 0, fmt, ap); + WT_IGNORE_RET(__wt_eventv(session, false, error, NULL, 0, fmt, ap)); va_end(ap); } @@ -333,6 +334,7 @@ __wt_err(WT_SESSION_IMPL *session, int error, const char *fmt, ...) */ void __wt_errx(WT_SESSION_IMPL *session, const char *fmt, ...) + WT_GCC_FUNC_ATTRIBUTE((cold)) WT_GCC_FUNC_ATTRIBUTE((format (printf, 2, 3))) { va_list ap; @@ -342,7 +344,7 @@ __wt_errx(WT_SESSION_IMPL *session, const char *fmt, ...) * an error value to return. */ va_start(ap, fmt); - (void)__wt_eventv(session, false, 0, NULL, 0, fmt, ap); + WT_IGNORE_RET(__wt_eventv(session, false, 0, NULL, 0, fmt, ap)); va_end(ap); } @@ -398,6 +400,7 @@ info_msg(WT_SESSION_IMPL *session, const char *fmt, va_list ap) */ int __wt_msg(WT_SESSION_IMPL *session, const char *fmt, ...) + WT_GCC_FUNC_ATTRIBUTE((cold)) WT_GCC_FUNC_ATTRIBUTE((format (printf, 2, 3))) { WT_DECL_RET; @@ -474,6 +477,7 @@ __wt_progress(WT_SESSION_IMPL *session, const char *s, uint64_t v) void __wt_assert(WT_SESSION_IMPL *session, int error, const char *file_name, int line_number, const char *fmt, ...) + WT_GCC_FUNC_ATTRIBUTE((cold)) WT_GCC_FUNC_ATTRIBUTE((format (printf, 5, 6))) #ifdef HAVE_DIAGNOSTIC WT_GCC_FUNC_ATTRIBUTE((noreturn)) @@ -482,8 +486,8 @@ __wt_assert(WT_SESSION_IMPL *session, va_list ap; va_start(ap, fmt); - (void)__wt_eventv( - session, false, error, file_name, line_number, fmt, ap); + WT_IGNORE_RET(__wt_eventv( + session, false, error, file_name, line_number, fmt, ap)); va_end(ap); #ifdef HAVE_DIAGNOSTIC @@ -498,6 +502,7 @@ __wt_assert(WT_SESSION_IMPL *session, */ int __wt_panic(WT_SESSION_IMPL *session) + WT_GCC_FUNC_ATTRIBUTE((cold)) { F_SET(S2C(session), WT_CONN_PANIC); __wt_err(session, WT_PANIC, "the process must exit and restart"); @@ -521,6 +526,7 @@ __wt_panic(WT_SESSION_IMPL *session) */ int __wt_illegal_value(WT_SESSION_IMPL *session, const char *name) + WT_GCC_FUNC_ATTRIBUTE((cold)) { __wt_errx(session, "%s%s%s", name == NULL ? "" : name, name == NULL ? "" : ": ", @@ -541,6 +547,7 @@ __wt_illegal_value(WT_SESSION_IMPL *session, const char *name) */ int __wt_object_unsupported(WT_SESSION_IMPL *session, const char *uri) + WT_GCC_FUNC_ATTRIBUTE((cold)) { WT_RET_MSG(session, ENOTSUP, "unsupported object operation: %s", uri); } @@ -552,6 +559,7 @@ __wt_object_unsupported(WT_SESSION_IMPL *session, const char *uri) */ int __wt_bad_object_type(WT_SESSION_IMPL *session, const char *uri) + WT_GCC_FUNC_ATTRIBUTE((cold)) { if (WT_PREFIX_MATCH(uri, "backup:") || WT_PREFIX_MATCH(uri, "colgroup:") || diff --git a/src/third_party/wiredtiger/src/support/global.c b/src/third_party/wiredtiger/src/support/global.c index eba88bf2b20..325666b1471 100644 --- a/src/third_party/wiredtiger/src/support/global.c +++ b/src/third_party/wiredtiger/src/support/global.c @@ -61,7 +61,7 @@ __wt_global_once(void) #ifdef HAVE_DIAGNOSTIC /* Load debugging code the compiler might optimize out. */ - (void)__wt_breakpoint(); + __wt_breakpoint(); #endif } @@ -97,10 +97,14 @@ __wt_library_init(void) * __wt_breakpoint -- * A simple place to put a breakpoint, if you need one. */ -int +void __wt_breakpoint(void) { - return (0); + /* + * Yield the processor (just to keep the compiler from optimizing the + * function out). + */ + __wt_yield(); } /* diff --git a/src/third_party/wiredtiger/src/support/hazard.c b/src/third_party/wiredtiger/src/support/hazard.c index dee85586a4d..8ac8f5f9f6d 100644 --- a/src/third_party/wiredtiger/src/support/hazard.c +++ b/src/third_party/wiredtiger/src/support/hazard.c @@ -238,6 +238,25 @@ __wt_hazard_close(WT_SESSION_IMPL *session) (void *)session); } +/* + * __wt_hazard_count -- + * Count how many hazard pointers this session has on the given page. + */ +u_int +__wt_hazard_count(WT_SESSION_IMPL *session, WT_PAGE *page) +{ + WT_HAZARD *hp; + u_int count; + + for (count = 0, hp = session->hazard + session->hazard_size - 1; + hp >= session->hazard; + --hp) + if (hp->page == page) + ++count; + + return (count); +} + #ifdef HAVE_DIAGNOSTIC /* * __hazard_dump -- diff --git a/src/third_party/wiredtiger/src/support/mtx_rw.c b/src/third_party/wiredtiger/src/support/mtx_rw.c index dbf73bb4f13..0bdde81c32f 100644 --- a/src/third_party/wiredtiger/src/support/mtx_rw.c +++ b/src/third_party/wiredtiger/src/support/mtx_rw.c @@ -45,19 +45,19 @@ * struct { * uint16_t writers; Now serving for writers * uint16_t readers; Now serving for readers - * uint16_t users; Next available ticket number + * uint16_t next; Next available ticket number * uint16_t __notused; Padding * } * * First, imagine a store's 'take a number' ticket algorithm. A customer takes * a unique ticket number and customers are served in ticket order. In the data * structure, 'writers' is the next writer to be served, 'readers' is the next - * reader to be served, and 'users' is the next available ticket number. + * reader to be served, and 'next' is the next available ticket number. * * Next, consider exclusive (write) locks. The 'now serving' number for writers * is 'writers'. To lock, 'take a number' and wait until that number is being * served; more specifically, atomically copy and increment the current value of - * 'users', and then wait until 'writers' equals that copied number. + * 'next', and then wait until 'writers' equals that copied number. * * Shared (read) locks are similar. Like writers, readers atomically get the * next number available. However, instead of waiting for 'writers' to equal @@ -74,7 +74,7 @@ * * For example, consider the following read (R) and write (W) lock requests: * - * writers readers users + * writers readers next * 0 0 0 * R: ticket 0, readers match OK 0 1 1 * R: ticket 1, readers match OK 0 2 2 @@ -92,7 +92,7 @@ * and the next ticket holder (reader or writer) will unblock when the writer * unlocks. An example, continuing from the last line of the above example: * - * writers readers users + * writers readers next * W: ticket 3, writers match OK 3 3 4 * R: ticket 4, readers no match block 3 3 5 * R: ticket 5, readers no match block 3 3 6 @@ -101,8 +101,8 @@ * R: ticket 4, readers match OK 4 5 7 * R: ticket 5, readers match OK 4 6 7 * - * The 'users' field is a 2-byte value so the available ticket number wraps at - * 64K requests. If a thread's lock request is not granted until the 'users' + * The 'next' field is a 2-byte value so the available ticket number wraps at + * 64K requests. If a thread's lock request is not granted until the 'next' * field cycles and the same ticket is taken by another thread, we could grant * a lock to two separate threads at the same time, and bad things happen: two * writer threads or a reader thread and a writer thread would run in parallel, @@ -124,7 +124,7 @@ __wt_rwlock_alloc( { WT_RWLOCK *rwlock; - WT_RET(__wt_verbose(session, WT_VERB_MUTEX, "rwlock: alloc %s", name)); + __wt_verbose(session, WT_VERB_MUTEX, "rwlock: alloc %s", name); WT_RET(__wt_calloc_one(session, &rwlock)); @@ -143,8 +143,6 @@ __wt_try_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) { wt_rwlock_t *l, new, old; - WT_RET(__wt_verbose( - session, WT_VERB_MUTEX, "rwlock: try_readlock %s", rwlock->name)); WT_STAT_FAST_CONN_INCR(session, rwlock_read); l = &rwlock->rwlock; @@ -157,14 +155,14 @@ __wt_try_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * Do the cheap test to see if this can possibly succeed (and confirm * the lock is in the correct state to grant this read lock). */ - if (old.s.readers != old.s.users) + if (old.s.readers != old.s.next) return (EBUSY); /* * The replacement lock value is a result of allocating a new ticket and * incrementing the reader value to match it. */ - new.s.readers = new.s.users = old.s.users + 1; + new.s.readers = new.s.next = old.s.next + 1; return (__wt_atomic_cas64(&l->u, old.u, new.u) ? 0 : EBUSY); } @@ -172,15 +170,13 @@ __wt_try_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * __wt_readlock -- * Get a shared lock. */ -int +void __wt_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) { wt_rwlock_t *l; uint16_t ticket; int pause_cnt; - WT_RET(__wt_verbose( - session, WT_VERB_MUTEX, "rwlock: readlock %s", rwlock->name)); WT_STAT_FAST_CONN_INCR(session, rwlock_read); WT_DIAGNOSTIC_YIELD; @@ -192,7 +188,7 @@ __wt_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * value will wrap and two lockers will simultaneously be granted the * lock. */ - ticket = __wt_atomic_fetch_add16(&l->s.users, 1); + ticket = __wt_atomic_fetch_add16(&l->s.next, 1); for (pause_cnt = 0; ticket != l->s.readers;) { /* * We failed to get the lock; pause before retrying and if we've @@ -220,21 +216,18 @@ __wt_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * lock see consistent data. */ WT_READ_BARRIER(); - - return (0); } /* * __wt_readunlock -- * Release a shared lock. */ -int +void __wt_readunlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) { wt_rwlock_t *l; - WT_RET(__wt_verbose( - session, WT_VERB_MUTEX, "rwlock: read unlock %s", rwlock->name)); + WT_UNUSED(session); l = &rwlock->rwlock; @@ -243,8 +236,6 @@ __wt_readunlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * sure we don't race). */ (void)__wt_atomic_add16(&l->s.writers, 1); - - return (0); } /* @@ -256,8 +247,6 @@ __wt_try_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) { wt_rwlock_t *l, new, old; - WT_RET(__wt_verbose( - session, WT_VERB_MUTEX, "rwlock: try_writelock %s", rwlock->name)); WT_STAT_FAST_CONN_INCR(session, rwlock_write); l = &rwlock->rwlock; @@ -270,11 +259,11 @@ __wt_try_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * Do the cheap test to see if this can possibly succeed (and confirm * the lock is in the correct state to grant this write lock). */ - if (old.s.writers != old.s.users) + if (old.s.writers != old.s.next) return (EBUSY); /* The replacement lock value is a result of allocating a new ticket. */ - ++new.s.users; + ++new.s.next; return (__wt_atomic_cas64(&l->u, old.u, new.u) ? 0 : EBUSY); } @@ -282,15 +271,13 @@ __wt_try_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * __wt_writelock -- * Wait to get an exclusive lock. */ -int +void __wt_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) { wt_rwlock_t *l; uint16_t ticket; int pause_cnt; - WT_RET(__wt_verbose( - session, WT_VERB_MUTEX, "rwlock: writelock %s", rwlock->name)); WT_STAT_FAST_CONN_INCR(session, rwlock_write); l = &rwlock->rwlock; @@ -300,7 +287,7 @@ __wt_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * value will wrap and two lockers will simultaneously be granted the * lock. */ - ticket = __wt_atomic_fetch_add16(&l->s.users, 1); + ticket = __wt_atomic_fetch_add16(&l->s.next, 1); for (pause_cnt = 0; ticket != l->s.writers;) { /* * We failed to get the lock; pause before retrying and if we've @@ -319,21 +306,18 @@ __wt_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * lock see consistent data. */ WT_READ_BARRIER(); - - return (0); } /* * __wt_writeunlock -- * Release an exclusive lock. */ -int +void __wt_writeunlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) { wt_rwlock_t *l, new; - WT_RET(__wt_verbose( - session, WT_VERB_MUTEX, "rwlock: writeunlock %s", rwlock->name)); + WT_UNUSED(session); /* * Ensure that all updates made while the lock was held are visible to @@ -356,27 +340,42 @@ __wt_writeunlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) l->i.wr = new.i.wr; WT_DIAGNOSTIC_YIELD; - - return (0); } /* * __wt_rwlock_destroy -- * Destroy a read/write lock. */ -int +void __wt_rwlock_destroy(WT_SESSION_IMPL *session, WT_RWLOCK **rwlockp) { WT_RWLOCK *rwlock; rwlock = *rwlockp; /* Clear our caller's reference. */ if (rwlock == NULL) - return (0); + return; *rwlockp = NULL; - WT_RET(__wt_verbose( - session, WT_VERB_MUTEX, "rwlock: destroy %s", rwlock->name)); + __wt_verbose( + session, WT_VERB_MUTEX, "rwlock: destroy %s", rwlock->name); __wt_free(session, rwlock); - return (0); } + +#ifdef HAVE_DIAGNOSTIC +/* + * __wt_rwlock_islocked -- + * Return if a read/write lock is currently locked for reading or writing. + */ +bool +__wt_rwlock_islocked(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) +{ + wt_rwlock_t *l; + + WT_UNUSED(session); + + l = &rwlock->rwlock; + + return (l->s.writers != l->s.next || l->s.readers != l->s.next); +} +#endif diff --git a/src/third_party/wiredtiger/src/support/stat.c b/src/third_party/wiredtiger/src/support/stat.c index 49cb3bebc07..8927be862c1 100644 --- a/src/third_party/wiredtiger/src/support/stat.c +++ b/src/third_party/wiredtiger/src/support/stat.c @@ -562,10 +562,10 @@ static const char * const __stats_connection_desc[] = { "cache: eviction server candidate queue empty when topping up", "cache: eviction server candidate queue not empty when topping up", "cache: eviction server evicting pages", - "cache: eviction server populating queue, but not evicting pages", "cache: eviction server skipped very large page", "cache: eviction server slept, because we did not make progress with eviction", "cache: eviction server unable to reach eviction goal", + "cache: eviction state", "cache: eviction worker thread evicting pages", "cache: failed eviction of pages that exceeded the in-memory maximum", "cache: files with active eviction walks", @@ -805,10 +805,10 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->cache_eviction_queue_empty = 0; stats->cache_eviction_queue_not_empty = 0; stats->cache_eviction_server_evicting = 0; - stats->cache_eviction_server_not_evicting = 0; stats->cache_eviction_server_toobig = 0; stats->cache_eviction_server_slept = 0; stats->cache_eviction_slow = 0; + /* not clearing cache_eviction_state */ stats->cache_eviction_worker_evicting = 0; stats->cache_eviction_force_fail = 0; /* not clearing cache_eviction_walks_active */ @@ -905,9 +905,9 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->log_write_lsn = 0; stats->log_write_lsn_skip = 0; stats->log_sync = 0; - stats->log_sync_duration = 0; + /* not clearing log_sync_duration */ stats->log_sync_dir = 0; - stats->log_sync_dir_duration = 0; + /* not clearing log_sync_dir_duration */ stats->log_writes = 0; stats->log_slot_consolidated = 0; /* not clearing log_max_filesize */ @@ -1049,13 +1049,12 @@ __wt_stat_connection_aggregate( WT_STAT_READ(from, cache_eviction_queue_not_empty); to->cache_eviction_server_evicting += WT_STAT_READ(from, cache_eviction_server_evicting); - to->cache_eviction_server_not_evicting += - WT_STAT_READ(from, cache_eviction_server_not_evicting); to->cache_eviction_server_toobig += WT_STAT_READ(from, cache_eviction_server_toobig); to->cache_eviction_server_slept += WT_STAT_READ(from, cache_eviction_server_slept); to->cache_eviction_slow += WT_STAT_READ(from, cache_eviction_slow); + to->cache_eviction_state += WT_STAT_READ(from, cache_eviction_state); to->cache_eviction_worker_evicting += WT_STAT_READ(from, cache_eviction_worker_evicting); to->cache_eviction_force_fail += diff --git a/src/third_party/wiredtiger/src/support/thread_group.c b/src/third_party/wiredtiger/src/support/thread_group.c new file mode 100644 index 00000000000..016956c527f --- /dev/null +++ b/src/third_party/wiredtiger/src/support/thread_group.c @@ -0,0 +1,340 @@ +/*- + * Copyright (c) 2014-2016 MongoDB, Inc. + * Copyright (c) 2008-2014 WiredTiger, Inc. + * All rights reserved. + * + * See the file LICENSE for redistribution information. + */ + +#include "wt_internal.h" + +/* + * __wt_thread_run -- + * General wrapper for any thread. + */ +WT_THREAD_RET +__wt_thread_run(void *arg) +{ + WT_DECL_RET; + WT_SESSION_IMPL *session; + WT_THREAD *thread; + + thread = (WT_THREAD*)arg; + session = thread->session; + + ret = thread->run_func(session, thread); + + if (ret != 0 && F_ISSET(thread, WT_THREAD_PANIC_FAIL)) + WT_PANIC_MSG(session, ret, + "Unrecoverable utility thread error"); + + /* + * The three cases when threads are expected to stop are: + * 1. When recovery is done. + * 2. When the connection is closing. + * 3. When a shutdown has been requested via clearing the run flag. + */ + WT_ASSERT(session, !F_ISSET(thread, WT_THREAD_RUN) || + F_ISSET(S2C(session), WT_CONN_CLOSING | WT_CONN_RECOVERING)); + + return (WT_THREAD_RET_VALUE); +} + +/* + * __thread_group_grow -- + * Increase the number of running threads in the group. + */ +static int +__thread_group_grow( + WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, uint32_t new_count) +{ + WT_THREAD *thread; + + WT_ASSERT(session, + __wt_rwlock_islocked(session, group->lock)); + + /* + * Any bounds checking is done by the caller so we know that + * there is space in the array for new threads. + */ + while (group->current_threads < new_count) { + thread = group->threads[group->current_threads++]; + __wt_verbose(session, WT_VERB_THREAD_GROUP, + "Starting utility thread: %p:%"PRIu32"\n", + group, thread->id); + F_SET(thread, WT_THREAD_RUN); + WT_ASSERT(session, thread->session != NULL); + WT_RET(__wt_thread_create(thread->session, + &thread->tid, __wt_thread_run, thread)); + } + return (0); +} + +/* + * __thread_group_shrink -- + * Decrease the number of running threads in the group, and free any + * memory associated with slots larger than the new count. + */ +static int +__thread_group_shrink(WT_SESSION_IMPL *session, + WT_THREAD_GROUP *group, uint32_t new_count) +{ + WT_DECL_RET; + WT_SESSION *wt_session; + WT_THREAD *thread; + uint32_t current_slot; + + WT_ASSERT(session, + __wt_rwlock_islocked(session, group->lock)); + + for (current_slot = group->alloc; current_slot > new_count; ) { + /* + * The offset value is a counter not an array index, + * so adjust it before finding the last thread in the group. + */ + thread = group->threads[--current_slot]; + + if (thread == NULL) + continue; + + /* Wake threads to ensure they notice the state change */ + if (thread->tid != 0) { + __wt_verbose(session, WT_VERB_THREAD_GROUP, + "Stopping utility thread: %p:%"PRIu32"\n", + group, thread->id); + F_CLR(thread, WT_THREAD_RUN); + __wt_cond_signal(session, group->wait_cond); + WT_TRET(__wt_thread_join(session, thread->tid)); + thread->tid = 0; + } + + if (thread->session != NULL) { + wt_session = (WT_SESSION *)thread->session; + WT_TRET(wt_session->close(wt_session, NULL)); + thread->session = NULL; + } + __wt_free(session, thread); + group->threads[current_slot] = NULL; + } + + /* Update the thread group state to match our changes */ + group->current_threads = current_slot; + return (ret); +} + +/* + * __thread_group_resize -- + * Resize an array of utility threads already holding the lock. + */ +static int +__thread_group_resize( + WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, + uint32_t new_min, uint32_t new_max, uint32_t flags) +{ + WT_CONNECTION_IMPL *conn; + WT_DECL_RET; + WT_THREAD *thread; + size_t alloc; + uint32_t i, session_flags; + + conn = S2C(session); + session_flags = 0; + + WT_ASSERT(session, + group->current_threads <= group->alloc && + __wt_rwlock_islocked(session, group->lock)); + + if (new_min == group->min && new_max == group->max) + return (0); + + /* + * Coll shrink to reduce the number of thread structures and running + * threads if required by the change in group size. + */ + WT_RET(__thread_group_shrink(session, group, new_max)); + + /* + * Only reallocate the thread array if it is the largest ever, since + * our realloc doesn't support shrinking the allocated size. + */ + if (group->alloc < new_max) { + alloc = group->alloc * sizeof(*group->threads); + WT_RET(__wt_realloc(session, &alloc, + new_max * sizeof(*group->threads), &group->threads)); + group->alloc = new_max; + } + + /* + * Initialize the structures based on the previous group size, not + * the previous allocated size. + */ + for (i = group->max; i < new_max; i++) { + WT_ERR(__wt_calloc_one(session, &thread)); + /* + * Threads get their own session and lookaside table cursor + * if the lookaside table is open. Note that threads are + * started during recovery, before the lookaside table is + * created. + */ + if (LF_ISSET(WT_THREAD_CAN_WAIT)) + session_flags = WT_SESSION_CAN_WAIT; + if (F_ISSET(conn, WT_CONN_LAS_OPEN)) + FLD_SET(session_flags, WT_SESSION_LOOKASIDE_CURSOR); + WT_ERR(__wt_open_internal_session(conn, group->name, + false, session_flags, &thread->session)); + if (LF_ISSET(WT_THREAD_PANIC_FAIL)) + F_SET(thread, WT_THREAD_PANIC_FAIL); + thread->id = i; + thread->run_func = group->run_func; + WT_ASSERT(session, group->threads[i] == NULL); + group->threads[i] = thread; + } + + if (group->current_threads < new_min) + WT_ERR(__thread_group_grow(session, group, new_min)); + +err: /* + * Update the thread group information even on failure to improve our + * chances of cleaning up properly. + */ + group->max = new_max; + group->min = new_min; + + /* + * An error resizing a thread array is fatal, it should only happen + * in an out of memory situation. + */ + if (ret != 0) { + WT_TRET(__wt_thread_group_destroy(session, group)); + WT_PANIC_RET(session, ret, + "Error while resizing thread group"); + } + return (ret); +} + +/* + * __wt_thread_group_resize -- + * Resize an array of utility threads taking the lock. + */ +int +__wt_thread_group_resize( + WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, + uint32_t new_min, uint32_t new_max, uint32_t flags) +{ + WT_DECL_RET; + + __wt_verbose(session, WT_VERB_THREAD_GROUP, + "Resize thread group: %p, from min: %" PRIu32 " -> %" PRIu32 + " from max: %" PRIu32 " -> %" PRIu32 "\n", + group, group->min, new_min, group->max, new_max); + + __wt_writelock(session, group->lock); + WT_TRET(__thread_group_resize( + session, group, new_min, new_max, flags)); + __wt_writeunlock(session, group->lock); + return (ret); +} + +/* + * __wt_thread_group_create -- + * Create a new thread group, assumes incoming group structure is + * zero initialized. + */ +int +__wt_thread_group_create( + WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, const char *name, + uint32_t min, uint32_t max, uint32_t flags, + int (*run_func)(WT_SESSION_IMPL *session, WT_THREAD *context)) +{ + WT_DECL_RET; + bool cond_alloced; + + /* Check that the structure is initialized as expected */ + WT_ASSERT(session, group->alloc == 0); + + cond_alloced = false; + + __wt_verbose(session, WT_VERB_THREAD_GROUP, + "Creating thread group: %p\n", group); + + WT_RET(__wt_rwlock_alloc(session, &group->lock, "Thread group")); + WT_ERR(__wt_cond_alloc( + session, "Thread group cond", false, &group->wait_cond)); + cond_alloced = true; + + __wt_writelock(session, group->lock); + group->run_func = run_func; + group->name = name; + + WT_TRET(__thread_group_resize(session, group, min, max, flags)); + __wt_writeunlock(session, group->lock); + + /* Cleanup on error to avoid leaking resources */ +err: if (ret != 0) { + if (cond_alloced) + WT_TRET(__wt_cond_destroy(session, &group->wait_cond)); + __wt_rwlock_destroy(session, &group->lock); + } + return (ret); +} + +/* + * __wt_thread_group_destroy -- + * Shut down a thread group. Our caller must hold the lock. + */ +int +__wt_thread_group_destroy( + WT_SESSION_IMPL *session, WT_THREAD_GROUP *group) +{ + WT_DECL_RET; + + __wt_verbose(session, WT_VERB_THREAD_GROUP, + "Destroying thread group: %p\n", group); + + WT_ASSERT(session, + __wt_rwlock_islocked(session, group->lock)); + + /* Shut down all threads and free associated resources. */ + WT_TRET(__thread_group_shrink(session, group, 0)); + + __wt_free(session, group->threads); + + WT_TRET(__wt_cond_destroy(session, &group->wait_cond)); + __wt_rwlock_destroy(session, &group->lock); + + /* + * Clear out any settings from the group, some structures are reused + * for different thread groups - in particular the eviction thread + * group for recovery and then normal runtime. + */ + memset(group, 0, sizeof(*group)); + + return (ret); +} + +/* + * __wt_thread_group_start_one -- + * Start a new thread if possible. + */ +int +__wt_thread_group_start_one( + WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, bool wait) +{ + WT_DECL_RET; + + if (group->current_threads >= group->max) + return (0); + + if (wait) + __wt_writelock(session, group->lock); + else if (__wt_try_writelock(session, group->lock) != 0) + return (0); + + /* Recheck the bounds now that we hold the lock */ + if (group->current_threads < group->max) + WT_TRET(__thread_group_grow( + session, group, group->current_threads + 1)); + __wt_writeunlock(session, group->lock); + + return (ret); +} diff --git a/src/third_party/wiredtiger/src/txn/txn.c b/src/third_party/wiredtiger/src/txn/txn.c index 87b74433769..01e0fbbb634 100644 --- a/src/third_party/wiredtiger/src/txn/txn.c +++ b/src/third_party/wiredtiger/src/txn/txn.c @@ -185,7 +185,7 @@ __wt_txn_get_snapshot(WT_SESSION_IMPL *session) WT_ASSERT(session, prev_oldest_id == txn_global->oldest_id); txn_state->snap_min = snap_min; -done: WT_RET(__wt_readunlock(session, txn_global->scan_rwlock)); +done: __wt_readunlock(session, txn_global->scan_rwlock); __txn_sort_snapshot(session, n, current_id); return (0); } @@ -292,12 +292,12 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, uint32_t flags) /* First do a read-only scan. */ if (wait) - WT_RET(__wt_readlock(session, txn_global->scan_rwlock)); + __wt_readlock(session, txn_global->scan_rwlock); else if ((ret = __wt_try_readlock(session, txn_global->scan_rwlock)) != 0) return (ret == EBUSY ? 0 : ret); __txn_oldest_scan(session, &oldest_id, &last_running, &oldest_session); - WT_RET(__wt_readunlock(session, txn_global->scan_rwlock)); + __wt_readunlock(session, txn_global->scan_rwlock); /* * If the state hasn't changed (or hasn't moved far enough for @@ -311,7 +311,7 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, uint32_t flags) /* It looks like an update is necessary, wait for exclusive access. */ if (wait) - WT_RET(__wt_writelock(session, txn_global->scan_rwlock)); + __wt_writelock(session, txn_global->scan_rwlock); else if ((ret = __wt_try_writelock(session, txn_global->scan_rwlock)) != 0) return (ret == EBUSY ? 0 : ret); @@ -357,18 +357,18 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, uint32_t flags) * but only when some progress is being made. */ if (WT_VERBOSE_ISSET(session, WT_VERB_TRANSACTION) && current_id - oldest_id > 10000 && oldest_session != NULL) { - WT_TRET(__wt_verbose(session, WT_VERB_TRANSACTION, + __wt_verbose(session, WT_VERB_TRANSACTION, "old snapshot %" PRIu64 " pinned in session %" PRIu32 " [%s]" " with snap_min %" PRIu64 "\n", oldest_id, oldest_session->id, oldest_session->lastop, - oldest_session->txn.snap_min)); + oldest_session->txn.snap_min); } #endif } -done: WT_TRET(__wt_writeunlock(session, txn_global->scan_rwlock)); +done: __wt_writeunlock(session, txn_global->scan_rwlock); return (ret); } @@ -782,23 +782,20 @@ __wt_txn_global_init(WT_SESSION_IMPL *session, const char *cfg[]) * __wt_txn_global_destroy -- * Destroy the global transaction state. */ -int +void __wt_txn_global_destroy(WT_SESSION_IMPL *session) { WT_CONNECTION_IMPL *conn; - WT_DECL_RET; WT_TXN_GLOBAL *txn_global; conn = S2C(session); txn_global = &conn->txn_global; if (txn_global == NULL) - return (0); + return; __wt_spin_destroy(session, &txn_global->id_lock); - WT_TRET(__wt_rwlock_destroy(session, &txn_global->scan_rwlock)); - WT_TRET(__wt_rwlock_destroy(session, &txn_global->nsnap_rwlock)); + __wt_rwlock_destroy(session, &txn_global->scan_rwlock); + __wt_rwlock_destroy(session, &txn_global->nsnap_rwlock); __wt_free(session, txn_global->states); - - return (ret); } diff --git a/src/third_party/wiredtiger/src/txn/txn_ckpt.c b/src/third_party/wiredtiger/src/txn/txn_ckpt.c index 089237d79e3..5406367c372 100644 --- a/src/third_party/wiredtiger/src/txn/txn_ckpt.c +++ b/src/third_party/wiredtiger/src/txn/txn_ckpt.c @@ -493,10 +493,10 @@ __checkpoint_verbose_track(WT_SESSION_IMPL *session, * Get time diff in microseconds. */ msec = WT_TIMEDIFF_MS(stop, *start); - WT_RET(__wt_verbose(session, + __wt_verbose(session, WT_VERB_CHECKPOINT, "time: %" PRIu64 " us, gen: %" PRIu64 ": Full database checkpoint %s", - msec, S2C(session)->txn_global.checkpoint_gen, msg)); + msec, S2C(session)->txn_global.checkpoint_gen, msg); /* Update the timestamp so we are reporting intervals. */ memcpy(start, &stop, sizeof(*start)); @@ -555,6 +555,9 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) /* Reset the maximum page size seen by eviction. */ conn->cache->evict_max_page_size = 0; + /* Initialize the verbose tracking timer */ + WT_ERR(__wt_epoch(session, &verb_timer)); + /* * Update the global oldest ID so we do all possible cleanup. * @@ -656,7 +659,7 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) * This allows ordinary visibility checks to move forward because * checkpoints often take a long time and only write to the metadata. */ - WT_ERR(__wt_writelock(session, txn_global->scan_rwlock)); + __wt_writelock(session, txn_global->scan_rwlock); txn_global->checkpoint_txnid = txn->id; txn_global->checkpoint_pinned = WT_MIN(txn->id, txn->snap_min); @@ -676,7 +679,7 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) * details). */ txn_state->id = txn_state->snap_min = WT_TXN_NONE; - WT_ERR(__wt_writeunlock(session, txn_global->scan_rwlock)); + __wt_writeunlock(session, txn_global->scan_rwlock); /* * Unblock updates -- we can figure out that any updates to clean pages @@ -715,7 +718,7 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) /* Mark all trees as open for business (particularly eviction). */ WT_ERR(__checkpoint_apply(session, cfg, __checkpoint_presync)); - WT_ERR(__wt_evict_server_wake(session)); + __wt_evict_server_wake(session); WT_ERR(__checkpoint_verbose_track(session, "committing transaction", &verb_timer)); @@ -729,7 +732,7 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) WT_ERR(__wt_epoch(session, &fsync_stop)); fsync_duration_usecs = WT_TIMEDIFF_US(fsync_stop, fsync_start); WT_STAT_FAST_CONN_INCR(session, txn_checkpoint_fsync_post); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_FAST_CONN_SET(session, txn_checkpoint_fsync_post_duration, fsync_duration_usecs); WT_ERR(__checkpoint_verbose_track(session, @@ -1099,7 +1102,7 @@ __checkpoint_lock_tree(WT_SESSION_IMPL *session, * Hold the lock until we're done (blocking hot backups from starting), * we don't want to race with a future hot backup. */ - WT_ERR(__wt_readlock(session, conn->hot_backup_lock)); + __wt_readlock(session, conn->hot_backup_lock); hot_backup_locked = true; if (conn->hot_backup) WT_CKPT_FOREACH(ckptbase, ckpt) { @@ -1173,8 +1176,7 @@ __checkpoint_lock_tree(WT_SESSION_IMPL *session, WT_ASSERT(session, !is_checkpoint || !F_ISSET(btree, WT_BTREE_SPECIAL_FLAGS)); - hot_backup_locked = false; - WT_ERR(__wt_readunlock(session, conn->hot_backup_lock)); + __wt_readunlock(session, conn->hot_backup_lock); WT_ASSERT(session, btree->ckpt == NULL); btree->ckpt = ckptbase; @@ -1182,7 +1184,7 @@ __checkpoint_lock_tree(WT_SESSION_IMPL *session, return (0); err: if (hot_backup_locked) - WT_TRET(__wt_readunlock(session, conn->hot_backup_lock)); + __wt_readunlock(session, conn->hot_backup_lock); __wt_meta_ckptlist_free(session, ckptbase); __wt_free(session, name_alloc); @@ -1480,7 +1482,7 @@ __checkpoint_tree_helper(WT_SESSION_IMPL *session, const char *cfg[]) * progress. Without this, application threads will be stalled * until the eviction server next wakes. */ - WT_TRET(__wt_evict_server_wake(session)); + __wt_evict_server_wake(session); return (ret); } diff --git a/src/third_party/wiredtiger/src/txn/txn_log.c b/src/third_party/wiredtiger/src/txn/txn_log.c index e73ff00f5b7..c7d83d1db64 100644 --- a/src/third_party/wiredtiger/src/txn/txn_log.c +++ b/src/third_party/wiredtiger/src/txn/txn_log.c @@ -376,7 +376,7 @@ __wt_txn_checkpoint_log( * that case. */ if (!S2C(session)->hot_backup && txn->full_ckpt) - WT_ERR(__wt_log_ckpt(session, ckpt_lsn)); + __wt_log_ckpt(session, ckpt_lsn); /* FALLTHROUGH */ case WT_TXN_LOG_CKPT_CLEANUP: diff --git a/src/third_party/wiredtiger/src/txn/txn_nsnap.c b/src/third_party/wiredtiger/src/txn/txn_nsnap.c index 5b8fed23a9f..05c45c0dc38 100644 --- a/src/third_party/wiredtiger/src/txn/txn_nsnap.c +++ b/src/third_party/wiredtiger/src/txn/txn_nsnap.c @@ -256,7 +256,7 @@ __wt_txn_named_snapshot_get(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *nameval) if (session->ncursors > 0) WT_RET(__wt_session_copy_values(session)); - WT_RET(__wt_readlock(session, txn_global->nsnap_rwlock)); + __wt_readlock(session, txn_global->nsnap_rwlock); TAILQ_FOREACH(nsnap, &txn_global->nsnaph, q) if (WT_STRING_MATCH(nsnap->name, nameval->str, nameval->len)) { txn->snap_min = txn_state->snap_min = nsnap->snap_min; @@ -268,7 +268,7 @@ __wt_txn_named_snapshot_get(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *nameval) F_SET(txn, WT_TXN_HAS_SNAPSHOT); break; } - WT_RET(__wt_readunlock(session, txn_global->nsnap_rwlock)); + __wt_readunlock(session, txn_global->nsnap_rwlock); if (nsnap == NULL) WT_RET_MSG(session, EINVAL, diff --git a/src/third_party/wiredtiger/src/txn/txn_recover.c b/src/third_party/wiredtiger/src/txn/txn_recover.c index bd004e0f837..ae21e58d9b6 100644 --- a/src/third_party/wiredtiger/src/txn/txn_recover.c +++ b/src/third_party/wiredtiger/src/txn/txn_recover.c @@ -60,9 +60,9 @@ __recovery_cursor(WT_SESSION_IMPL *session, WT_RECOVERY *r, else if (id >= r->nfiles || r->files[id].uri == NULL) { /* If a file is missing, output a verbose message once. */ if (!r->missing) - WT_RET(__wt_verbose(session, WT_VERB_RECOVERY, + __wt_verbose(session, WT_VERB_RECOVERY, "No file found with ID %u (max %u)", - id, r->nfiles)); + id, r->nfiles); r->missing = true; } else if (__wt_log_cmp(lsnp, &r->files[id].ckpt_lsn) >= 0) { /* @@ -89,11 +89,11 @@ __recovery_cursor(WT_SESSION_IMPL *session, WT_RECOVERY *r, */ #define GET_RECOVERY_CURSOR(session, r, lsnp, fileid, cp) \ WT_ERR(__recovery_cursor(session, r, lsnp, fileid, false, cp)); \ - WT_ERR(__wt_verbose(session, WT_VERB_RECOVERY, \ + __wt_verbose(session, WT_VERB_RECOVERY, \ "%s op %" PRIu32 " to file %" PRIu32 " at LSN %" PRIu32 \ "/%" PRIu32, \ cursor == NULL ? "Skipping" : "Applying", \ - optype, fileid, lsnp->l.file, lsnp->l.offset)); \ + optype, fileid, lsnp->l.file, lsnp->l.offset); \ if (cursor == NULL) \ break @@ -333,9 +333,9 @@ __recovery_setup_file(WT_RECOVERY *r, const char *uri, const char *config) (int)cval.len, cval.str); r->files[fileid].ckpt_lsn = lsn; - WT_RET(__wt_verbose(r->session, WT_VERB_RECOVERY, + __wt_verbose(r->session, WT_VERB_RECOVERY, "Recovering %s with id %" PRIu32 " @ (%" PRIu32 ", %" PRIu32 ")", - uri, fileid, lsn.l.file, lsn.l.offset)); + uri, fileid, lsn.l.file, lsn.l.offset); return (0); @@ -496,9 +496,9 @@ __wt_txn_recover(WT_SESSION_IMPL *session) * Pass WT_LOGSCAN_RECOVER so that old logs get truncated. */ r.metadata_only = false; - WT_ERR(__wt_verbose(session, WT_VERB_RECOVERY, + __wt_verbose(session, WT_VERB_RECOVERY, "Main recovery loop: starting at %" PRIu32 "/%" PRIu32, - r.ckpt_lsn.l.file, r.ckpt_lsn.l.offset)); + r.ckpt_lsn.l.file, r.ckpt_lsn.l.offset); WT_ERR(__wt_log_needs_recovery(session, &r.ckpt_lsn, &needs_rec)); /* * Check if the database was shut down cleanly. If not diff --git a/src/third_party/wiredtiger/src/utilities/util.h b/src/third_party/wiredtiger/src/utilities/util.h index 3882d814e3a..c2cf6c22aa4 100644 --- a/src/third_party/wiredtiger/src/utilities/util.h +++ b/src/third_party/wiredtiger/src/utilities/util.h @@ -33,7 +33,8 @@ void util_copyright(void); int util_create(WT_SESSION *, int, char *[]); int util_drop(WT_SESSION *, int, char *[]); int util_dump(WT_SESSION *, int, char *[]); -int util_err(WT_SESSION *, int, const char *, ...); +int util_err(WT_SESSION *, int, const char *, ...) + WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))); int util_flush(WT_SESSION *, const char *); int util_list(WT_SESSION *, int, char *[]); int util_load(WT_SESSION *, int, char *[]); diff --git a/src/third_party/wiredtiger/src/utilities/util_dump.c b/src/third_party/wiredtiger/src/utilities/util_dump.c index 6344a90dddd..7dde13ee837 100644 --- a/src/third_party/wiredtiger/src/utilities/util_dump.c +++ b/src/third_party/wiredtiger/src/utilities/util_dump.c @@ -18,10 +18,10 @@ static int dump_prefix(WT_SESSION *, bool, bool); static int dump_record(WT_CURSOR *, bool, bool); static int dump_suffix(WT_SESSION *, bool); static int dump_table_config(WT_SESSION *, WT_CURSOR *, const char *, bool); -static int dump_table_config_complex( - WT_SESSION *, WT_CURSOR *, WT_CURSOR *, const char *, const char *, bool); +static int dump_table_parts_config( + WT_SESSION *, WT_CURSOR *, const char *, const char *, bool); static int dup_json_string(const char *, char **); -static int print_config(WT_SESSION *, const char *, char *[], bool, bool); +static int print_config(WT_SESSION *, const char *, const char *, bool, bool); static int usage(void); int @@ -146,9 +146,9 @@ dump_config(WT_SESSION *session, const char *uri, bool hex, bool json) /* Open a metadata cursor. */ if ((ret = session->open_cursor( - session, "metadata:", NULL, NULL, &cursor)) != 0) { + session, "metadata:create", NULL, NULL, &cursor)) != 0) { fprintf(stderr, "%s: %s: session.open_cursor: %s\n", progname, - "metadata:", session->strerror(session, ret)); + "metadata:create", session->strerror(session, ret)); return (1); } /* @@ -202,7 +202,7 @@ dump_json_end(WT_SESSION *session) /* * dump_json_begin -- - * Output the dump file header prefix. + * Output a separator between two JSON outputs in a list. */ static int dump_json_separator(WT_SESSION *session) @@ -232,18 +232,8 @@ static int dump_table_config( WT_SESSION *session, WT_CURSOR *cursor, const char *uri, bool json) { - WT_CONFIG_ITEM cval; - WT_CURSOR *srch; WT_DECL_RET; - size_t len; - int tret; - bool complex_table; const char *name, *v; - char *p, **cfg, *_cfg[4] = {NULL, NULL, NULL, NULL}; - - p = NULL; - srch = NULL; - cfg = &_cfg[3]; /* Get the table name. */ if ((name = strchr(uri, ':')) == NULL) { @@ -258,105 +248,39 @@ dump_table_config( */ cursor->set_key(cursor, uri); if ((ret = cursor->search(cursor)) != 0) - WT_ERR(util_cerr(cursor, "search", ret)); + return (util_cerr(cursor, "search", ret)); if ((ret = cursor->get_value(cursor, &v)) != 0) - WT_ERR(util_cerr(cursor, "get_value", ret)); - if ((*--cfg = strdup(v)) == NULL) - WT_ERR(util_err(session, errno, NULL)); - - /* - * Workaround for WiredTiger "simple" table handling. Simple tables - * have column-group entries, but they aren't listed in the metadata's - * table entry, and the name is different from other column-groups. - * Figure out if it's a simple table and in that case, retrieve the - * column-group's configuration value and the column-group's "source" - * entry, where the column-group entry overrides the source's. - */ - complex_table = false; - if (WT_PREFIX_MATCH(uri, "table:")) { - len = strlen("colgroup:") + strlen(name) + 1; - if ((p = malloc(len)) == NULL) - WT_ERR(util_err(session, errno, NULL)); - (void)snprintf(p, len, "colgroup:%s", name); - cursor->set_key(cursor, p); - if ((ret = cursor->search(cursor)) == 0) { - if ((ret = cursor->get_value(cursor, &v)) != 0) - WT_ERR(util_cerr(cursor, "get_value", ret)); - if ((*--cfg = strdup(v)) == NULL) - WT_ERR(util_err(session, errno, NULL)); - if ((ret =__wt_config_getones( - (WT_SESSION_IMPL *)session, - *cfg, "source", &cval)) != 0) - WT_ERR(util_err( - session, ret, "%s: source entry", p)); - free(p); - len = cval.len + 10; - if ((p = malloc(len)) == NULL) - WT_ERR(util_err(session, errno, NULL)); - (void)snprintf(p, len, "%.*s", (int)cval.len, cval.str); - cursor->set_key(cursor, p); - if ((ret = cursor->search(cursor)) != 0) - WT_ERR(util_cerr(cursor, "search", ret)); - if ((ret = cursor->get_value(cursor, &v)) != 0) - WT_ERR(util_cerr(cursor, "get_value", ret)); - if ((*--cfg = strdup(v)) == NULL) - WT_ERR(util_err(session, errno, NULL)); - } else - complex_table = true; - } - - WT_ERR(print_config(session, uri, cfg, json, true)); + return (util_cerr(cursor, "get_value", ret)); - /* - * The underlying table configuration function needs a second - * cursor: open one before calling it, it makes error handling - * hugely simpler. - */ - if ((ret = session->open_cursor( - session, "metadata:", NULL, NULL, &srch)) != 0) - WT_ERR(util_cerr(cursor, "open_cursor", ret)); - - if (complex_table) - WT_ERR(dump_table_config_complex( - session, cursor, srch, name, "colgroup:", json)); - else if (json && printf( - " \"colgroups\" : [],\n") < 0) - WT_ERR(util_cerr(cursor, NULL, EIO)); + WT_RET(print_config(session, uri, v, json, true)); - WT_ERR(dump_table_config_complex( - session, cursor, srch, name, "index:", json)); + WT_RET(dump_table_parts_config( + session, cursor, name, "colgroup:", json)); + WT_RET(dump_table_parts_config( + session, cursor, name, "index:", json)); -err: if (srch != NULL && (tret = srch->close(srch)) != 0) { - tret = util_cerr(cursor, "close", tret); - if (ret == 0) - ret = tret; - } - free(p); - free(_cfg[0]); - free(_cfg[1]); - free(_cfg[2]); - return (ret); + return (0); } /* - * dump_table_config_complex -- - * Dump the column groups or indices for a table. + * dump_table_parts_config -- + * Dump the column groups or indices parts with a table. */ static int -dump_table_config_complex(WT_SESSION *session, WT_CURSOR *cursor, - WT_CURSOR *srch, const char *name, const char *entry, bool json) +dump_table_parts_config(WT_SESSION *session, WT_CURSOR *cursor, + const char *name, const char *entry, bool json) { - WT_CONFIG_ITEM cval; WT_DECL_RET; bool multiple; const char *groupname, *key, *sep; size_t len; int exact; const char *v; - char *p, *cfg[3] = {NULL, NULL, NULL}; + char *uriprefix; multiple = false; sep = ""; + uriprefix = NULL; if (json) { if (strcmp(entry, "colgroup:") == 0) { @@ -368,82 +292,61 @@ dump_table_config_complex(WT_SESSION *session, WT_CURSOR *cursor, if (printf(" \"%s\" : [", groupname) < 0) return (util_err(session, EIO, NULL)); } + + len = strlen(entry) + strlen(name) + 1; + if ((uriprefix = malloc(len)) == NULL) + return util_err(session, errno, NULL); + + snprintf(uriprefix, len, "%s%s", entry, name); + /* * Search the file looking for column group and index key/value pairs: * for each one, look up the related source information and append it * to the base record, where the column group and index configuration * overrides the source configuration. */ - cursor->set_key(cursor, entry); - if ((ret = cursor->search_near(cursor, &exact)) != 0) { - if (ret == WT_NOTFOUND) - return (0); + cursor->set_key(cursor, uriprefix); + ret = cursor->search_near(cursor, &exact); + free(uriprefix); + if (ret == WT_NOTFOUND) + return (0); + if (ret != 0) return (util_cerr(cursor, "search_near", ret)); - } - if (exact >= 0) + + /* + * An exact match is only possible for column groups, and indicates + * there is an implicit (unnamed) column group. Any configuration + * for such a column group has already been folded into the + * configuration for the associated table, so it is not interesting. + */ + if (exact > 0) goto match; - while ((ret = cursor->next(cursor)) == 0) { + while (exact != 0 && (ret = cursor->next(cursor)) == 0) { match: if ((ret = cursor->get_key(cursor, &key)) != 0) return (util_cerr(cursor, "get_key", ret)); /* Check if we've finished the list of entries. */ - if (!WT_PREFIX_MATCH(key, entry)) + if (!WT_PREFIX_MATCH(key, entry) || + !WT_PREFIX_MATCH(key + strlen(entry), name)) break; - /* - * Check for a table name match. This test will match "simple" - * table column-groups as well as the more complex ones, but - * the previous version of the test was wrong and we're only - * in this function in the case of complex tables. - */ - if (!WT_PREFIX_MATCH(key + strlen(entry), name)) - continue; - - /* Get the value. */ if ((ret = cursor->get_value(cursor, &v)) != 0) return (util_cerr(cursor, "get_value", ret)); - if ((cfg[1] = strdup(v)) == NULL) - return (util_err(session, errno, NULL)); - - /* Crack it and get the underlying source. */ - if ((ret = __wt_config_getones( - (WT_SESSION_IMPL *)session, cfg[1], "source", &cval)) != 0) - return ( - util_err(session, ret, "%s: source entry", key)); - - /* Nul-terminate the source entry. */ - len = cval.len + 10; - if ((p = malloc(len)) == NULL) - return (util_err(session, errno, NULL)); - (void)snprintf(p, len, "%.*s", (int)cval.len, cval.str); - srch->set_key(srch, p); - if ((ret = srch->search(srch)) != 0) - ret = util_err(session, ret, "%s: %s", key, p); - free(p); - if (ret != 0) - return (1); - - /* Get the source's value. */ - if ((ret = srch->get_value(srch, &v)) != 0) - return (util_cerr(cursor, "get_value", ret)); - if ((cfg[0] = strdup(v)) == NULL) - return (util_err(session, errno, NULL)); - if (json && printf("%s\n", multiple ? "," : "") < 0) + if (json && printf("%s\n", (multiple ? "," : "")) < 0) return (util_err(session, EIO, NULL)); /* * The dumped configuration string is the original key plus the * source's configuration, where the values of the original key * override any source configurations of the same name. */ - if (print_config(session, key, cfg, json, false) != 0) + if (print_config(session, key, v, json, false) != 0) return (util_err(session, EIO, NULL)); multiple = true; } - if (json && printf("\n ]%s\n", sep) < 0) + if (json && printf("%s]%s\n", + (multiple ? "\n " : ""), sep) < 0) return (util_err(session, EIO, NULL)); - free(cfg[0]); - free(cfg[1]); if (ret == 0 || ret == WT_NOTFOUND) return (0); @@ -573,11 +476,11 @@ dup_json_string(const char *str, char **result) * Output a key/value URI pair by combining v1 and v2. */ static int -print_config( - WT_SESSION *session, const char *key, char *cfg[], bool json, bool toplevel) +print_config(WT_SESSION *session, const char *key, const char *cfg, bool json, + bool toplevel) { WT_DECL_RET; - char *jsonconfig, *value_ret; + char *jsonconfig; /* * We have all of the object configuration, but don't have the default @@ -585,13 +488,9 @@ print_config( * defaults and collapse it all into one load configuration string. */ jsonconfig = NULL; - if ((ret = __wt_schema_create_final( - (WT_SESSION_IMPL *)session, cfg, &value_ret)) != 0) - return (util_err(session, ret, NULL)); - if (json && (ret = dup_json_string(value_ret, &jsonconfig)) != 0) { - free(value_ret); + if (json && (ret = dup_json_string(cfg, &jsonconfig)) != 0) return (util_err(session, ret, NULL)); - } + if (json) { if (toplevel) ret = printf( @@ -604,8 +503,7 @@ print_config( " \"config\" : \"%s\"\n" " }", key, jsonconfig); } else - ret = printf("%s\n%s\n", key, value_ret); - free(value_ret); + ret = printf("%s\n%s\n", key, cfg); free(jsonconfig); if (ret < 0) return (util_err(session, EIO, NULL)); diff --git a/src/third_party/wiredtiger/src/utilities/util_list.c b/src/third_party/wiredtiger/src/utilities/util_list.c index c7afea04b1c..57062b9e9b5 100644 --- a/src/third_party/wiredtiger/src/utilities/util_list.c +++ b/src/third_party/wiredtiger/src/utilities/util_list.c @@ -67,33 +67,29 @@ list_get_allocsize(WT_SESSION *session, const char *key, size_t *allocsize) WT_CONFIG_PARSER *parser; WT_DECL_RET; WT_EXTENSION_API *wt_api; + int tret; char *config; wt_api = session->connection->get_extension_api(session->connection); - if ((ret = - wt_api->metadata_search(wt_api, session, key, &config)) != 0) { - fprintf(stderr, "%s: %s: extension_api.metadata_search: %s\n", - progname, key, session->strerror(session, ret)); - return (ret); - } + if ((ret = wt_api->metadata_search(wt_api, session, key, &config)) != 0) + return (util_err( + session, ret, "%s: WT_EXTENSION_API.metadata_search", key)); if ((ret = wt_api->config_parser_open(wt_api, session, config, - strlen(config), &parser)) != 0) { - fprintf(stderr, "%s: extension_api.config_parser_open: %s\n", - progname, session->strerror(session, ret)); - return (ret); - } + strlen(config), &parser)) != 0) + return (util_err( + session, ret, "WT_EXTENSION_API.config_parser_open")); if ((ret = parser->get(parser, "allocation_size", &szvalue)) != 0) { - if (ret != WT_NOTFOUND) - fprintf(stderr, "%s: config_parser.get: %s\n", - progname, session->strerror(session, ret)); - (void)parser->close(parser); - return (ret); - } - if ((ret = parser->close(parser)) != 0) { - fprintf(stderr, "%s: config_parser.close: %s\n", - progname, session->strerror(session, ret)); + if (ret == WT_NOTFOUND) { + *allocsize = 0; + ret = 0; + } else + ret = util_err(session, ret, "WT_CONFIG_PARSER.get"); + if ((tret = parser->close(parser)) != 0) + (void)util_err(session, tret, "WT_CONFIG_PARSER.close"); return (ret); } + if ((ret = parser->close(parser)) != 0) + return (util_err(session, ret, "WT_CONFIG_PARSER.close")); *allocsize = (size_t)szvalue.val; return (0); } @@ -120,9 +116,8 @@ list_print(WT_SESSION *session, const char *name, bool cflag, bool vflag) if (ret == ENOENT) return (0); - fprintf(stderr, "%s: %s: session.open_cursor: %s\n", - progname, WT_METADATA_URI, session->strerror(session, ret)); - return (1); + return (util_err(session, + ret, "%s: WT_SESSION.open_cursor", WT_METADATA_URI)); } found = name == NULL; @@ -196,12 +191,8 @@ list_print_checkpoint(WT_SESSION *session, const char *key) return (ret == WT_NOTFOUND ? 0 : ret); /* We need the allocation size for decoding the checkpoint addr */ - if ((ret = list_get_allocsize(session, key, &allocsize)) != 0) { - if (ret == WT_NOTFOUND) - allocsize = 0; - else - return (ret); - } + if ((ret = list_get_allocsize(session, key, &allocsize)) != 0) + return (ret); /* Find the longest name, so we can pretty-print. */ len = 0; @@ -214,8 +205,7 @@ list_print_checkpoint(WT_SESSION *session, const char *key) WT_CKPT_FOREACH(ckptbase, ckpt) { if (allocsize != 0 && (ret = __wt_block_ckpt_decode( session, allocsize, ckpt->raw.data, &ci)) != 0) { - fprintf(stderr, "%s: __wt_block_buffer_to_ckpt: %s\n", - progname, session->strerror(session, ret)); + (void)util_err(session, ret, "__wt_block_ckpt_decode"); /* continue if damaged */ ci.root_size = 0; } diff --git a/src/third_party/wiredtiger/src/utilities/util_misc.c b/src/third_party/wiredtiger/src/utilities/util_misc.c index 3c4e8d2dfa1..0905bfa97be 100644 --- a/src/third_party/wiredtiger/src/utilities/util_misc.c +++ b/src/third_party/wiredtiger/src/utilities/util_misc.c @@ -141,11 +141,14 @@ util_flush(WT_SESSION *session, const char *uri) return (util_err(session, errno, NULL)); (void)snprintf(buf, len, "target=(\"%s\")", uri); - if ((ret = session->checkpoint(session, buf)) != 0) { - ret = util_err(session, ret, "%s: session.checkpoint", uri); - (void)session->drop(session, uri, NULL); - } - + ret = session->checkpoint(session, buf); free(buf); - return (ret); + + if (ret == 0) + return (0); + + (void)util_err(session, ret, "%s: session.checkpoint", uri); + if ((ret = session->drop(session, uri, NULL)) != 0) + (void)util_err(session, ret, "%s: session.drop", uri); + return (1); } diff --git a/src/third_party/wiredtiger/test/csuite/Makefile.am b/src/third_party/wiredtiger/test/csuite/Makefile.am index f842bc1316f..097468f0e85 100644 --- a/src/third_party/wiredtiger/test/csuite/Makefile.am +++ b/src/third_party/wiredtiger/test/csuite/Makefile.am @@ -1,5 +1,6 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)/src/include \ - -I$(top_srcdir)/test/utility + -I$(top_srcdir)/test/utility \ + -DCRC_PATH="\"$(top_srcdir)/src/checksum/x86/checksum.c\"" LDADD = $(top_builddir)/test/utility/libtest_util.la \ $(top_builddir)/libwiredtiger.la AM_LDFLAGS = -static @@ -16,9 +17,21 @@ noinst_PROGRAMS += test_wt2535_insert_race test_wt2447_join_main_table_SOURCES = wt2447_join_main_table/main.c noinst_PROGRAMS += test_wt2447_join_main_table +test_wt2695_checksum_SOURCES = wt2695_checksum/main.c wt2695_checksum/sw.c +noinst_PROGRAMS += test_wt2695_checksum + test_wt2592_join_schema_SOURCES = wt2592_join_schema/main.c noinst_PROGRAMS += test_wt2592_join_schema +test_wt2719_reconfig_SOURCES = wt2719_reconfig/main.c +noinst_PROGRAMS += test_wt2719_reconfig + +test_wt2834_join_bloom_fix_SOURCES = wt2834_join_bloom_fix/main.c +noinst_PROGRAMS += test_wt2834_join_bloom_fix + +test_wt2853_perf_SOURCES = wt2853_perf/main.c +noinst_PROGRAMS += test_wt2853_perf + # Run this during a "make check" smoke test. TESTS = $(noinst_PROGRAMS) LOG_COMPILER = $(TEST_WRAPPER) diff --git a/src/third_party/wiredtiger/test/csuite/wt1965_col_efficiency/main.c b/src/third_party/wiredtiger/test/csuite/wt1965_col_efficiency/main.c index 2882ce9cdf5..0dc367c0611 100644 --- a/src/third_party/wiredtiger/test/csuite/wt1965_col_efficiency/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt1965_col_efficiency/main.c @@ -181,6 +181,5 @@ main(int argc, char *argv[]) testutil_assert(ret == WT_NOTFOUND); testutil_cleanup(opts); - - return (0); + return (EXIT_SUCCESS); } diff --git a/src/third_party/wiredtiger/test/csuite/wt2246_col_append/main.c b/src/third_party/wiredtiger/test/csuite/wt2246_col_append/main.c index 798970cbb6d..69683707d16 100644 --- a/src/third_party/wiredtiger/test/csuite/wt2246_col_append/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt2246_col_append/main.c @@ -152,7 +152,5 @@ main(int argc, char *argv[]) (ce - cs) / (double)CLOCKS_PER_SEC); testutil_cleanup(opts); - /* NOTREACHED */ - - return (0); + return (EXIT_SUCCESS); } diff --git a/src/third_party/wiredtiger/test/csuite/wt2447_join_main_table/main.c b/src/third_party/wiredtiger/test/csuite/wt2447_join_main_table/main.c index a6f19cb0858..bbae61e7ed5 100644 --- a/src/third_party/wiredtiger/test/csuite/wt2447_join_main_table/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt2447_join_main_table/main.c @@ -184,6 +184,5 @@ main(int argc, char *argv[]) testutil_assert(maincount == 2); testutil_cleanup(opts); - - return (0); + return (EXIT_SUCCESS); } diff --git a/src/third_party/wiredtiger/test/csuite/wt2695_checksum/main.c b/src/third_party/wiredtiger/test/csuite/wt2695_checksum/main.c new file mode 100644 index 00000000000..dc6f5b5cd87 --- /dev/null +++ b/src/third_party/wiredtiger/test/csuite/wt2695_checksum/main.c @@ -0,0 +1,136 @@ +/*- + * Public Domain 2014-2016 MongoDB, Inc. + * Public Domain 2008-2014 WiredTiger, Inc. + * + * This is free and unencumbered software released into the public domain. + * + * Anyone is free to copy, modify, publish, use, compile, sell, or + * distribute this software, either in source code form or as a compiled + * binary, for any purpose, commercial or non-commercial, and by any + * means. + * + * In jurisdictions that recognize copyright laws, the author or authors + * of this software dedicate any and all copyright interest in the + * software to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * software under copyright law. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +#include "test_util.h" + +/* + * JIRA ticket reference: WT-2695 + * Test case description: Smoke-test the CRC. + */ + +void (*custom_die)(void) = NULL; + +uint32_t cksum_sw(const void *, size_t); + +static inline void +check(uint32_t hw, uint32_t sw, size_t len, const char *msg) +{ + testutil_checkfmt(hw == sw ? 0 : 1, + "%s checksum mismatch of %" WT_SIZET_FMT " bytes: %#08x != %#08x\n", + msg, len, hw, sw); +} + +#define DATASIZE (128 * 1024) +int +main(void) +{ + WT_RAND_STATE rnd; + size_t len; + uint32_t hw, sw; + u_int i, j; + uint8_t *data; + + /* Allocate aligned memory for the data. */ + data = dcalloc(DATASIZE, sizeof(uint8_t)); + + /* Initialize the RNG. */ + testutil_check(__wt_random_init_seed(NULL, &rnd)); + + /* Initialize the WiredTiger library checksum functions. */ + __wt_cksum_init(); + + /* + * Some simple known checksums. + */ + len = 1; + hw = __wt_cksum(data, len); + check(hw, (uint32_t)0x527d5351, len, "nul x1: hardware"); + sw = cksum_sw(data, len); + check(sw, (uint32_t)0x527d5351, len, "nul x1: software"); + + len = 2; + hw = __wt_cksum(data, len); + check(hw, (uint32_t)0xf16177d2, len, "nul x2: hardware"); + sw = cksum_sw(data, len); + check(sw, (uint32_t)0xf16177d2, len, "nul x2: software"); + + len = 3; + hw = __wt_cksum(data, len); + check(hw, (uint32_t)0x6064a37a, len, "nul x3: hardware"); + sw = cksum_sw(data, len); + check(sw, (uint32_t)0x6064a37a, len, "nul x3: software"); + + len = 4; + hw = __wt_cksum(data, len); + check(hw, (uint32_t)0x48674bc7, len, "nul x4: hardware"); + sw = cksum_sw(data, len); + check(sw, (uint32_t)0x48674bc7, len, "nul x4: software"); + + len = strlen("123456789"); + memcpy(data, "123456789", len); + hw = __wt_cksum(data, len); + check(hw, (uint32_t)0xe3069283, len, "known string #1: hardware"); + sw = cksum_sw(data, len); + check(sw, (uint32_t)0xe3069283, len, "known string #1: software"); + + len = strlen("The quick brown fox jumps over the lazy dog"); + memcpy(data, "The quick brown fox jumps over the lazy dog", len); + hw = __wt_cksum(data, len); + check(hw, (uint32_t)0x22620404, len, "known string #2: hardware"); + sw = cksum_sw(data, len); + check(sw, (uint32_t)0x22620404, len, "known string #2: software"); + + /* + * Checksums of power-of-two data chunks. + */ + for (i = 0, len = 512; i < 1000; ++i) { + for (j = 0; j < len; ++j) + data[j] = __wt_random(&rnd) & 0xff; + hw = __wt_cksum(data, len); + sw = cksum_sw(data, len); + check(hw, sw, len, "random power-of-two"); + + len *= 2; + if (len > DATASIZE) + len = 512; + } + + /* + * Checksums of random data chunks. + */ + for (i = 0; i < 1000; ++i) { + len = __wt_random(&rnd) % DATASIZE; + for (j = 0; j < len; ++j) + data[j] = __wt_random(&rnd) & 0xff; + hw = __wt_cksum(data, len); + sw = cksum_sw(data, len); + check(hw, sw, len, "random"); + } + + free(data); + return (EXIT_SUCCESS); +} diff --git a/src/third_party/wiredtiger/test/csuite/wt2695_checksum/sw.c b/src/third_party/wiredtiger/test/csuite/wt2695_checksum/sw.c new file mode 100644 index 00000000000..892d9480bf3 --- /dev/null +++ b/src/third_party/wiredtiger/test/csuite/wt2695_checksum/sw.c @@ -0,0 +1,49 @@ +/*- + * Public Domain 2014-2016 MongoDB, Inc. + * Public Domain 2008-2014 WiredTiger, Inc. + * + * This is free and unencumbered software released into the public domain. + * + * Anyone is free to copy, modify, publish, use, compile, sell, or + * distribute this software, either in source code form or as a compiled + * binary, for any purpose, commercial or non-commercial, and by any + * means. + * + * In jurisdictions that recognize copyright laws, the author or authors + * of this software dedicate any and all copyright interest in the + * software to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * software under copyright law. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +#include "test_util.h" + +/* + * Build the software version of the CRC code. + */ +#define __wt_cksum __wt_cksum_notused +uint32_t __wt_cksum_notused(const void *, size_t); +#define __wt_cksum_init __wt_cksum_init_notused +void __wt_cksum_init_notused(void); + +#include CRC_PATH + +/* + * cksum_sw -- + * Checksum in software. + */ +uint32_t cksum_sw(const void *, size_t); +uint32_t +cksum_sw(const void *chunk, size_t len) +{ + return (__wt_cksum_sw(chunk, len)); +} diff --git a/src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c b/src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c new file mode 100644 index 00000000000..4ec213c85ea --- /dev/null +++ b/src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c @@ -0,0 +1,283 @@ +/*- + * Public Domain 2014-2016 MongoDB, Inc. + * Public Domain 2008-2014 WiredTiger, Inc. + * + * This is free and unencumbered software released into the public domain. + * + * Anyone is free to copy, modify, publish, use, compile, sell, or + * distribute this software, either in source code form or as a compiled + * binary, for any purpose, commercial or non-commercial, and by any + * means. + * + * In jurisdictions that recognize copyright laws, the author or authors + * of this software dedicate any and all copyright interest in the + * software to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * software under copyright law. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +#include "test_util.h" + +/* + * JIRA ticket reference: WT-2719 + * Test case description: Fuzz testing for WiredTiger reconfiguration. + */ + +void (*custom_die)(void) = NULL; + +static const char *list[] = { + ",async=(enabled=0)", + ",async=(enabled=1)", + ",async=(ops_max=2048)", + ",async=(ops_max=2348)", + ",async=(ops_max=1790)", + ",async=(threads=10)", + ",async=(threads=7)", + ",async=(threads=17)", + + ",cache_overhead=13", + ",cache_overhead=27", + ",cache_overhead=8", + + ",cache_size=75MB", + ",cache_size=214MB", + ",cache_size=37MB", + + ",checkpoint=(log_size=104857600)", /* 100MB */ + ",checkpoint=(log_size=1073741824)", /* 1GB */ + ",checkpoint=(log_size=2)", + ",checkpoint=(log_size=0)", + ",checkpoint=(wait=100)", + ",checkpoint=(wait=10000)", + ",checkpoint=(wait=2)", + ",checkpoint=(wait=0)", + + ",error_prefix=\"prefix\"", + + ",eviction=(threads_min=7,threads_max=10)", + ",eviction=(threads_min=17,threads_max=18)", + ",eviction=(threads_min=3,threads_max=7)", + ",eviction=(threads_max=12,threads_min=10)", + ",eviction=(threads_max=18,threads_min=16)", + ",eviction=(threads_max=10,threads_min=9)", + + ",eviction_dirty_target=45", + ",eviction_dirty_target=87", + ",eviction_dirty_target=8", + + ",eviction_dirty_trigger=37", + ",eviction_dirty_trigger=98", + ",eviction_dirty_trigger=7", + + ",eviction_target=22", + ",eviction_target=84", + ",eviction_target=30", + + ",eviction_trigger=75", + ",eviction_trigger=95", + ",eviction_trigger=66", + + ",file_manager=(close_handle_minimum=200)", + ",file_manager=(close_handle_minimum=137)", + ",file_manager=(close_handle_minimum=226)", + ",file_manager=(close_idle_time=10000)", + ",file_manager=(close_idle_time=12000)", + ",file_manager=(close_idle_time=7)", + ",file_manager=(close_idle_time=0)", + ",file_manager=(close_scan_interval=50000)", + ",file_manager=(close_scan_interval=59000)", + ",file_manager=(close_scan_interval=3)", + + ",log=(archive=0)", + ",log=(archive=1)", + ",log=(prealloc=0)", + ",log=(prealloc=1)", + ",log=(zero_fill=0)", + ",log=(zero_fill=1)", + + ",lsm_manager=(merge=0)", + ",lsm_manager=(merge=1)", + ",lsm_manager=(worker_thread_max=5)", + ",lsm_manager=(worker_thread_max=18)", + ",lsm_manager=(worker_thread_max=3)", + + ",shared_cache=(chunk=20MB)", + ",shared_cache=(chunk=30MB)", + ",shared_cache=(chunk=5MB)", + ",shared_cache=(name=\"shared\")", + ",shared_cache=(name=\"none\")", + ",shared_cache=(quota=20MB)", + ",shared_cache=(quota=30MB)", + ",shared_cache=(quota=5MB)", + ",shared_cache=(quota=0)", + ",shared_cache=(reserve=20MB)", + ",shared_cache=(reserve=30MB)", + ",shared_cache=(reserve=5MB)", + ",shared_cache=(reserve=0)", + ",shared_cache=(size=100MB)", + ",shared_cache=(size=1GB)", + ",shared_cache=(size=75MB)", + + ",statistics=(\"all\")", + ",statistics=(\"fast\")", + ",statistics=(\"none\")", + ",statistics=(\"clear\")", + + ",statistics_log=(json=0)", + ",statistics_log=(json=1)", + ",statistics_log=(on_close=0)", + ",statistics_log=(on_close=1)", + ",statistics_log=(sources=(\"file:\"))", + ",statistics_log=(sources=())", + ",statistics_log=(timestamp=\"%b:%S\")", + ",statistics_log=(timestamp=\"%H:%M\")", + ",statistics_log=(wait=60)", + ",statistics_log=(wait=76)", + ",statistics_log=(wait=37)", + ",statistics_log=(wait=0)", + +#ifdef HAVE_VERBOSE + ",verbose=(\"api\")", + ",verbose=(\"block\")", + ",verbose=(\"checkpoint\")", + ",verbose=(\"compact\")", + ",verbose=(\"evict\")", + ",verbose=(\"evictserver\")", + ",verbose=(\"fileops\")", + ",verbose=(\"handleops\")", + ",verbose=(\"log\")", + ",verbose=(\"lsm\")", + ",verbose=(\"lsm_manager\")", + ",verbose=(\"metadata\")", + ",verbose=(\"mutex\")", + ",verbose=(\"overflow\")", + ",verbose=(\"read\")", + ",verbose=(\"rebalance\")", + ",verbose=(\"reconcile\")", + ",verbose=(\"recovery\")", + ",verbose=(\"salvage\")", + ",verbose=(\"shared_cache\")", + ",verbose=(\"split\")", + ",verbose=(\"temporary\")", + ",verbose=(\"transaction\")", + ",verbose=(\"verify\")", + ",verbose=(\"version\")", + ",verbose=(\"write\")", + ",verbose=()" +#endif +}; + +static int +handle_message(WT_EVENT_HANDLER *handler, + WT_SESSION *session, const char *message) +{ + (void)(handler); + (void)(session); + (void)(message); + + /* We configure verbose output, so just ignore. */ + return (0); +} + +static WT_EVENT_HANDLER event_handler = { NULL, handle_message, NULL, NULL }; + +int +main(int argc, char *argv[]) +{ + enum { CACHE_SHARED, CACHE_SET, CACHE_NONE } cache; + TEST_OPTS *opts, _opts; + WT_RAND_STATE rnd; + WT_SESSION *session; + size_t len; + u_int i, j; + int ret; + const char *p; + char *config; + + opts = &_opts; + memset(opts, 0, sizeof(*opts)); + opts->table_type = TABLE_ROW; + testutil_check(testutil_parse_opts(argc, argv, opts)); + testutil_make_work_dir(opts->home); + + testutil_check( + wiredtiger_open(opts->home, &event_handler, "create", &opts->conn)); + + /* Open an LSM file so the LSM reconfiguration options make sense. */ + testutil_check( + opts->conn->open_session(opts->conn, NULL, NULL, &session)); + testutil_check(session->create( + session, opts->uri, "type=lsm,key_format=S,value_format=S")); + + /* Initialize the RNG. */ + testutil_check(__wt_random_init_seed(NULL, &rnd)); + + /* Allocate memory for the config. */ + len = WT_ELEMENTS(list) * 64; + config = dmalloc(len); + + /* A linear pass through the list. */ + for (i = 0; i < WT_ELEMENTS(list); ++i) + if ((ret = opts->conn->reconfigure(opts->conn, list[i])) != 0) { + fprintf(stderr, "%s: %s\n", + list[i], session->strerror(session, ret)); + return (EXIT_FAILURE); + } + + /* + * A linear pass through the list, adding random elements. + * + * WiredTiger configurations are usually "the last one set wins", but + * "shared_cache" and "cache_set" options aren't allowed in the same + * configuration string. + */ + for (i = 0; i < WT_ELEMENTS(list); ++i) { + p = list[i]; + cache = CACHE_NONE; + if (WT_PREFIX_MATCH(p, ",shared_cache")) + cache = CACHE_SHARED; + else if (WT_PREFIX_MATCH(p, ",cache_size")) + cache = CACHE_SET; + strcpy(config, p); + + for (j = + (__wt_random(&rnd) % WT_ELEMENTS(list)) + 1; j > 0; --j) { + p = list[__wt_random(&rnd) % WT_ELEMENTS(list)]; + if (WT_PREFIX_MATCH(p, ",shared_cache")) { + if (cache == CACHE_SET) + continue; + cache = CACHE_SHARED; + } else if (WT_PREFIX_MATCH(p, ",cache_size")) { + if (cache == CACHE_SHARED) + continue; + cache = CACHE_SET; + } + strcat(config, p); + } + if ((ret = opts->conn->reconfigure(opts->conn, config)) != 0) { + fprintf(stderr, "%s: %s\n", + config, session->strerror(session, ret)); + return (EXIT_FAILURE); + } + } + + /* + * Turn on-close statistics off, if on-close is on and statistics were + * randomly turned off during the run, close would fail. + */ + testutil_check(opts->conn->reconfigure( + opts->conn, "statistics_log=(on_close=0)")); + + free(config); + testutil_cleanup(opts); + return (EXIT_SUCCESS); +} diff --git a/src/third_party/wiredtiger/test/csuite/wt2834_join_bloom_fix/main.c b/src/third_party/wiredtiger/test/csuite/wt2834_join_bloom_fix/main.c new file mode 100644 index 00000000000..1e2d919d3c7 --- /dev/null +++ b/src/third_party/wiredtiger/test/csuite/wt2834_join_bloom_fix/main.c @@ -0,0 +1,199 @@ +/*- + * Public Domain 2014-2016 MongoDB, Inc. + * Public Domain 2008-2014 WiredTiger, Inc. + * + * This is free and unencumbered software released into the public domain. + * + * Anyone is free to copy, modify, publish, use, compile, sell, or + * distribute this software, either in source code form or as a compiled + * binary, for any purpose, commercial or non-commercial, and by any + * means. + * + * In jurisdictions that recognize copyright laws, the author or authors + * of this software dedicate any and all copyright interest in the + * software to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * software under copyright law. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +#include "test_util.h" + +/* + * JIRA ticket reference: WT-2834 + * Test case description: We are creating bank 'account' records, each + * having a postal_code, balance, and an 'overdrawn' flag. We insert + * records with various balances, and only set the overdrawn flag when the + * balance is negative. Then we set up a join to simulate this: + * + * select (*) from account where account.postal_code = '54321' and + * account.balance < 0 and not account.overdrawn + * + * Failure mode: We get results back from our join. + */ +void (*custom_die)(void) = NULL; + +#define N_RECORDS 100000 +#define N_INSERT 1000000 + +void populate(TEST_OPTS *opts); + +int +main(int argc, char *argv[]) +{ + TEST_OPTS *opts, _opts; + WT_CURSOR *maincur; + WT_CURSOR *postcur, *balancecur, *flagcur, *joincur; + WT_SESSION *session; + int balance, count, flag, key, key2, post, ret; + char cfg[128]; + const char *tablename; + char posturi[256]; + char balanceuri[256]; + char flaguri[256]; + char joinuri[256]; + + opts = &_opts; + memset(opts, 0, sizeof(*opts)); + + testutil_check(testutil_parse_opts(argc, argv, opts)); + testutil_make_work_dir(opts->home); + + testutil_check(wiredtiger_open(opts->home, NULL, + "create,cache_size=250M", &opts->conn)); + testutil_check( + opts->conn->open_session(opts->conn, NULL, NULL, &session)); + /* + * Note: repeated primary key 'id' as 'id2'. This makes + * it easier to dump an index and know which record we're + * looking at. + */ + testutil_check(session->create(session, opts->uri, + "key_format=i,value_format=iiii," + "columns=(id,post,balance,flag,id2)")); + + tablename = strchr(opts->uri, ':'); + testutil_assert(tablename != NULL); + tablename++; + snprintf(posturi, sizeof(posturi), "index:%s:post", tablename); + snprintf(balanceuri, sizeof(balanceuri), "index:%s:balance", tablename); + snprintf(flaguri, sizeof(flaguri), "index:%s:flag", tablename); + snprintf(joinuri, sizeof(joinuri), "join:%s", opts->uri); + + testutil_check(session->create(session, posturi, "columns=(post)")); + testutil_check(session->create(session, balanceuri, + "columns=(balance)")); + testutil_check(session->create(session, flaguri, "columns=(flag)")); + + /* + * Insert a single record with all items we are search for, + * this makes our logic easier. + */ + testutil_check(session->open_cursor(session, opts->uri, NULL, NULL, + &maincur)); + maincur->set_key(maincur, N_RECORDS); + maincur->set_value(maincur, 54321, 0, "", 0, N_RECORDS); + maincur->insert(maincur); + maincur->close(maincur); + testutil_check(session->close(session, NULL)); + + populate(opts); + + testutil_check(opts->conn->open_session( + opts->conn, NULL, NULL, &session)); + + testutil_check(session->open_cursor(session, + posturi, NULL, NULL, &postcur)); + testutil_check(session->open_cursor(session, + balanceuri, NULL, NULL, &balancecur)); + testutil_check(session->open_cursor(session, + flaguri, NULL, NULL, &flagcur)); + testutil_check(session->open_cursor(session, + joinuri, NULL, NULL, &joincur)); + + postcur->set_key(postcur, 54321); + testutil_check(postcur->search(postcur)); + testutil_check(session->join(session, joincur, postcur, + "compare=eq")); + + balancecur->set_key(balancecur, 0); + testutil_check(balancecur->search(balancecur)); + sprintf(cfg, "compare=lt,strategy=bloom,count=%d", + N_RECORDS / 100); + testutil_check(session->join(session, joincur, balancecur, cfg)); + + flagcur->set_key(flagcur, 0); + testutil_check(flagcur->search(flagcur)); + sprintf(cfg, "compare=eq,strategy=bloom,count=%d", + N_RECORDS / 100); + testutil_check(session->join(session, joincur, flagcur, cfg)); + + /* Expect no values returned */ + count = 0; + while ((ret = joincur->next(joincur)) == 0) { + /* + * The values may already have been changed, but + * print them for informational purposes. + */ + testutil_check(joincur->get_key(joincur, &key)); + testutil_check(joincur->get_value(joincur, &post, + &balance, &flag, &key2)); + fprintf(stderr, "FAIL: " + "key=%d/%d, postal_code=%d, balance=%d, flag=%d\n", + key, key2, post, balance, flag); + count++; + } + testutil_assert(count == 0); + + testutil_cleanup(opts); + /* NOTREACHED */ + + return (0); +} + +void populate(TEST_OPTS *opts) +{ + WT_CURSOR *maincur; + WT_SESSION *session; + uint32_t key; + int balance, i, flag, post; + WT_RAND_STATE rnd; + + testutil_check(__wt_random_init_seed(NULL, &rnd)); + + testutil_check(opts->conn->open_session( + opts->conn, NULL, NULL, &session)); + + testutil_check(session->open_cursor(session, opts->uri, NULL, NULL, + &maincur)); + + for (i = 0; i < N_INSERT; i++) { + testutil_check(session->begin_transaction(session, NULL)); + key = (__wt_random(&rnd) % (N_RECORDS)); + maincur->set_key(maincur, key); + if (__wt_random(&rnd) % 11 == 0) + post = 54321; + else + post = i % 100000; + if (__wt_random(&rnd) % 4 == 0) { + balance = -100; + flag = 1; + } else { + balance = 100 * (i + 1); + flag = 0; + } + maincur->set_value(maincur, post, balance, flag, key); + testutil_check(maincur->insert(maincur)); + testutil_check(session->commit_transaction(session, NULL)); + } + maincur->close(maincur); + session->close(session, NULL); +} diff --git a/src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c b/src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c new file mode 100644 index 00000000000..c57d5ba056c --- /dev/null +++ b/src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c @@ -0,0 +1,325 @@ +/*- + * Public Domain 2014-2016 MongoDB, Inc. + * Public Domain 2008-2014 WiredTiger, Inc. + * + * This is free and unencumbered software released into the public domain. + * + * Anyone is free to copy, modify, publish, use, compile, sell, or + * distribute this software, either in source code form or as a compiled + * binary, for any purpose, commercial or non-commercial, and by any + * means. + * + * In jurisdictions that recognize copyright laws, the author or authors + * of this software dedicate any and all copyright interest in the + * software to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * software under copyright law. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +#include "test_util.h" + +/* + * JIRA ticket reference: WT-2853 + * + * Test case description: create two threads: one is populating/updating + * records in a table with a few indices, the other is reading from table and + * indices. The test is adapted from one that uses cursor joins, this test + * does not, but simulates some of the access patterns. + * + * Failure mode: after a second or two of progress by both threads, they both + * appear to slow dramatically, almost locking up. After some time (I've + * observed from a half minute to a few minutes), the lock up ends and both + * threads seem to be inserting and reading at a normal fast pace. That + * continues until the test ends (~30 seconds). + */ + +void (*custom_die)(void) = NULL; + +static void *thread_insert(void *); +static void *thread_get(void *); + +#define BLOOM false +#define N_RECORDS 10000 +#define N_INSERT 1000000 +#define N_INSERT_THREAD 1 +#define N_GET_THREAD 1 +#define S64 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789::" +#define S1024 (S64 S64 S64 S64 S64 S64 S64 S64 S64 S64 S64 S64 S64 S64 S64 S64) + +typedef struct { + char posturi[256]; + char baluri[256]; + char flaguri[256]; + bool bloom; +} SHARED_OPTS; + +typedef struct { + TEST_OPTS *testopts; + SHARED_OPTS *sharedopts; + int threadnum; + int nthread; + int done; + int njoins; + int nfail; +} THREAD_ARGS; + +int +main(int argc, char *argv[]) +{ + SHARED_OPTS *sharedopts, _sharedopts; + TEST_OPTS *opts, _opts; + THREAD_ARGS get_args[N_GET_THREAD], insert_args[N_INSERT_THREAD]; + WT_CURSOR *maincur; + WT_SESSION *session; + pthread_t get_tid[N_GET_THREAD], insert_tid[N_INSERT_THREAD]; + int i, nfail; + const char *tablename; + + opts = &_opts; + sharedopts = &_sharedopts; + memset(opts, 0, sizeof(*opts)); + memset(sharedopts, 0, sizeof(*sharedopts)); + memset(insert_args, 0, sizeof(insert_args)); + memset(get_args, 0, sizeof(get_args)); + nfail = 0; + + sharedopts->bloom = BLOOM; + testutil_check(testutil_parse_opts(argc, argv, opts)); + testutil_make_work_dir(opts->home); + + testutil_check(wiredtiger_open(opts->home, NULL, + "create,cache_size=1G", &opts->conn)); + + testutil_check( + opts->conn->open_session(opts->conn, NULL, NULL, &session)); + + /* + * Note: id is repeated as id2. This makes it easier to + * identify the primary key in dumps of the index files. + */ + testutil_check(session->create(session, opts->uri, + "key_format=i,value_format=iiSii," + "columns=(id,post,bal,extra,flag,id2)")); + + tablename = strchr(opts->uri, ':'); + testutil_assert(tablename != NULL); + tablename++; + snprintf(sharedopts->posturi, sizeof(sharedopts->posturi), + "index:%s:post", tablename); + snprintf(sharedopts->baluri, sizeof(sharedopts->baluri), + "index:%s:bal", tablename); + snprintf(sharedopts->flaguri, sizeof(sharedopts->flaguri), + "index:%s:flag", tablename); + + testutil_check(session->create(session, sharedopts->posturi, + "columns=(post)")); + testutil_check(session->create(session, sharedopts->baluri, + "columns=(bal)")); + testutil_check(session->create(session, sharedopts->flaguri, + "columns=(flag)")); + + /* + * Insert a single record with all items we need to + * call search() on, this makes our join logic easier. + */ + testutil_check(session->open_cursor(session, opts->uri, NULL, NULL, + &maincur)); + maincur->set_key(maincur, N_RECORDS); + maincur->set_value(maincur, 54321, 0, "", 0, N_RECORDS); + testutil_check(maincur->insert(maincur)); + testutil_check(maincur->close(maincur)); + testutil_check(session->close(session, NULL)); + + for (i = 0; i < N_INSERT_THREAD; ++i) { + insert_args[i].threadnum = i; + insert_args[i].nthread = N_INSERT_THREAD; + insert_args[i].testopts = opts; + insert_args[i].sharedopts = sharedopts; + testutil_check(pthread_create(&insert_tid[i], NULL, + thread_insert, (void *)&insert_args[i])); + } + + for (i = 0; i < N_GET_THREAD; ++i) { + get_args[i].threadnum = i; + get_args[i].nthread = N_GET_THREAD; + get_args[i].testopts = opts; + get_args[i].sharedopts = sharedopts; + testutil_check(pthread_create(&get_tid[i], NULL, + thread_get, (void *)&get_args[i])); + } + + /* + * Wait for insert threads to finish. When they + * are done, signal get threads to complete. + */ + for (i = 0; i < N_INSERT_THREAD; ++i) + testutil_check(pthread_join(insert_tid[i], NULL)); + + for (i = 0; i < N_GET_THREAD; ++i) + get_args[i].done = 1; + + for (i = 0; i < N_GET_THREAD; ++i) + testutil_check(pthread_join(get_tid[i], NULL)); + + fprintf(stderr, "\n"); + for (i = 0; i < N_GET_THREAD; ++i) { + fprintf(stderr, " thread %d did %d joins (%d fails)\n", i, + get_args[i].njoins, get_args[i].nfail); + nfail += get_args[i].nfail; + } + + testutil_assert(nfail == 0); + testutil_cleanup(opts); + + return (0); +} + +static void *thread_insert(void *arg) +{ + TEST_OPTS *opts; + THREAD_ARGS *threadargs; + WT_CURSOR *maincur; + WT_RAND_STATE rnd; + WT_SESSION *session; + double elapsed; + time_t prevtime, curtime; /* 1 second resolution is okay */ + int bal, i, flag, key, post; + const char *extra = S1024; + + threadargs = (THREAD_ARGS *)arg; + opts = threadargs->testopts; + testutil_check(__wt_random_init_seed(NULL, &rnd)); + (void)time(&prevtime); + + testutil_check(opts->conn->open_session( + opts->conn, NULL, NULL, &session)); + + testutil_check(session->open_cursor(session, opts->uri, NULL, NULL, + &maincur)); + + for (i = 0; i < N_INSERT; i++) { + /* + * Insert threads may stomp on each other's records; + * that's okay. + */ + key = (int)(__wt_random(&rnd) % N_RECORDS); + testutil_check(session->begin_transaction(session, NULL)); + maincur->set_key(maincur, key); + if (__wt_random(&rnd) % 2 == 0) + post = 54321; + else + post = i % 100000; + if (__wt_random(&rnd) % 2 == 0) { + bal = -100; + flag = 1; + } else { + bal = 100 * (i + 1); + flag = 0; + } + maincur->set_value(maincur, post, bal, extra, flag, key); + testutil_check(maincur->insert(maincur)); + testutil_check(maincur->reset(maincur)); + testutil_check(session->commit_transaction(session, NULL)); + if (i % 1000 == 0 && i != 0) { + if (i % 10000 == 0) + fprintf(stderr, "*"); + else + fprintf(stderr, "."); + (void)time(&curtime); + if ((elapsed = difftime(curtime, prevtime)) > 5.0) { + fprintf(stderr, "\n" + "GAP: %.0f secs after %d inserts\n", + elapsed, i); + threadargs->nfail++; + } + prevtime = curtime; + } + } + testutil_check(maincur->close(maincur)); + testutil_check(session->close(session, NULL)); + return (NULL); +} + +static void *thread_get(void *arg) +{ + SHARED_OPTS *sharedopts; + TEST_OPTS *opts; + THREAD_ARGS *threadargs; + WT_CURSOR *maincur, *postcur; + WT_SESSION *session; + double elapsed; + time_t prevtime, curtime; /* 1 second resolution is okay */ + int bal, flag, key, key2, post, bal2, flag2, post2; + char *extra; + + threadargs = (THREAD_ARGS *)arg; + opts = threadargs->testopts; + sharedopts = threadargs->sharedopts; + (void)time(&prevtime); + + testutil_check(opts->conn->open_session( + opts->conn, NULL, NULL, &session)); + testutil_check(session->open_cursor(session, opts->uri, NULL, NULL, + &maincur)); + + testutil_check(session->open_cursor( + session, sharedopts->posturi, NULL, NULL, &postcur)); + + for (threadargs->njoins = 0; threadargs->done == 0; + threadargs->njoins++) { + testutil_check(session->begin_transaction(session, NULL)); + postcur->set_key(postcur, 54321); + testutil_check(postcur->search(postcur)); + while (postcur->next(postcur) == 0) { + testutil_check(postcur->get_key(postcur, &post)); + testutil_check(postcur->get_value(postcur, &post2, + &bal, &extra, &flag, &key)); + testutil_assert(post == post2); + if (post != 54321) + break; + + maincur->set_key(maincur, key); + testutil_check(maincur->search(maincur)); + testutil_check(maincur->get_value(maincur, &post2, + &bal2, &extra, &flag2, &key2)); + testutil_check(maincur->reset(maincur)); + testutil_assert(key == key2); + testutil_assert(post == post2); + testutil_assert(bal == bal2); + testutil_assert(flag == flag2); + + testutil_assert((flag2 > 0 && bal2 < 0) || + (flag2 == 0 && bal2 >= 0)); + } + /* + * Reset the cursors, potentially allowing the insert + * threads to proceed. + */ + testutil_check(postcur->reset(postcur)); + if (threadargs->njoins % 100 == 0) + fprintf(stderr, "G"); + testutil_check(session->rollback_transaction(session, NULL)); + + (void)time(&curtime); + if ((elapsed = difftime(curtime, prevtime)) > 5.0) { + fprintf(stderr, "\n" + "GAP: %.0f secs after %d gets\n", + elapsed, threadargs->njoins); + threadargs->nfail++; + } + prevtime = curtime; + } + testutil_check(postcur->close(postcur)); + testutil_check(maincur->close(maincur)); + testutil_check(session->close(session, NULL)); + return (NULL); +} diff --git a/src/third_party/wiredtiger/test/format/bdb.c b/src/third_party/wiredtiger/test/format/bdb.c index e56281f2c3e..8b61573fdf9 100644 --- a/src/third_party/wiredtiger/test/format/bdb.c +++ b/src/third_party/wiredtiger/test/format/bdb.c @@ -186,6 +186,7 @@ bdb_remove(uint64_t keyno, int *notfoundp) size_t size; int ret; + size = 0; key_gen(&keyitem, keyno); key.data = (void *)keyitem.data; key.size = (u_int32_t)keyitem.size; diff --git a/src/third_party/wiredtiger/test/format/format.h b/src/third_party/wiredtiger/test/format/format.h index ad5f408ac30..ece30601cf0 100644 --- a/src/third_party/wiredtiger/test/format/format.h +++ b/src/third_party/wiredtiger/test/format/format.h @@ -29,6 +29,13 @@ #include "test_util.h" #ifdef BDB +/* + * Berkeley DB has an #ifdef we need to provide a value for, we'll see an + * undefined error if it's unset during a strict compile. + */ +#ifndef DB_DBM_HSEARCH +#define DB_DBM_HSEARCH 0 +#endif #include <assert.h> #include <db.h> #endif @@ -69,12 +76,6 @@ #define FORMAT_OPERATION_REPS 3 /* 3 thread operations sets */ -#ifndef _WIN32 -#define SIZET_FMT "%zu" /* size_t format string */ -#else -#define SIZET_FMT "%Iu" /* size_t format string */ -#endif - typedef struct { char *progname; /* Program name */ diff --git a/src/third_party/wiredtiger/test/format/salvage.c b/src/third_party/wiredtiger/test/format/salvage.c index 8274c556364..69805fb1018 100644 --- a/src/third_party/wiredtiger/test/format/salvage.c +++ b/src/third_party/wiredtiger/test/format/salvage.c @@ -107,7 +107,7 @@ found: if (fstat(fd, &sb) == -1) if ((fp = fopen(buf, "w")) == NULL) testutil_die(errno, "salvage-corrupt: open: %s", buf); (void)fprintf(fp, - "salvage-corrupt: offset %" PRIuMAX ", length " SIZET_FMT "\n", + "salvage-corrupt: offset %" PRIuMAX ", length %" WT_SIZET_FMT "\n", (uintmax_t)offset, len); fclose_and_clear(&fp); diff --git a/src/third_party/wiredtiger/test/format/t.c b/src/third_party/wiredtiger/test/format/t.c index 2eb2b078804..12258af8e51 100644 --- a/src/third_party/wiredtiger/test/format/t.c +++ b/src/third_party/wiredtiger/test/format/t.c @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) { time_t start; - int ch, i, onerun, reps; + int ch, onerun, reps; const char *config, *home; config = NULL; @@ -114,14 +114,8 @@ main(int argc, char *argv[]) argc -= __wt_optind; argv += __wt_optind; - /* - * Initialize the global RNG. Start with the standard seeds, and then - * use seconds since the Epoch modulo a prime to run the RNG for some - * number of steps, so we don't start with the same values every time. - */ - __wt_random_init(&g.rnd); - for (i = (int)time(NULL) % 10007; i > 0; --i) - (void)__wt_random(&g.rnd); + /* Initialize the global RNG. */ + testutil_check(__wt_random_init_seed(NULL, &g.rnd)); /* Set up paths. */ path_setup(home); diff --git a/src/third_party/wiredtiger/test/format/wts.c b/src/third_party/wiredtiger/test/format/wts.c index 69195abc3d4..9acca409d6e 100644 --- a/src/third_party/wiredtiger/test/format/wts.c +++ b/src/third_party/wiredtiger/test/format/wts.c @@ -154,6 +154,11 @@ wts_open(const char *home, bool set_api, WT_CONNECTION **connp) ",lsm_manager=(worker_thread_max=%" PRIu32 "),", g.c_lsm_worker_threads); + if (DATASOURCE("lsm") || g.c_cache < 20) { + p += snprintf(p, REMAIN(p, end), + ",eviction_dirty_target=80,eviction_dirty_trigger=95"); + } + /* Eviction worker configuration. */ if (g.c_evict_max != 0) p += snprintf(p, REMAIN(p, end), diff --git a/src/third_party/wiredtiger/test/mciproject.yml b/src/third_party/wiredtiger/test/mciproject.yml index 8825bb65052..ff58d1839cf 100644 --- a/src/third_party/wiredtiger/test/mciproject.yml +++ b/src/third_party/wiredtiger/test/mciproject.yml @@ -109,7 +109,7 @@ tasks: set -o errexit set -o verbose - scons.bat ${smp_command|} "CFLAGS=/Gv /wd4090 /wd4996 /we4047 /we4024 /TC /we4100" wiredtiger.dll libwiredtiger.lib + scons.bat ${smp_command|} "CFLAGS=/Gv /wd4090 /wd4996 /we4047 /we4024 /TC /we4100 /w4133" wiredtiger.dll libwiredtiger.lib - name: fops depends_on: diff --git a/src/third_party/wiredtiger/test/recovery/truncated-log.c b/src/third_party/wiredtiger/test/recovery/truncated-log.c index a7509c27566..c0effa85e95 100644 --- a/src/third_party/wiredtiger/test/recovery/truncated-log.c +++ b/src/third_party/wiredtiger/test/recovery/truncated-log.c @@ -45,11 +45,86 @@ static const char * const uri = "table:main"; "create,log=(file_max=100K,archive=false,enabled)," \ "transaction_sync=(enabled,method=none)" #define ENV_CONFIG_REC "log=(recover=on)" + #define LOG_FILE_1 "WiredTigerLog.0000000001" #define K_SIZE 16 #define V_SIZE 256 +/* + * Write a new log record into the log via log print, then open up a log + * cursor and walk the log to make sure we can read it. The reason for this + * test is that if there is a partial log record at the end of the previous + * log file and truncate does not exist, this tests that we can still read + * past that record. + */ +static void write_and_read_new(WT_SESSION *); +static void +write_and_read_new(WT_SESSION *session) +{ + WT_CURSOR *logc; + WT_ITEM logrec_key, logrec_value; + uint64_t txnid; + uint32_t fileid, log_file, log_offset, opcount, optype, rectype; + int ret; + bool saw_msg; + + /* + * Write a log record and force it to disk so we can read it. + */ + printf("Write log_printf record and verify.\n"); + if ((ret = session->log_printf(session, "Test Log Record")) != 0) + testutil_die(ret, "log_printf"); + if ((ret = session->log_flush(session, "sync=on")) != 0) + testutil_die(ret, "log_flush"); + if ((ret = session->open_cursor( + session, "log:", NULL, NULL, &logc)) != 0) + testutil_die(ret, "open_cursor: log"); + if ((ret = session->open_cursor( + session, "log:", NULL, NULL, &logc)) != 0) + testutil_die(ret, "open_cursor: log"); + saw_msg = false; + while ((ret = logc->next(logc)) == 0) { + /* + * We don't really need to get the key, but in case we want + * the LSN for some message, get it. + */ + if ((ret = logc->get_key(logc, + &log_file, &log_offset, &opcount)) != 0) + testutil_die(errno, "get_key"); + if ((ret = logc->get_value(logc, &txnid, &rectype, + &optype, &fileid, &logrec_key, &logrec_value)) != 0) + testutil_die(errno, "get_value"); + /* + * We should never see a record from log file 2. We wrote + * a record there, but then the record in log file 1 was + * truncated to be a partial record, ending the log there. + * So everything after that, including everything in log + * file 2, is invalid until we get to log file 3 which is where + * the post-recovery records will be written. + */ + if (log_file == 2) + testutil_die(EINVAL, "Found LSN in Log 2"); +#if 0 + printf("LSN [%" PRIu32 "][%" PRIu32 "].%" PRIu32 + ": record type %" PRIu32 " optype %" PRIu32 + " txnid %" PRIu64 " fileid %" PRIu32 "\n", + log_file, log_offset, opcount, + rectype, optype, txnid, fileid); +#endif + if (rectype == WT_LOGREC_MESSAGE) { + saw_msg = true; + printf("Application Record: %s\n", + (char *)logrec_value.data); + break; + } + } + if ((ret = logc->close(logc)) != 0) + testutil_die(ret, "log cursor close"); + if (!saw_msg) + testutil_die(EINVAL, "Did not traverse log printf record"); +} + static void usage(void) WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn)); static void @@ -127,6 +202,10 @@ fill_db(void) if ((ret = cursor->insert(cursor)) != 0) testutil_die(ret, "WT_CURSOR.insert"); + /* + * Walking the ever growing log can be slow, so only start + * looking for the cross into log file 2 after a minimum. + */ if (i > min_key) { if ((ret = session->open_cursor( session, "log:", NULL, NULL, &logc)) != 0) @@ -135,15 +214,26 @@ fill_db(void) logc->set_key(logc, save_lsn.l.file, save_lsn.l.offset, 0); if ((ret = logc->search(logc)) != 0) - testutil_die(errno, "search"); + testutil_die(ret, "search"); } while ((ret = logc->next(logc)) == 0) { if ((ret = logc->get_key(logc, &lsn.l.file, &lsn.l.offset, &unused)) != 0) - testutil_die(errno, "get_key"); + testutil_die(ret, "get_key"); + /* + * Save the LSN so that we know the offset + * of the last LSN in log file 1 later. + */ if (lsn.l.file < 2) save_lsn = lsn; else { + /* + * If this is the first time through + * that the key is larger than the + * minimum key and we're already in + * log file 2 then we did not calculate + * correctly and the test should fail. + */ if (first) testutil_die(EINVAL, "min_key too high"); @@ -155,6 +245,8 @@ fill_db(void) } } first = false; + if ((ret = logc->close(logc)) != 0) + testutil_die(ret, "log cursor close"); } } if (fclose(fp) != 0) @@ -243,7 +335,9 @@ main(int argc, char *argv[]) if (offset > UINT64_MAX - V_SIZE) testutil_die(ERANGE, "offset"); new_offset = offset + V_SIZE; - printf("Parent: Truncate to %" PRIu64 "\n", new_offset); + printf("Parent: Log file 1: Key %" PRIu32 " at %" PRIu64 "\n", + max_key, offset); + printf("Parent: Truncate mid-record to %" PRIu64 "\n", new_offset); if ((ret = truncate(LOG_FILE_1, (wt_off_t)new_offset)) != 0) testutil_die(errno, "truncate"); @@ -263,13 +357,24 @@ main(int argc, char *argv[]) count = 0; while ((ret = cursor->next(cursor)) == 0) ++count; - if ((ret = conn->close(conn, NULL)) != 0) - testutil_die(ret, "WT_CONNECTION:close"); + /* + * The max key in the saved file is the key we truncated, but the + * key space starts at 0 and we're counting the records here, so we + * expect the max key number of records. + */ if (count > max_key) { printf("expected %" PRIu32 " records found %" PRIu32 "\n", max_key, count); return (EXIT_FAILURE); } printf("%" PRIu32 " records verified\n", count); + + /* + * Write a log record and then walk the log to make sure we can + * read that log record that is beyond the truncated record. + */ + write_and_read_new(session); + if ((ret = conn->close(conn, NULL)) != 0) + testutil_die(ret, "WT_CONNECTION:close"); return (EXIT_SUCCESS); } diff --git a/src/third_party/wiredtiger/test/suite/test_config04.py b/src/third_party/wiredtiger/test/suite/test_config04.py index dffa7479f1b..204aa7e27d5 100644 --- a/src/third_party/wiredtiger/test/suite/test_config04.py +++ b/src/third_party/wiredtiger/test/suite/test_config04.py @@ -197,7 +197,7 @@ class test_config04(wttest.WiredTigerTestCase): # Test an absolute path directory. if os.name == 'posix': - logdir = '/tmp/logdir' + logdir = os.path.abspath('absolutelogdir') os.mkdir(logdir) confstr = 'path=' + logdir self.common_log_test(confstr, logdir) diff --git a/src/third_party/wiredtiger/test/suite/test_reconfig03.py b/src/third_party/wiredtiger/test/suite/test_reconfig03.py index c667a5c7d9d..e9d39ea5a76 100644 --- a/src/third_party/wiredtiger/test/suite/test_reconfig03.py +++ b/src/third_party/wiredtiger/test/suite/test_reconfig03.py @@ -54,5 +54,13 @@ class test_reconfig03(wttest.WiredTigerTestCase): time.sleep(1) self.conn.reconfigure("shared_cache=(chunk=11MB, name=bar, reserve=12MB, size=1G)") + def test_reconfig03_log_size(self): + # + # Reconfigure checkpoint based on log size. + # + self.conn.reconfigure("checkpoint=(log_size=20)") + self.conn.reconfigure("checkpoint=(log_size=1M)") + self.conn.reconfigure("checkpoint=(log_size=0)") + if __name__ == '__main__': wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_txn07.py b/src/third_party/wiredtiger/test/suite/test_txn07.py index 8dd8238343d..f9577bad7f2 100644 --- a/src/third_party/wiredtiger/test/suite/test_txn07.py +++ b/src/third_party/wiredtiger/test/suite/test_txn07.py @@ -217,6 +217,13 @@ class test_txn07(wttest.WiredTigerTestCase, suite_subprocess): # Check the state after each commit/rollback. self.check_all(current, committed) + # + # Run printlog and make sure it exits with zero status. This should be + # run as soon as we can after the crash to try and conflict with the + # journal file read. + # + + self.runWt(['-h', self.backup_dir, 'printlog'], outfilename='printlog.out') stat_cursor = self.session.open_cursor('statistics:', None, None) clen = stat_cursor[stat.conn.log_compress_len][2] @@ -239,10 +246,5 @@ class test_txn07(wttest.WiredTigerTestCase, suite_subprocess): self.assertEqual(cwrites > 0, True) self.assertEqual((cfails > 0 or csmall > 0), True) - # - # Run printlog and make sure it exits with zero status. - # - self.runWt(['-h', self.backup_dir, 'printlog'], outfilename='printlog.out') - if __name__ == '__main__': wttest.run() diff --git a/src/third_party/wiredtiger/test/thread/rw.c b/src/third_party/wiredtiger/test/thread/rw.c index 10f13b9eb04..c6107a06c49 100644 --- a/src/third_party/wiredtiger/test/thread/rw.c +++ b/src/third_party/wiredtiger/test/thread/rw.c @@ -175,8 +175,8 @@ reader_op(WT_SESSION *session, WT_CURSOR *cursor, INFO *s) if ((ret = cursor->search(cursor)) != 0 && ret != WT_NOTFOUND) testutil_die(ret, "cursor.search"); if (log_print) - (void)session->log_printf(session, - "Reader Thread %p key %017u", pthread_self(), keyno); + testutil_check(session->log_printf(session, + "Reader Thread %p key %017u", pthread_self(), keyno)); } /* @@ -276,8 +276,8 @@ writer_op(WT_SESSION *session, WT_CURSOR *cursor, INFO *s) testutil_die(ret, "cursor.update"); } if (log_print) - (void)session->log_printf(session, - "Writer Thread %p key %017u", pthread_self(), keyno); + testutil_check(session->log_printf(session, + "Writer Thread %p key %017u", pthread_self(), keyno)); } /* diff --git a/src/third_party/wiredtiger/tools/wtstats/stat_data.py b/src/third_party/wiredtiger/tools/wtstats/stat_data.py index b93f2449c63..1eb60c9d513 100644 --- a/src/third_party/wiredtiger/tools/wtstats/stat_data.py +++ b/src/third_party/wiredtiger/tools/wtstats/stat_data.py @@ -7,6 +7,7 @@ no_scale_per_second_list = [ 'cache: bytes currently in the cache', 'cache: bytes not belonging to page images in the cache', 'cache: eviction currently operating in aggressive mode', + 'cache: eviction state', 'cache: files with active eviction walks', 'cache: hazard pointer maximum array length', 'cache: maximum bytes configured', @@ -20,6 +21,8 @@ no_scale_per_second_list = [ 'cache: tracked dirty pages in the cache', 'connection: files currently open', 'data-handle: connection data handles currently active', + 'log: log sync time duration (usecs)', + 'log: log sync_dir time duration (usecs)', 'log: maximum log file size', 'log: number of pre-allocated log files to create', 'log: total log buffer size', @@ -100,6 +103,7 @@ no_clear_list = [ 'cache: bytes currently in the cache', 'cache: bytes not belonging to page images in the cache', 'cache: eviction currently operating in aggressive mode', + 'cache: eviction state', 'cache: files with active eviction walks', 'cache: maximum bytes configured', 'cache: maximum page size at eviction', @@ -111,6 +115,8 @@ no_clear_list = [ 'cache: tracked dirty pages in the cache', 'connection: files currently open', 'data-handle: connection data handles currently active', + 'log: log sync time duration (usecs)', + 'log: log sync_dir time duration (usecs)', 'log: maximum log file size', 'log: number of pre-allocated log files to create', 'log: total log buffer size', |