diff options
author | Keith Bostic <keith.bostic@wiredtiger.com> | 2011-09-23 11:52:33 +0000 |
---|---|---|
committer | Keith Bostic <keith.bostic@wiredtiger.com> | 2011-09-23 11:52:33 +0000 |
commit | 94eff05b6b2d8f2f4a5e9975f09fb9c74a3cf03a (patch) | |
tree | 801550282f5b18271e34217a3e990a7c1ded6d84 /test | |
parent | 201c686ecee65e7af669ee14d53d16418db94a50 (diff) | |
download | mongo-94eff05b6b2d8f2f4a5e9975f09fb9c74a3cf03a.tar.gz |
Replace internal_node_min/leaf_node_min (the minimum page size)
configuration with internal_overflow_size/leaf_overflow_size (explicit
configuration of the size of an overflow item.
Fix a bug where we never actually paid any attention to the internal
overflow item size, even though we set it.
Delete the split_min debugging configuration string: the problem is that
small pages now have to be set in concert with the overflow size, if
there is an overflow size that's relatively large, and we create a split
page smaller than an item which is itself smaller than the overflow
size, the item will never fit on the page and we loop forever. I
haven't chased any bugs in reconciliation's page size in quite awhile,
hopefully split_min is no longer interesting.
Write a basic performance tuning page for the documentation.
--HG--
extra : rebase_source : 0825ab4ff58b2dcb18675290f299fad0f5eaaae7
Diffstat (limited to 'test')
-rw-r--r-- | test/format/config.c | 9 | ||||
-rw-r--r-- | test/format/config.h | 8 | ||||
-rw-r--r-- | test/format/format.h | 4 | ||||
-rw-r--r-- | test/format/wts.c | 19 | ||||
-rw-r--r-- | test/salvage/salvage.c | 19 |
5 files changed, 24 insertions, 35 deletions
diff --git a/test/format/config.c b/test/format/config.c index 3d09a1e20a1..dc6d386e914 100644 --- a/test/format/config.c +++ b/test/format/config.c @@ -62,15 +62,6 @@ config_setup(void) /* Periodically, set the delete percentage to 0 so salvage gets run. */ if (!g.replay && g.run_cnt % 10 == 0) g.c_delete_pct = 0; - - /* - * There are a couple of corrections the table doesn't handle, where - * initialized values are relative to each other. - */ - if (g.c_intl_node_max < g.c_intl_node_min) - g.c_intl_node_max = g.c_intl_node_min; - if (g.c_leaf_node_max < g.c_leaf_node_min) - g.c_leaf_node_max = g.c_leaf_node_min; } /* diff --git a/test/format/config.h b/test/format/config.h index 20a08d593c4..e4a9f5b8cc0 100644 --- a/test/format/config.h +++ b/test/format/config.h @@ -72,10 +72,6 @@ static CONFIG c[] = { "maximum size of Btree internal nodes", 0, 0, 9, 17, &g.c_intl_node_max }, - { "intl_node_min", - "minimum size of Btree internal nodes", - 0, 0, 9, 17, &g.c_intl_node_min }, - { "key_max", "maximum size of keys", C_ROW, 0, 64, 128, &g.c_key_max }, @@ -88,10 +84,6 @@ static CONFIG c[] = { "maximum size of Btree leaf nodes", 0, 0, 9, 17, &g.c_leaf_node_max }, - { "leaf_node_min", - "minimum size of Btree leaf nodes", - 0, 0, 9, 17, &g.c_leaf_node_min }, - { "multithread", "configured for multi-threading", /* 50% */ 0, C_BOOL, 50, 0, &g.c_multithread }, diff --git a/test/format/format.h b/test/format/format.h index 471b7083c0a..e741c058af5 100644 --- a/test/format/format.h +++ b/test/format/format.h @@ -33,7 +33,7 @@ #define VAR 3 /* Get a random value between a min/max pair. */ -#define MMRAND(min, max) (wts_rand() % ((max + 1) - (min)) + (min)) +#define MMRAND(min, max) (wts_rand() % (((max) + 1) - (min)) + (min)) #define WT_TABLENAME "file:__wt" @@ -71,11 +71,9 @@ typedef struct { uint32_t c_huffman_value; uint32_t c_insert_pct; uint32_t c_intl_node_max; - uint32_t c_intl_node_min; uint32_t c_key_max; uint32_t c_key_min; uint32_t c_leaf_node_max; - uint32_t c_leaf_node_min; uint32_t c_multithread; uint32_t c_ops; uint32_t c_repeat_data_pct; diff --git a/test/format/wts.c b/test/format/wts.c index bee2219199d..8330ec7de50 100644 --- a/test/format/wts.c +++ b/test/format/wts.c @@ -119,23 +119,30 @@ wts_startup(int open_cursors) WT_CONNECTION *conn; WT_CURSOR *cursor, *cursor_insert; WT_SESSION *session; + uint32_t intlmax, intlovfl, leafmax, leafovfl; int ret; char config[512], *end, *p; if (wts_open(&conn, &session)) return (1); + intlmax = 1U << g.c_intl_node_max; + intlovfl = MMRAND(intlmax / 50, intlmax / 40); + if (intlovfl < 40) + intlovfl = 40; + leafmax = 1U << g.c_leaf_node_max; + leafovfl = MMRAND(leafmax / 50, leafmax / 40); + if (leafovfl < 40) + leafovfl = 40; + p = config; end = config + sizeof(config); p += snprintf(p, (size_t)(end - p), "key_format=%s," - "internal_node_min=%d,internal_node_max=%d," - "leaf_node_min=%d,leaf_node_max=%d,split_min", + "internal_node_max=%d,internal_overflow_size=%d," + "leaf_node_max=%d,leaf_overflow_size=%d", (g.c_file_type == ROW) ? "u" : "r", - 1U << g.c_intl_node_min, - 1U << g.c_intl_node_max, - 1U << g.c_leaf_node_min, - 1U << g.c_leaf_node_max); + intlmax, intlovfl, leafmax, leafovfl); if (g.c_bzip) p += snprintf(p, (size_t)(end - p), diff --git a/test/salvage/salvage.c b/test/salvage/salvage.c index 5f602f2b392..6fc05f8345d 100644 --- a/test/salvage/salvage.c +++ b/test/salvage/salvage.c @@ -25,6 +25,7 @@ #define SLVG "__slvg.build" /* Salvage file */ #define PSIZE (2 * 1024) +#define OSIZE (PSIZE / 20) void build(int, int, int); void copy(u_int, u_int); @@ -448,25 +449,25 @@ build(int ikey, int ivalue, int cnt) (void)snprintf(config, sizeof(config), "key_format=r,value_format=7t," "allocation_size=%d," - "internal_node_min=%d,internal_node_max=%d," - "leaf_node_min=%d,leaf_node_max=%d", - PSIZE, PSIZE, PSIZE, PSIZE, PSIZE); + "internal_node_max=%d,internal_overflow_size=%d," + "leaf_node_max=%d,leaf_overflow_size=%d", + PSIZE, PSIZE, OSIZE, PSIZE, OSIZE); break; case WT_PAGE_COL_VAR: (void)snprintf(config, sizeof(config), "key_format=r," "allocation_size=%d," - "internal_node_min=%d,internal_node_max=%d," - "leaf_node_min=%d,leaf_node_max=%d", - PSIZE, PSIZE, PSIZE, PSIZE, PSIZE); + "internal_node_max=%d,internal_overflow_size=%d," + "leaf_node_max=%d,leaf_overflow_size=%d", + PSIZE, PSIZE, OSIZE, PSIZE, OSIZE); break; case WT_PAGE_ROW_LEAF: (void)snprintf(config, sizeof(config), "key_format=u," "allocation_size=%d," - "internal_node_min=%d,internal_node_max=%d," - "leaf_node_min=%d,leaf_node_max=%d", - PSIZE, PSIZE, PSIZE, PSIZE, PSIZE); + "internal_node_max=%d,internal_overflow_size=%d," + "leaf_node_max=%d,leaf_overflow_size=%d", + PSIZE, PSIZE, OSIZE, PSIZE, OSIZE); break; default: assert(0); |