diff options
author | Keith Bostic <keith@wiredtiger.com> | 2013-11-09 09:59:04 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2013-11-09 09:59:04 -0500 |
commit | 157a4e86a74b05baa047d22c062694e2d74b1a86 (patch) | |
tree | f3d3b0f749c4eb72e4cda24235b3c0f2a5ccc459 /dist | |
parent | 2255fa7fc95b67a316304544651990e2cc35b191 (diff) | |
download | mongo-157a4e86a74b05baa047d22c062694e2d74b1a86.tar.gz |
Compression changes.
Change compaction to attempt compaction any time it looks likely we can
recover the last 10% of the file, and, for now, to only attempt to
recover that last 10% of the file.
Don't rewrite a block if there isn't a useful available block in the
first 90% of the file. (Previously, compacting the whole file in one
pass could end up re-writing blocks to available blocks at the end of
the file which isn't useful, and, in some cases, even extending the
file.
The reason we're only compacting the last 10% of the file is that we
will need to checkpoint periodically otherwise re-written blocks, which
should be the new, available blocks for compaction, won't be considered
because they're still in use. Doing that automatically will be the next
set of changes.
Change compaction to use first-fit allocation instead of best-fit so
we're always copying to the beginning of the file if at all possible.
Add WT_SESSION::create "block_allocation" configuration string, allows
applications to configure first-fit. Change test/format to use the
first-fit algorithm 20% of the time.
Remove the WT_SESSION.compact "trigger" configuration string, it's no
longer used.
Rename WT_SESSION::create "allocation_size" configuration string to
"block_allocation_size" to match "block_allocation" and
"block_compressor" configuration strings.
Inline the block extension search functions, they get called a lot.
Add "compact" verbose debugging string.
Fix a bug where a spinlock could be left held by compaction.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/api_data.py | 17 | ||||
-rw-r--r-- | dist/flags.py | 1 | ||||
-rw-r--r-- | dist/s_string.ok | 1 | ||||
-rw-r--r-- | dist/stat_data.py | 2 |
4 files changed, 12 insertions, 9 deletions
diff --git a/dist/api_data.py b/dist/api_data.py index 75e60fa2131..5f4ccd42207 100644 --- a/dist/api_data.py +++ b/dist/api_data.py @@ -127,7 +127,13 @@ lsm_config = [ # Per-file configuration file_config = format_meta + [ - Config('allocation_size', '4KB', r''' + Config('block_allocation', 'best', r''' + configure block allocation. Permitted values are \c "first" or + \c "best"; the \c "first" configuration uses a first-available + algorithm during block allocation, the \c "best" configuration + uses a best-fit algorithm''', + choices=['first', 'best',]), + Config('block_allocation_size', '4KB', r''' the file unit allocation size, in bytes, must a power-of-two; smaller values decrease the file space required by overflow items, and the default value of 4KB is a good choice absent @@ -329,6 +335,7 @@ connection_runtime_config = [ type='list', choices=[ 'block', 'ckpt', + 'compact', 'evict', 'evictserver', 'fileops', @@ -366,13 +373,7 @@ methods = { 'session.close' : Method([]), -'session.compact' : Method([ - Config('trigger', '30', r''' - Compaction will not be attempted unless the specified - percentage of the underlying objects is expected to be - recovered by compaction''', - min='10', max='50'), -]), +'session.compact' : Method([]), 'session.create' : Method(table_only_meta + file_config + lsm_config + source_meta + [ Config('exclusive', 'false', r''' diff --git a/dist/flags.py b/dist/flags.py index 32a8896b2d2..3106e0592a7 100644 --- a/dist/flags.py +++ b/dist/flags.py @@ -51,6 +51,7 @@ flags = { 'verbose' : [ 'VERB_block', 'VERB_ckpt', + 'VERB_compact', 'VERB_evict', 'VERB_evictserver', 'VERB_fileops', diff --git a/dist/s_string.ok b/dist/s_string.ok index c9ede1eb811..2faf29548d6 100644 --- a/dist/s_string.ok +++ b/dist/s_string.ok @@ -460,6 +460,7 @@ filenames fileops filesize filesystem +firstfit fixup flcs fmt diff --git a/dist/stat_data.py b/dist/stat_data.py index 0d7a59fbca5..ee8ee4af831 100644 --- a/dist/stat_data.py +++ b/dist/stat_data.py @@ -240,7 +240,7 @@ dsrc_stats = [ # Block manager statistics ########################################## Stat('block_alloc', 'blocks allocated'), - Stat('block_allocsize', + Stat('block_allocation_size', 'block manager file allocation unit size', 'no_aggregate,no_scale'), Stat('block_checkpoint_size', 'checkpoint size', 'no_scale'), Stat('block_extension', 'block allocations requiring file extension'), |