Commit Graph

292 Commits

Author SHA1 Message Date
Keith Bostic
e355effca7 Add zlib documentation. 2014-01-30 09:09:37 -05:00
Keith Bostic
021d3965b3 Fix the naming of the compression library, it's libXXX, the extension
configuration argument depends on where WiredTiger is installed, not
where the compression library is installed.

Don't try and specify the directory from which configure is being run.

List snappy first, bzip2 is a less likely choice.

Remove mention of the test suite to confirm compression is working.
2014-01-30 08:49:38 -05:00
Michael Cahill
d7e48de530 Fix "make check" with automake-1.11. 2014-01-16 12:04:22 +11:00
Michael Cahill
91f3cc139b Use AM_TESTS_ENVIRONMENT in Makefile.am so we can safely set TESTS_ENVIRONMENT when running tests (e.g., with valgrind). 2014-01-16 08:29:02 +11:00
Keith Bostic
d32f488e43 fix "make check" error, you have to configure the database with statistics
to open a statistics cursor.
2014-01-10 10:43:55 -05:00
Keith Bostic
5b509b7220 Update copyright notices for 2014.
Move lang/java and lang/python into the public domain.
2014-01-07 10:30:12 -05:00
Keith Bostic
6ea2734130 CID 1129079 (#1 of 1): Uninitialized pointer read (UNINIT)
8. uninit_use: Using uninitialized value "value".

Restructure so we drop core if there's a problem (initialize
key & value to NULL), and we don't read "value" unless it's
been initialized.
2013-11-15 19:59:49 -05:00
Keith Bostic
ef2f92c2e8 Clean out core files and the results of running the program locally. 2013-11-15 19:59:49 -05:00
Keith Bostic
1701b0416a CID 1129075 (#2 of 2): Copy into fixed size buffer (STRING_OVERFLOW)
2.  fixed_size_dest: You might overrun the 10 byte fixed-size string
"keybuf" by copying "op->key" without checking the length.
2013-11-15 19:59:49 -05:00
Keith Bostic
157a4e86a7 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.
2013-11-09 09:59:04 -05:00
Michael Cahill
3cb521c73d Fix some warnings from clang. 2013-10-23 11:41:58 +11:00
Keith Bostic
6c7fe958eb Add clear to the connection statistics configuration and remove "clear"
from the statistics_log configuration.

Add error checking, if you specify something like "statistics=(fast,all)",
it should fail.

Write some more statistics documentation.
2013-10-21 10:12:55 -04:00
Keith Bostic
21c44eb329 Fix the ex_stat example. 2013-10-19 16:42:09 -04:00
Keith Bostic
30c726c774 API change: rework "run-time" and "tree-walk" statistics configuration.
Now, the database is configured for "none", "fast" or "all" statistics,
and each cursor is configured for "fast" or  "all" statistics, with the
additional flag "clear".  A cursor's statistics configuration must match
the database statistics cursor, defaulting to the current configuration.
The statistics_log configuration no longer defaults to "fast", it dumps
whatever the database is configured for.

Rename all of the macros from WT_RUNSTAT_XXX to WT_STAT_FAST_XXX.

Reference #715.
2013-10-19 16:29:08 -04:00
Keith Bostic
2bd115e757 Change WT_CURSOR::insert to not hold a position/resources in the tree on
success.

Add additional wording that WT_CURSOR::reset should be called after any
of the WT_CURSOR search, search-near, update or remove methods, once
the cursor is no longer being used to iterate or retrieve values.

Closes #587.
2013-09-10 12:26:37 -04:00
Keith Bostic
c7fbd72c5f "make check" wasn't passing, the truncate-range example is doing a search
for a non-existent key, and a subsequent cursor::compare is noticing the
key isn't set.
2013-09-10 08:38:03 -04:00
Keith Bostic
de5c383ebf Create a "metadata" cursor. 2013-09-02 19:27:10 -04:00
Michael Cahill
04a0461b5c Fix use of a raw cursor in ex_schema.c. 2013-09-02 11:09:32 +10:00
Alex Gorrod
c6387bd021 Fix compiler warnings from OS X. 2013-08-16 14:08:47 +10:00
Michael Cahill
60bf48743f Use an interface for WT_TXN_NOTIFY so it doesn't need a magic cookie. 2013-08-09 15:54:52 +10:00
Keith Bostic
c075d7f296 Add a "config" configuration string to WT_CONNECTION.load_extension,
it's a way to pass arguments to the extension's load function.
2013-08-08 11:13:27 -04:00
Michael Cahill
112c757e38 Move data source truncate method into WT_DATA_SOURCE. 2013-08-08 20:05:38 +10:00
Michael Cahill
131f70a4c0 examples/c/ex_data_source.c:174:6: error: variable ‘is_snapshot_isolation’ set but not used [-Werror=unused-but-set-variable]
examples/c/ex_data_source.c:168:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
2013-08-08 11:40:35 +10:00
Keith Bostic
20ec86b444 Rename WT_EXTENSION_API.transaction_resolve to
WT_EXTENSION_API.transaction_resolve.
2013-08-07 10:56:01 -04:00
Keith Bostic
45d8cfe04c Replace __wt_ext_transaction_snapshot_isolation() with
__wt_ext_transaction_isolation_level().
2013-08-07 10:46:26 -04:00
Keith Bostic
ec2e98f882 Merge branch 'develop' into memrata 2013-08-05 11:57:12 -04:00
Keith Bostic
c0513738b3 Rework the documentation & examples to better reflect "overwrite" is
configured on/true by default, and should only be set if you want
non-standard behavior.
2013-08-05 11:55:54 -04:00
Keith Bostic
ec6a982e4c Merge branch 'develop' into memrata
This is the merge of the last set of changes for cursor flags, and is
likely to break things.

Conflicts:
	src/cursor/cur_ds.c
	src/include/wiredtiger.in
2013-08-02 10:07:41 -04:00
Michael Cahill
118f99d736 whitespace 2013-08-02 09:51:46 +10:00
Michael Cahill
944950c4ff Don't clear the key after a cursor remove.
refs #607
2013-08-01 23:54:10 +10:00
Keith Bostic
54332f1f23 Add a WT_DATA_SOURCE method to support session.checkpoint, then drill
the necessary holes to make it work: this change supports checkpoints
of specific target objects (table:foo), but doesn't support generic
database checkpoints (they don't currently fail, but that's because
they don't do anything at all).

Turn off named checkpoints in test/format, when running with the
memrata device.
2013-07-31 13:54:04 -04:00
Keith Bostic
aa82b9e77d Merge branch 'develop' into memrata 2013-07-29 13:14:22 -04:00
Michael Cahill
b2814ef953 Clarify when applications have to keep key/value buffers valid. 2013-07-29 12:45:38 +10:00
Keith Bostic
ecf78d9fcc Merge branch 'develop' into memrata 2013-07-18 11:34:13 -04:00
Keith Bostic
65922693f8 It's bad style (IMNSHO), but declare the WT_ITEM locally to make it
clear the type we're using.
2013-07-17 11:43:29 -04:00
Keith Bostic
2a6dcba24e Add a more complex raw mode example, plus an example showing a projection
combined with raw mode.
2013-07-17 11:39:54 -04:00
Keith Bostic
dd0ee18ce7 Add an example of using projections to return a subset of values from a
table.
2013-07-17 10:10:49 -04:00
Keith Bostic
2dc50e3fee Merge branch 'develop' into memrata 2013-07-16 10:11:03 -04:00
Alex Gorrod
0572f6cd3a Update cursor->search_near to handle a NULL exact parameter. 2013-07-16 14:38:31 +10:00
Keith Bostic
1690e2fff4 update the file_extend configuration semantics to match the current
pattern.
2013-07-13 22:23:11 -04:00
Keith Bostic
de2ddfef3a Replace the cursor commit/rollback functions with an extension API that
allows the data-source to request notification when the transaction is
committed or rolled back.
2013-07-09 12:53:45 -04:00
Keith Bostic
b65c29e087 Add a separate thread to migrate cache data into the primary (it's a
separate thread because it's possible to copy data out of the cache
without acquiring a lock, so there should be a reasonable amount of
overlap).

Fix a bug in the cache vs. primary comparison code, we were comparing
the value, not the key.

The WT_EXTENSION_API.transaction_oldest method doesn't require a
WT_SESSION handle, simplify it.

Minor re-ordering of the shared library load/unload code to simplify
error handling.
2013-07-08 12:19:49 -04:00
Keith Bostic
cdafd7356c Add the WT_EXTENSION_API.transaction_oldest method to return the oldest
transaction ID not yet visible to a running transaction.
2013-07-05 09:11:33 -04:00
Keith Bostic
279b09c1b8 lint 2013-07-04 12:47:47 -04:00
Keith Bostic
d1602b24ea More transactional code for the Memrata device.
Check if the update can proceed on inserts and updatest, fix the overwrite
stuff (again).  Probably still wrong, but I'll wait until I can run the
test suite to fix it.

Add support for setting the transaction state on commit/rollback; walk
the session handle and for every data-source cursor, call an underlying
commit or rollback function.  I don't see another solution, so I'm doing
this until Michael weighs in: I'm adding private WT_CURSOR methods the
data-source code sets, which is flatly wrong, but the other approaches
seem worse.

Another WT_EXTENSION_API method: the transaction_snapshot_isolation method
returns if snapshot isolation is configured for the current transaction.

Change the WT_EXTENSION_API transaction_id method to return the transaction
ID; it's no more likely to fail than the other transaction methods, and
I don't see them failing in the future either.   It's a little dangerous,
but I'd rather keep error handling simple if we can.
2013-07-04 12:34:40 -04:00
Keith Bostic
f4a42070a3 Write the code to marshall/unmarshall to/from the cache structure
(this version mostly works, supporting the cursor methods other than
search-near).

Add support for two new WT_EXTENSION API methods, collator_config and
collator; the former connects the current sessions collation cookie
to the WT_EXTENSION structure, the second calls it.  This is required
for the underlying data-source if it needs to order key/value pairs.
2013-07-04 09:12:50 -04:00
Keith Bostic
19f977b398 Building on a 9.1 FreeBSD release. 2013-06-19 16:06:04 -04:00
Alex Gorrod
d679e12ce7 Update extension API names from txn_XX to transaction_XX. 2013-06-18 12:30:05 +10:00
Michael Cahill
09e7840292 examples/c/ex_data_source.c:578:6: error: variable 'is_visible' set but not used 2013-06-11 09:28:16 +10:00
Michael Cahill
c6ff974b7f Transaction ID extension methods need a real session handle. 2013-06-11 09:17:11 +10:00