Compare commits

...

290 Commits

Author SHA1 Message Date
Michael Cahill
07966a492a Fixup for merge vs backport. 2016-01-28 12:18:13 +11:00
Michael Cahill
67e412d4c5 Merge branch 'develop' into mongodb-3.2 2016-01-28 09:30:32 +11:00
Keith Bostic
7fea169e42 Merge pull request #2463 from wiredtiger/WT-2355
WT-2355 Use wt_buf_grow instead of free/alloc for scratch buffer.
2016-01-27 10:51:42 -05:00
Susan LoVerso
2838f6de01 WT-2355 Use wt_buf_grow instead of free/alloc for scratch buffer. 2016-01-27 10:48:46 -05:00
Alex Gorrod
53c5f38366 Merge pull request #2462 from wiredtiger/WT-2348
WT-2348: xargs -P isn't portable
2016-01-27 10:04:08 +11:00
Keith Bostic
18060bf8d4 WT-2348: xargs -P isn't portable
Test for the -P option to xargs before using it.
2016-01-25 12:08:35 -05:00
Michael Cahill
d3f0af2aaa Merge pull request #2459 from wiredtiger/WT-2347-java-schema-format
WT-2347 Java fix for unsized 's' schema format
2016-01-25 15:09:24 +11:00
Don Anderson
2f23a5e4e6 WT-2347 Added java tests for config schema formats.
This corresponds to Python test_config06 and fixes in WT-1517.
2016-01-24 07:39:50 -05:00
Don Anderson
3a25031eb7 WT-2347 Added java fix for unsized 's' schema formats.
This corresponds to Python fixes in WT-1517.
2016-01-24 07:37:56 -05:00
Keith Bostic
0f710425ba Merge pull request #2457 from wiredtiger/WT-2344
WT-2344: OS X compiler warning
2016-01-22 08:45:57 -05:00
Keith Bostic
7f404e15f1 WT-2344: OS X compiler warning
error: format specifies type 'unsigned long long' but the argument has
type 'size_t' (aka 'unsigned long') [-Werror,-Wformat]
2016-01-22 08:32:49 -05:00
Keith Bostic
6151b0c013 WT-2344: OS X compiler warning
Fix up comment spelling.
2016-01-22 08:31:35 -05:00
Alex Gorrod
cd1aef20bf Merge pull request #2452 from wiredtiger/WT-2342-wtperf-background-schema
WT-2342 Add background create/drop to wtperf.
2016-01-22 16:40:39 +11:00
Michael Cahill
17d4afc247 Merge pull request #2450 from wiredtiger/WT-2333
WT-2333 Add a "no_wait" mode to WT_SESSION::drop.
2016-01-22 16:35:47 +11:00
Michael Cahill
f4e5ae0bb8 WT-2333 Update "lock_fail" warning for clarity. 2016-01-22 16:34:32 +11:00
Alex Gorrod
494022b3de Fixup more compiler warnings.
Don't attempt to statically initialize a pthread_t
2016-01-22 16:24:05 +11:00
Alex Gorrod
b3c476ccdd Fixup build warnings. 2016-01-22 16:02:41 +11:00
Michael Cahill
1dbe083df1 Merge branch 'develop' into WT-2333 2016-01-22 15:58:58 +11:00
Alex Gorrod
d77c7fd4b2 WT-2342 implement review feedback. 2016-01-22 15:50:52 +11:00
Michael Cahill
5163f4037a WT-2333 Make the "ret" variable explicit in lock macros. 2016-01-22 15:35:05 +11:00
Michael Cahill
22494745b1 Merge pull request #2454 from wiredtiger/WT-2275-file
WT-2275 Convert a file URI truncate into a range truncate.
2016-01-22 14:41:46 +11:00
sueloverso
9cea5e32ec Merge pull request #2445 from wiredtiger/WT-2338
WT-2338 Skip pre-allocated log files if backup cursor is open.
2016-01-21 19:19:33 -05:00
Alex Gorrod
103f1c2948 WT-2338 Add a comment in log pre-allocation
Explaining why we can't pre-allocate while a hot backup cursor is open.
2016-01-22 09:44:54 +11:00
Susan LoVerso
3ebb794e33 WT-2275 Update the upgrading documentation. 2016-01-21 13:52:30 -05:00
Susan LoVerso
004375017a WT-2275 Convert a file URI truncate into a range truncate. 2016-01-21 13:44:22 -05:00
Susan LoVerso
8e56f349e1 WT-2338 Skip pre-allocating when backup cursor is open. 2016-01-21 10:47:33 -05:00
Alex Gorrod
f403c1d0ec WT-2342 Add background create/drop to wtperf.
Works on idle tables. Gives us a way to ensure that schema operations
don't get blocked during high throughput workloads.
2016-01-21 17:07:55 +11:00
Michael Cahill
7ca5c3b9e6 WT-2333 Update auto-generated files. 2016-01-21 15:57:23 +11:00
Michael Cahill
c4487d4bff WT-2333 Add a "no_wait" mode to WT_SESSION::drop. 2016-01-21 15:54:19 +11:00
Keith Bostic
8b0c0bd282 Merge pull request #2449 from wiredtiger/WT-2340
WT-2340: Add logging guarantee assertions, whitespace
2016-01-20 19:24:36 -05:00
Keith Bostic
805a935460 WT-2340: Add logging guarantee assertions, whitespace 2016-01-20 19:22:38 -05:00
Keith Bostic
74ee4bf742 Merge pull request #2448 from wiredtiger/WT-2339
WT-2339: format post-rebalance verify failure
2016-01-20 19:13:51 -05:00
Keith Bostic
18a22c53a9 WT-2339: format post-rebalance verify failure
Never trust cell 0 on an internal page, overflow key or not.

When walking an internal page, immediately schedule its blocks to be
freed, don't give the impression there's any ordering requirement with
reading the page.
2016-01-20 18:57:15 -05:00
Keith Bostic
cd684b1bdb WT-2339: format post-rebalance verify failure
Add additional debugging information, display the out-of-order keys when
the sort order has been violated.
2016-01-20 18:56:30 -05:00
sueloverso
fd7a3eb9ad Merge pull request #2444 from wiredtiger/WT-2296
WT-2296 Yield instead of sleep if the wrlsn thread is finding work.
2016-01-20 16:56:35 -05:00
Alex Gorrod
6874ec478c Merge pull request #2443 from wiredtiger/WT-2332
WT-2332 Add logging guarantee assertions.
2016-01-21 08:27:19 +11:00
Susan LoVerso
dc79205bd9 WT-2267 Fix warning 2016-01-20 13:24:03 -05:00
sueloverso
dc6d95bf76 Merge pull request #2440 from wiredtiger/WT-2267
WT-2267 - WTPERF Throttle implementation
2016-01-20 11:06:48 -05:00
Susan LoVerso
73f5bde385 WT-2267 whitespace 2016-01-20 09:48:04 -05:00
Susan LoVerso
d88bc48a7a WT-2267 Minor updates to comments. 2016-01-20 09:39:43 -05:00
Michael Cahill
fb2cc399f4 Merge pull request #2441 from wiredtiger/WT-1517
WT-1517: schema format edge cases
2016-01-20 15:26:17 +11:00
Michael Cahill
ba9ac383d0 Merge pull request #2442 from wiredtiger/WT-2295-index-exclusive
WT-2295 On index create, do not populate existing indices.
2016-01-20 15:14:16 +11:00
Michael Cahill
6bd6dea47c WT-1517 Add a check to the C packing test.
Since Python operates in raw mode, it sidesteps the usual processing.
2016-01-20 15:11:46 +11:00
Michael Cahill
1c2c309521 WT-2295 Revert exclusive checking for tables. 2016-01-20 15:00:41 +11:00
Michael Cahill
a045f7affb WT-1517 whitespace. 2016-01-20 14:57:48 +11:00
Michael Cahill
0c241d2988 WT-1517 Set the packing size = 1 by default in the fast path.
Don't add extra checks into regular processing: we already set size = 1
in normal processing of packing strings if no size is specified.  Make
the Python packing code match so all test cases pass.
2016-01-20 14:54:25 +11:00
Michael Cahill
c7c4e74fcf WT-2995 Review error handling in create.
Make handling of exclusive as close as possible between tables, indexes
and column groups.
2016-01-20 14:22:54 +11:00
Michael Cahill
b9fe283e3e Merge pull request #2434 from wiredtiger/WT-2321
WT-2321: race between eviction and worker threads on the eviction queue
2016-01-20 14:08:55 +11:00
Michael Cahill
30f663bf46 WT-2321 Simplify the fix to guarantee that candidates <= entries. 2016-01-20 13:42:58 +11:00
Alex Gorrod
d33337d50e Merge pull request #2446 from wiredtiger/WT-2287
WT-2287: WT_SESSION.rebalance
2016-01-20 12:44:57 +11:00
Keith Bostic
e2ba70597a WT-2287: WT_SESSION.rebalance
Use a static buffer for the wiredtiger_open configuration, that way we
don't have to free it to make clang LeakSanitizer happy.
2016-01-19 20:33:22 -05:00
Susan LoVerso
87c3b645ba WT-2332 Remove if statement and merge it into the assert. 2016-01-19 18:48:56 -05:00
Susan LoVerso
ceb588958b WT-2296 Use WT_THOUSAND. 2016-01-19 18:47:57 -05:00
Alex Gorrod
2f1d50a1dd Merge pull request #2399 from wiredtiger/wt-2287-rebalance
WT-2287: WT_SESSION.rebalance support.
2016-01-20 10:25:09 +11:00
David Hows
1743180fcf WT-2267 - WTPERF Throttle implementation 2016-01-20 09:24:13 +11:00
Susan LoVerso
037092fdff WT-2338 Skip pre-allocated log files if backup cursor is open. 2016-01-19 16:43:26 -05:00
Susan LoVerso
c5527a9e80 WT-2296 Yield instead of sleep if the wrlsn thread is finding work. 2016-01-19 16:06:46 -05:00
Susan LoVerso
6ba817a87a WT-2332 Add logging guarantee assertions. 2016-01-19 15:39:50 -05:00
Don Anderson
60c118f9fd WT-2295 An existing index will not be filled. Fixed exclusive index create. 2016-01-19 14:19:19 -05:00
Don Anderson
83aa39c448 WT-2295 Added a test for creating an index with exclusive flag. 2016-01-19 14:19:05 -05:00
Keith Bostic
b7f10136bb WT-1517: schema format edge cases
Fixes for the default 's' format, if no size is specified, the size is 1.

Add some smoke tests for the 'S' and 's' formats, with counts.
2016-01-19 12:28:54 -05:00
Keith Bostic
9000c9ecc7 WT-1517: schema format edge cases
Add a test for some session.create key/value format edge cases.
2016-01-19 11:00:18 -05:00
Keith Bostic
6a6951e343 WT-1517: schema format edge cases
Fail for 's' format with an explicit count of 0.
2016-01-19 10:58:46 -05:00
Keith Bostic
2d9c48b3bc WT-1517: schema format edge cases
Explicitly docuemnt a default for the 's' format, 1 byte.
2016-01-19 10:58:08 -05:00
Keith Bostic
4313b5fafa WT-2287: WT_SESSION.rebalance support.
Add a Reference Guide WT_SESSION.rebalance page.
2016-01-19 10:20:00 -05:00
Keith Bostic
932df1297c WT-2287: WT_SESSION.rebalance support.
Fix a typo in a random comment.
2016-01-19 09:59:31 -05:00
Keith Bostic
2fbec8cc81 Merge branch 'develop' into wt-2287-rebalance 2016-01-19 09:59:03 -05:00
Keith Bostic
208aff090a WT-2287: WT_SESSION.rebalance support.
WT_SESSION.rebalance is now officially documented, do the work.

Sort the list of "Advanced topics" by name.
2016-01-19 09:58:06 -05:00
Keith Bostic
829bcd39cc WT-2287: WT_SESSION.rebalance support.
Use a more appropriate name for the rebalance method uri.
2016-01-19 09:57:33 -05:00
Keith Bostic
027d079c3c Merge pull request #2345 from wiredtiger/wt-2247-column-store-splits
WT-2247, WT-2312: variable-length column-store in-memory page splits
2016-01-19 09:07:02 -05:00
Keith Bostic
5a84febed7 WT-2247, WT-2312: variable-length column-store in-memory page splits
Review comments, get rid of incorrect/unnecessary const declarations.
2016-01-19 08:35:51 -05:00
Keith Bostic
4b67c914e6 WT-2247, WT-2312: variable-length column-store in-memory page splits
Review comment, simplify an expression with a temporary variable.
2016-01-19 08:29:13 -05:00
Keith Bostic
d39d416bf5 WT-2247, WT-2312: variable-length column-store in-memory page splits
Review comment, remove an unnecessary set of the WT_REF.page_del field.
2016-01-19 08:21:42 -05:00
Keith Bostic
f19f26b60f Merge branch 'develop' into wt-2247-column-store-splits 2016-01-19 08:19:20 -05:00
Keith Bostic
bd37e4f9f9 Merge pull request #2338 from wiredtiger/wt-2242-dead-tree-eviction
WT-2242 dead tree eviction
2016-01-19 07:59:34 -05:00
Keith Bostic
5314f4253e Merge branch 'develop' into wt-2242-dead-tree-eviction 2016-01-19 07:38:34 -05:00
Michael Cahill
3223f52ef1 Merge pull request #2438 from wiredtiger/WT-2335
WT-2335: crash in config_check_search with invalid configuration string
2016-01-19 17:23:55 +11:00
Michael Cahill
d2eec21e7f Merge pull request #2439 from wiredtiger/WT-1801
WT-1801: Add a directory sync after rollback of a WT_SESSION::rename operation
2016-01-19 16:38:24 +11:00
Michael Cahill
21e7f32229 WT-2335 Add some tests with too few closing brackets. 2016-01-19 16:29:41 +11:00
Michael Cahill
350f989f07 WT-2335 Add a test case. 2016-01-19 16:23:53 +11:00
Keith Bostic
f521ef6a52 WT-1801: Add a directory sync after rollback of a WT_SESSION::rename operation
Rename the sync-and-XXX functions so they're consistent, for clarity.
2016-01-18 15:58:48 -05:00
Keith Bostic
17d695bc16 WT-1801: Add a directory sync after rollback of a WT_SESSION::rename operation
Change __meta_track_unroll() to flush the from/to directories when
unrolling a rename.

Change __wt_sync_and_rename_fh() and __wt_sync_and_rename_fp() to flush
the directory in which the file exists (don't assume the file is in the
database home directory, although it almost certainly is), as well as to
flush both the from and to directories.
2016-01-18 10:03:22 -05:00
Alex Gorrod
48c5cd012c Merge pull request #2437 from wiredtiger/WT-2326-fix
WT-2326 - Add back a nullbyte that was incorrectly removed from wtperf
2016-01-18 15:21:25 +11:00
David Hows
6535d8fadb WT-2326 - Add a new dstrndup function replace calls. 2016-01-18 12:39:10 +11:00
David Hows
cf1609c25e WT-2326 - Switch from dstrdup to dcalloc and strndup 2016-01-18 11:04:57 +11:00
David Hows
3b51510d7b WT-2326 - Comment explaining nullbyte for truncation. 2016-01-18 10:19:45 +11:00
Keith Bostic
6fbe341393 WT-2335: crash in config_check_search with invalid configuration string
If the configuration string starts with a leading closing bracket, CAP
is called without PUSH having been called first (so out.str is never
initialized), conf.depth will be decremented to match conf.top's initial
value of -1, and we return a garbage item.
2016-01-17 09:38:48 -05:00
Keith Bostic
13fd4f33c5 WT-2335: crash in config_check_search with invalid configuration string
Replace the "Closing brackets missing from config string" error message
with "Unbalanced brackets", this error path can be hit if there are too
many closing brackets as well as too few.
2016-01-17 09:28:29 -05:00
Keith Bostic
20b7f43ef8 WT-2321: race between eviction and worker threads on the eviction queue
The code adding pages to the list of eviction candidates was setting the
maximum tracked entry count below the number of eviction candidates, in
which case we could add new entries in the same array space as the threads
removing entries.
2016-01-15 12:50:49 -05:00
David Hows
275e6979be WT-2326 - Add back a nullbyte that was incorrectly removed from wtperf 2016-01-15 11:35:40 +11:00
Alex Gorrod
3dafe00284 Merge pull request #2420 from wiredtiger/wt-2308-join-extractor
WT-2308 Fix for join using extractor
2016-01-14 14:51:02 -05:00
Alex Gorrod
dd7811875e Merge pull request #2435 from wiredtiger/WT-2331-join-search
WT-2331 Require that reference cursors that are joined be positioned
2016-01-14 14:43:58 -05:00
Don Anderson
b8f3effa90 WT-2331 Require that reference cursors that are joined be positioned.
Additionally add tests to verify that cursors that merely have a key set, or
that have failed a positioning API (search), not be usable in a join.  Give
a better error message in all these cases.

Add a check in __wt_struct_repack so that an empty or shorter than expected
input array give an error, and not be interpreted as unbounded size.
2016-01-14 14:08:42 -05:00
Keith Bostic
b3b39536a5 Merge pull request #2430 from wiredtiger/WT-2326
WT-2326 - Add dcalloc, dmalloc and dstrdup to wtperf
2016-01-14 09:58:38 -05:00
Keith Bostic
65c59d7ba5 WT-2326: Add dcalloc, dmalloc and dstrdup to wtperf
Update spelling check list.
2016-01-14 09:40:13 -05:00
Keith Bostic
d2ee578676 WT-2326: Add dcalloc, dmalloc and dstrdup to wtperf
The create_uris() function no longer returns an error and doesn't need
error handling ("ret" can never be non-zero).

Replace a couple more strdup/realloc calls with dstrdup/drealloc.
2016-01-14 09:37:29 -05:00
Keith Bostic
2b35a62727 WT-2326: Add dcalloc, dmalloc and dstrdup to wtperf
Add drealloc, wtperf has calls to realloc that aren't checked for error.
Group functions a little more intuitively.
2016-01-14 09:36:07 -05:00
Keith Bostic
26b8aafe87 WT-2326 - Add dcalloc, dmalloc and dstrdup to wtperf
Replace another calloc call with dcalloc.
2016-01-14 09:35:12 -05:00
Keith Bostic
f2699e8e83 WT-2326 - Add dcalloc, dmalloc and dstrdup to wtperf
Replace a couple more strdup calls with dstrdup.
2016-01-14 09:34:49 -05:00
Keith Bostic
f4cc13a6df Merge pull request #2433 from wiredtiger/WT-2313
WT-2313 Wrap clearing of WT_DHANDLE_OPEN with eviction exclusive calls.
2016-01-13 19:52:28 -05:00
Keith Bostic
d81cf0b1a8 WT-2321: race between eviction and worker threads on the eviction queue
Sort the WT_PAGE flags, add WT_PAGE_SPLIT_BLOCK and WT_PAGE_UPDATE_IGNORE
to the page debug output.
2016-01-13 19:45:54 -05:00
Keith Bostic
d5e01aec71 WT-2321: race between eviction and worker threads on the eviction queue
Don't compare/set booleans to 1.
2016-01-13 19:43:42 -05:00
Keith Bostic
f97a542dfa WT-2321: race between eviction and worker threads on the eviction queue
The eviction server is in evict_walk_file(), calling
evict_init_candidate() to put an entry on the queue. That function sets
the WT_REF, then the WT_BTREE, then the WT_PAGE_EVICT_LRU WT_PAGE flag.
A thread taking an entry from the queue only checks the WT_REF is set,
then removes the entry from the queue, asserting WT_PAGE_EVICT_LRU is
set, and the two can race. Wait to see WT_PAGE_EVICT_LRU before taking
an entry from the queue.
2016-01-13 19:39:00 -05:00
David Hows
0ec0695eaa WT-2326 - Remove duplicate memory allocations 2016-01-14 10:10:35 +11:00
Keith Bostic
3cd810af67 WT-2313 Make sure eviction is out of files that are being closed.
Line too long.
2016-01-13 17:04:07 -05:00
Michael Cahill
877130fd94 WT-2313 Set the next file for eviction to visit after checking eviction is enabled. 2016-01-13 16:25:53 -05:00
Michael Cahill
b930252d45 WT-2313 Fold "mark dead" function into caller. 2016-01-13 15:50:46 -05:00
Michael Cahill
4e221d2454 WT-2313 Fix spurious uninitialized variable warning. 2016-01-13 15:44:36 -05:00
Michael Cahill
ef9927e77f WT-2313 Make sure eviction is out of files that are being closed. 2016-01-13 15:32:52 -05:00
Susan LoVerso
8e77722f47 WT-2313 Wrap clearing of WT_DHANDLE_OPEN with eviction exclusive calls. 2016-01-13 10:33:49 -05:00
Alex Gorrod
9504bd9321 Merge pull request #2432 from wiredtiger/WT-2328
WT-2328: schema drop does direct unlink, change to a block manager interface
2016-01-13 08:33:18 -05:00
David Hows
8ecdbcaee4 WT-2326 - Fix incorrect variable being used 2016-01-13 11:29:25 +11:00
David Hows
6f1ea15929 WT-2326 - Remove un-needed tmp variables and clean up some memory allocations 2016-01-13 11:15:57 +11:00
David Hows
7d215b4b04 WT-2326 - Fix unused label 2016-01-13 10:54:17 +11:00
David Hows
312a3722a7 WT-2326 - Add dcalloc, dmalloc and dstrdup to wtperf and replace all existing malloc, calloc and strncpy calls 2016-01-13 10:54:17 +11:00
Michael Cahill
e35c23e539 Merge pull request #2422 from wiredtiger/WT-2316
WT-2316: WT_CURSOR.prev out-of-order returns, fix a split race.
2016-01-12 18:32:03 -05:00
Alex Gorrod
58ace643a6 Merge pull request #2414 from wiredtiger/WT-2305
WT-2305 - Fix coverity issues
2016-01-12 17:56:54 -05:00
Keith Bostic
40c920d2a3 WT-2328: schema drop does direct unlink, change to a block manager interface. 2016-01-12 13:12:03 -05:00
David Hows
69292923ef WT-2305 - Change how config dump filename is setup 2016-01-12 12:10:29 +11:00
Keith Bostic
f1977bb374 WT-2316: WT_CURSOR.prev out-of-order returns, fix a split race.
Simplify the __page_descend() function, it only needs a WT_PAGE, it
doesn't need the WT_REF for the page, hopefully that makes it easier
to understand.

Add comments to each of the races we have to address, try and describe
the case each check is intended to fix.
2016-01-11 17:13:21 -05:00
Michael Cahill
19e2a36bf8 Merge pull request #2423 from wiredtiger/SERVER-22064
SERVER-22064: Coverity, function return value not checked for error
2016-01-11 15:49:35 -05:00
Keith Bostic
70c8b7816c WT-2316: WT_CURSOR.prev out-of-order returns, fix a split race.
Add diagnostic next/previous key order checking after calls to
WT_CURSOR.{search,search-near}.
2016-01-11 11:54:08 -05:00
Keith Bostic
a0fd1c3abe WT-2316: WT_CURSOR.prev out-of-order returns, fix a split race.
Increase the cursor movement in format to 100 calls, hopefully that
will increase our exposure to cursor races during splits.
2016-01-11 10:43:26 -05:00
Alex Gorrod
051ab40ada Merge pull request #2427 from wiredtiger/WT-2320
WT-2320 Only check copyright as part of cutting a release.

Builds on another change that was pushed directly to develop branch: 00c2116
2016-01-10 16:49:29 -05:00
Michael Cahill
72d1dce45b Merge branch 'develop' into WT-2320 2016-01-10 16:16:28 -05:00
Michael Cahill
27b778a630 WT-2320 Only check copyright when cutting a release. 2016-01-10 16:13:55 -05:00
Michael Cahill
00c2116d63 WT-2320 Only run s_copyright when cutting a release. 2016-01-10 16:09:19 -05:00
Keith Bostic
977009b128 WT-2316: WT_CURSOR.prev out-of-order returns, fix a split race.
There's no reason to check if the two WT_REF.page fields match, if the
WT_REFs match, that means we have the same slot.
2016-01-10 12:33:56 -05:00
Keith Bostic
ff24c1f861 SERVER-22064: Coverity, function return value not checked for error
Coverity analysis defect 77699: Unchecked return value, problem
introduced in SERVER-21619 change, commit 354c031.

Instead of calling __wt_evict_page_clean_update() when discarding pages,
call __wt_ref_out() directly, __wt_evict_page_clean_update() doesn't do
any useful additional work.

This allows __wt_evict_page_clean_update() to be static in evict_page.c,
rename to __evict_page_clean_update().
2016-01-10 11:08:22 -05:00
Keith Bostic
6b6da4be59 WT-2287: WT_SESSION.rebalance support
Review comments: rename WT_RSTUFF to be WT_REBALANCE_STUFF, whitespace
formatting.
2016-01-10 10:33:21 -05:00
Keith Bostic
b2248ba782 Don't create "words" the spellcheck script will complain about. 2016-01-10 10:32:51 -05:00
Keith Bostic
606d8364b4 WT-2316: WT_CURSOR.prev out-of-order returns, fix a split race. 2016-01-09 18:30:25 -05:00
Don Anderson
64dd79c929 WT-2308. Add test for equality joins with extractors. 2016-01-05 13:20:33 -05:00
Alex Gorrod
088d5c9c72 Expand rebalance test. 2016-01-06 03:30:02 +11:00
Don Anderson
8be67f14b3 Merge branch 'develop' into wt-2308-join-extractor 2016-01-04 21:56:15 -05:00
Don Anderson
3ab869ff7a WT-2308. Simplify the case for getting the key to be used for an endpoint,
there is no special case for extractors.
2016-01-04 21:35:13 -05:00
sueloverso
8207b74976 Merge pull request #2419 from wiredtiger/wt-2314-page-swap-errors
WT-2314: better error handling in the page-swap function and callers.
2016-01-04 19:20:49 -05:00
Keith Bostic
045fe19284 WT-2314: review comments, integrate the notfound-ok and restart-ok
booleans into the list of standard __wt_page_swap/__wt_page_in flags,
clarify a comment, the error returns come from page-in.
2016-01-04 18:53:51 -05:00
Keith Bostic
26b4776c27 Change WT_SESSION.rebalance to silently succeed if the tree has
never been written to disk.
Add support for WT_SESSION.rebalance to the fops test program.
2016-01-04 18:35:09 -05:00
Keith Bostic
fba53cac21 Consistently use __wt_yield() in all of the test programs. 2016-01-04 18:30:10 -05:00
Keith Bostic
313be6d9f8 Merge branch 'develop' into wt-2287-rebalance 2016-01-04 18:13:44 -05:00
Alex Gorrod
5bc2a7ab2a Merge pull request #2348 from wiredtiger/wt-2142-test-cleanup
WT-2142 test cleanup
2016-01-04 17:57:02 -05:00
Keith Bostic
e4d8a1732b WT-2314: better error handling in the page-swap function and callers. 2016-01-02 17:04:39 -05:00
Keith Bostic
44ba85399a Don't document WT_SESSION.rebalance. 2016-01-02 15:31:02 -05:00
Keith Bostic
f4d979155d field precision specifier '.*' expects argument of type 'int', but
argument 6 has type 'const char *' [-Werror=format=]
2016-01-02 14:55:03 -05:00
Keith Bostic
b867f57eff Use size_t around realloc calls, cleans up some lint. 2016-01-02 08:30:43 -05:00
Keith Bostic
d34057388b __wt_buf_set_printable() now returns a const char * (the string), not an
error code.
2016-01-02 08:22:46 -05:00
Keith Bostic
de7a83ea08 __wt_buf_set_printable argument order changed. 2016-01-02 08:15:37 -05:00
Keith Bostic
fa2441e682 replace tab characters with spaces 2016-01-01 20:34:08 -05:00
Keith Bostic
879653cde1 update 2016-01-01 20:33:48 -05:00
Keith Bostic
41b229972d Don't rebalance anything other than a clean, on-disk tree. 2016-01-01 19:25:30 -05:00
Keith Bostic
56af854160 Force the populated tree to disk, we don't rebalance in-memory objects. 2016-01-01 19:24:42 -05:00
Keith Bostic
3e47f870e4 Add a smoke-test of the WT_SESSION.rebalance API. 2016-01-01 17:03:57 -05:00
Keith Bostic
cbc6bc593d Upgrade copyright notices from 2015 to 2016. 2016-01-01 16:57:46 -05:00
Keith Bostic
a6f27c99a5 Merge branch 'develop' into wt-2287-rebalance 2016-01-01 16:51:17 -05:00
Keith Bostic
344a714c3d Upgrade copyright notices from 2015 to 2016. 2016-01-01 16:37:39 -05:00
Keith Bostic
da9b67d933 Merge branch 'develop' into wt-2287-rebalance 2016-01-01 16:14:23 -05:00
Keith Bostic
6b74b44079 Replace another 0 with WT_RECNO_OOB. 2016-01-01 12:02:23 -05:00
Don Anderson
7715f49ee9 Merge branch 'develop' into wt-2142-test-cleanup 2016-01-01 11:24:44 -05:00
Don Anderson
acd25d4e98 WT-2142. In test suite, replace lambda expressions by functions. 2016-01-01 11:20:29 -05:00
Keith Bostic
4a4439a792 Copy the configuration string, they get free'd when the run ends. 2015-12-31 21:17:15 -05:00
Keith Bostic
fe9ec20a28 WT-2247: Now that append-lists can appear on column-store pages other
than the last page in the tree, fixed-length column store tests for at
the beginning of the page can't be for record 1 explicitly, it must be
for the first record in the page.

Review the "append" related comments in the cursor next/prev code, and
clean up the ones that anticipate the append list only appearing on the
last page of the tree.
2015-12-31 17:39:17 -05:00
Keith Bostic
8e31d56d32 error: initialization from incompatible pointer type
[-Werror=incompatible-pointer-types]
2015-12-31 15:28:28 -05:00
Keith Bostic
f73041042f error: assignment discards "const" qualifier from pointer target type
[-Werror=discarded-qualifiers]
2015-12-31 15:11:01 -05:00
Keith Bostic
6e95d83bb8 When turning off compression for an in-memory build, don't assign 0 to
a string variable, it won't print correctly on failure.
2015-12-31 15:05:09 -05:00
Keith Bostic
70ef7626ee WT-2312: When re-creating a deleted column-store page, the page's record
number was being set to 1, not to the record number of the deleted page.
2015-12-31 12:38:15 -05:00
Keith Bostic
1323a11b83 Replace recno of 0 with WT_RECNO_OOB. 2015-12-31 10:33:12 -05:00
Keith Bostic
f917b53b70 Replace recno of 0 with WT_RECNO_OOB. 2015-12-31 10:31:35 -05:00
Keith Bostic
016d579e93 When splitting, set the newly created child page's record number in the
page-allocation function, it's cleaner and more consistent with creating
other pages.
2015-12-31 09:19:50 -05:00
Keith Bostic
0e1daa5bbf Merge branch 'develop' into wt-2247-column-store-splits 2015-12-31 09:10:43 -05:00
Alex Gorrod
f1a56169ba Merge pull request #2258 from wiredtiger/wt-2073-metadata-cleanup 2015-12-30 17:15:28 -05:00
Alex Gorrod
5cc97129f7 Nits in metadata cleanup. Add a comment and an assertion. 2015-12-31 09:06:36 +11:00
Keith Bostic
0fefb81438 Review comments: when not closing an open cursor because
WT_CURSTD_META_INUSE is set, assert it is the session's
cached cursor.
2015-12-30 16:13:03 -05:00
Keith Bostic
63938fdd99 Merge branch 'develop' into wt-2073-metadata-cleanup 2015-12-30 15:35:10 -05:00
Alex Gorrod
3c2ad56b50 Merge pull request #2415 from wiredtiger/wt-2307-fix
(cherry picked from commit 12aaeb6)

WT-2307: Fix for cursor iteration bug when pages are splitting
2015-12-29 05:42:26 +11:00
David Hows
34ba6f3a0a WT-2305 - Fix coverity issues 2015-12-23 18:00:37 +11:00
Alex Gorrod
b1768d0d9f Revert "Merge pull request #2394 from wiredtiger/SERVER-21887-sample"
The change wasn't ready for back port into 3.2.1

This reverts commit 21b5f9951e.
2015-12-22 08:15:10 +00:00
Alex Gorrod
2893117baa Revert "WT-2291: error: comparison of array 'ins->next' not equal to a null"
The change isn't ready for back port into 3.2.1

This reverts commit 4380cec93d.
2015-12-22 08:14:38 +00:00
Keith Bostic
67f76e0a71 Don't overwrite saved WiredTiger open string when configuring Helium. 2015-12-17 12:54:24 -05:00
Keith Bostic
710ca2cdf6 Remove "%.*s" in favor of "%s", argument length no longer necessary. 2015-12-17 12:49:05 -05:00
Keith Bostic
8a3df0aa58 Merge branch 'develop' into wt-2287-rebalance 2015-12-17 12:47:23 -05:00
Keith Bostic
d813a7e3f2 Lint around allocating only 4B worth of WT_REF entries, use a local
uint32_t value.
2015-12-17 12:33:14 -05:00
Keith Bostic
1df86bfb7a WT-2287: Add support for a WT_SESSION.rebalance method that rebuilds the
underlying btree, correcting any imbalance.
2015-12-17 12:29:08 -05:00
Keith Bostic
1dc7358336 Move __wt_buf_set_printable() from buf.i to bt_misc.c, there's no reason
to inline that function, it's an error/verbose print routine.

Change __wt_buf_set_printable() to return a pointer to the (char *)
string created (which is potentially "[Error]"). The change simplifies
some code, we can now make the call to __wt_buf_set_printable() as an
argument to __wt_verbose(), rather than calling it separately and
needing a verbose flag wrapper and/or additional error handling.

Change __wt_buf_set_printable() to take the temporary buffer as the last
argument instead of the second, matches __wt_addr_string().

Change __verify_dsk_row to display the mismatched keys when finding two
keys out-of-order during verify, it's the most common failure I see and
I'm tired of hacking that code in during debug.
2015-12-17 11:54:51 -05:00
Keith Bostic
20c6a1e592 Remove duplicated comment. 2015-12-17 10:30:19 -05:00
Keith Bostic
4380cec93d WT-2291: error: comparison of array 'ins->next' not equal to a null
pointer is always true [-Werror,-Wtautological-pointer-compare]
2015-12-17 10:48:19 +11:00
Alex Gorrod
21b5f9951e Merge pull request #2394 from wiredtiger/SERVER-21887-sample
WT-2291: fix for sampling in newly created trees.
2015-12-17 10:47:55 +11:00
Keith Bostic
decd9166cc __wt_ref_info() and __ref_is_lef() no longer need a WT_SESSION_IMPL
argument, remove it.
2015-12-16 15:54:52 +11:00
Keith Bostic
d835a0c0a8 gcc47 with [-Werror=maybe-uninitialized] reports we can end up with type
uninitialized in __ref_is_leaf() (based on a call to __wt_ref_info()).
It's not really possible because the path where type isn't set is a path
where we panic because the WT_ADDR structure has an impossible type.

We already ignore the __wt_ref_info() error return in one path, and
there are only two paths that care about the returned type; remove the
error check from __wt_ref_info() and set type to 0 in the failing case
(the same value we use when there's no WT_REF addr to check), the code
that calls this function already checks addr on return.

This simplifies __ref_is_leaf() slightly, it now returns a boolean
instead of an error code with a boolean pointer argument.
2015-12-16 15:29:31 +11:00
Keith Bostic
48e1343e40 Merge pull request #2363 from wiredtiger/WT-2262
WT-2262 Have random sampling walk the tree so it isn't biased in skewed trees.
2015-12-16 15:29:13 +11:00
Michael Cahill
eb838c7f12 Merge pull request #2361 from wiredtiger/wt-2260-dont-evict-internal
WT-2260 Avoid adding internal pages to the eviction queue.
2015-12-16 15:28:52 +11:00
Alex Gorrod
a6957512a4 Merge pull request #2358 from wiredtiger/wt-2258-preload-directio 2015-12-16 15:28:11 +11:00
Keith Bostic
4d6de24df3 Alex's review, simplify the expression. 2015-12-14 06:38:41 -05:00
Keith Bostic
b8e992b386 Change the column-store leaf peage reconciliation code that walks the
list of appended items to handle missing records caused by a split. It's
forces a complicated loop, but I think it's less likely to break the
future and it's a lot easier to make the fixed- and variable-length code
look the same, otherwise we'd need two different implementations.
2015-12-13 10:46:57 -05:00
Keith Bostic
ee072ba7a4 If we split a column-store page, instantiate missing records in the page
name space during reconciliation. (Imagine record 998 is transactionally
visible, 999 was never created or is not yet not visible, 1000 is
visible. Then the page split and record 1000 moves to another page. When
we reconcile the original page, we write record 998, then we don't see
record 999 for whatever reason. If we've moved record 1000, we don't
know to write a deleted record 999 on the page.) The fix is to record
the split record in the page-modify structure, and create missing
records as deleted records.
2015-12-13 09:20:44 -05:00
Keith Bostic
afad0aac7e Merge branch 'develop' into wt-2247-column-store-splits 2015-12-12 17:33:43 -05:00
Keith Bostic
c747910391 Review comment from Michael: I'd prefer a macro called WT_SESSION_META_DHANDLE
that takes a session and looks up the data handle session->meta_cursor to find
the data handle for this one case. This only works on btree cursors (so the
name is misleading) and is only ever used on session->meta_cursor.
2015-12-10 16:07:26 -05:00
Keith Bostic
2dee94f2d2 Merge branch 'develop' into wt-2073-metadata-cleanup 2015-12-10 15:33:44 -05:00
Keith Bostic
ccb3274781 Merge branch 'develop' into wt-2073-metadata-cleanup 2015-12-09 09:45:00 -05:00
Keith Bostic
40f9e160ea Merge branch 'develop' into wt-2242-dead-tree-eviction 2015-12-09 09:43:25 -05:00
Keith Bostic
345f95c2ff Merge branch 'develop' into wt-2073-metadata-cleanup 2015-12-08 07:27:31 -05:00
Keith Bostic
3a776699c4 Merge branch 'develop' into wt-2242-dead-tree-eviction 2015-12-08 07:24:46 -05:00
Keith Bostic
23dc30f607 Merge branch 'develop' into wt-2073-metadata-cleanup 2015-12-07 07:37:28 -05:00
Keith Bostic
1da1bd2cc2 Merge branch 'develop' into wt-2242-dead-tree-eviction 2015-12-07 07:35:29 -05:00
Keith Bostic
79ffcda8a7 Merge branch 'develop' into wt-2073-metadata-cleanup 2015-12-04 09:08:28 -05:00
Keith Bostic
749623b153 Merge branch 'develop' into wt-2242-dead-tree-eviction 2015-12-04 08:59:17 -05:00
Keith Bostic
2e7ba456fc Merge branch 'develop' into wt-2247-column-store-splits 2015-12-04 08:57:51 -05:00
Keith Bostic
9ca87ee97b Merge branch 'develop' into wt-2242-dead-tree-eviction 2015-12-02 19:50:24 -05:00
Michael Cahill
197eef00fd Merge branch 'develop' into mongodb-3.2 2015-12-02 22:58:11 +11:00
Keith Bostic
67864f2c4f Merge branch 'develop' into wt-2073-metadata-cleanup 2015-12-01 07:36:25 -05:00
Keith Bostic
16fa52c937 Merge branch 'develop' into wt-2247-column-store-splits 2015-12-01 07:20:54 -05:00
Keith Bostic
06daca3788 Merge branch 'develop' into wt-2242-dead-tree-eviction 2015-12-01 07:13:33 -05:00
Michael Cahill
7a4f3259b4 Merge branch 'develop' into mongodb-3.2 2015-12-01 17:12:04 +11:00
Don Anderson
fa209c1357 Merge branch 'develop' into wt-2142-test-cleanup 2015-11-30 16:55:46 -05:00
Don Anderson
91a6c92541 WT-2142. At the end of a test run, all open connections should be closed
to prevent cascading errors. Clean up and (mostly) standardize how connection
configuration is added to and modified.

Details:
- class TestSuiteConnection wraps an opened Connection,
  calls to close() remove it from the list of active connections.

- WiredTigerTestCase.wiredtiger_open uses a TestSuiteConnection, and this
  version of wiredtiger_open is now used everywhere.

- in tearDown(), active connections are explicitly closed.

- In WiredTigerTestCase derived classes, we now use use self.conn_config
  if possible in tests in preference to overloading setUpConnectionOpen().

- Explicitly call close on extra connections created dynamically.

- Remove some unused code.
2015-11-30 16:50:15 -05:00
Keith Bostic
9ead717057 Merge branch 'develop' into wt-2247-column-store-splits 2015-11-30 07:45:59 -05:00
Keith Bostic
2f56217e90 Merge branch 'develop' into wt-2242-dead-tree-eviction 2015-11-30 07:22:32 -05:00
Keith Bostic
c9a74e5c41 Merge branch 'develop' into wt-2247-column-store-splits 2015-11-30 07:14:50 -05:00
Michael Cahill
8326df6b76 Merge branch 'develop' into mongodb-3.2 2015-11-30 15:02:38 +11:00
Keith Bostic
baecc204ae WT-2247: turn on in-memory splits for fixed-length column-store pages. 2015-11-28 15:37:07 -05:00
Keith Bostic
bd8889a963 WT-2247: variable-length column-store in-memory page splits. 2015-11-28 14:43:00 -05:00
Keith Bostic
3627bb27bf Merge branch 'develop' into wt-2242-dead-tree-eviction 2015-11-27 20:13:23 -05:00
Keith Bostic
0480c1aadd Fix a few comments around cursor in-use count support. 2015-11-27 19:57:38 -05:00
Keith Bostic
febc7d2296 WT-2242: If walking a dead file, take lots of pages, they're likely
better candidates for eviction.
2015-11-27 15:32:18 -05:00
Keith Bostic
bab08434b9 WT-2242: Don't treat internal pages from dead trees as special, they may
have in-memory children and aren't necessarily great choices for eviction.
2015-11-27 15:17:58 -05:00
Keith Bostic
06da057995 Revert "WT-2242: If we find a dead tree, keep hammering at it until there"
This reverts commit c7a063b00c.
2015-11-27 15:11:21 -05:00
Keith Bostic
9a2b876b4f Merge branch 'develop' into wt-2242-dead-tree-eviction 2015-11-27 15:10:24 -05:00
Keith Bostic
c7a063b00c WT-2242: If we find a dead tree, keep hammering at it until there
aren't any more pages left.
2015-11-25 18:49:20 -05:00
Keith Bostic
0316f33139 WT-2242: clear any dead tree's no-eviction flag, otherwise we can't
evict a dead, cache-resident tree.
2015-11-25 18:05:32 -05:00
Keith Bostic
78db20ee1f WT-2242: add dead trees to the list of reasons we'll immediately choose
a page for eviction.
2015-11-25 17:50:58 -05:00
Keith Bostic
a0eafaf7a5 Minor cleanup, use true/false instead of 1/0. 2015-11-25 17:43:34 -05:00
Keith Bostic
cc82db6e47 WT-2242: clear the eviction priority of any dead tree, otherwise we'll
ignore it until we get aggressive.

Minor cleanup in the bloom code, we have a session-referenced tree
handle on return from __wt_open_cursor, use it instead of reaching
through the cursor.
2015-11-25 17:40:31 -05:00
Keith Bostic
fbe3e83b51 WT-2242: preferentially choose pages from dead trees, ignore their
read-generation numbers.
2015-11-25 17:24:36 -05:00
Keith Bostic
b65381f64c Merge branch 'develop' into mongodb-3.2 2015-11-24 11:29:41 -05:00
Michael Cahill
0019262fed Merge branch 'develop' into mongodb-3.2 2015-11-24 21:59:04 +11:00
Keith Bostic
4d72349b8a Merge branch 'develop' into mongodb-3.2 2015-11-23 09:00:49 -05:00
Michael Cahill
4898aa408f Merge branch 'develop' into mongodb-3.2 2015-11-20 16:58:33 +11:00
Michael Cahill
9d375e3416 Merge branch 'develop' into mongodb-3.2 2015-11-19 17:18:28 +11:00
Keith Bostic
e35e127c41 Merge branch 'develop' into wt-2073-metadata-cleanup 2015-11-17 09:51:13 -05:00
Keith Bostic
003fd80c58 Merge branch 'develop' into wt-2073-metadata-cleanup 2015-11-14 08:37:38 -05:00
Michael Cahill
d9ec1ff8ec Merge branch 'develop' into mongodb-3.2 2015-11-11 16:27:42 +11:00
Keith Bostic
057ba28980 __schema_open_table() needs to release the cursor on success. 2015-11-07 16:25:07 -05:00
Keith Bostic
5e50a42e3c Avoid s_style, it thinks "return.*;" is a line of C that needs fixing. 2015-11-07 16:22:01 -05:00
Keith Bostic
092f8a8f69 Minor cleanups & restructuring, fix a typo. 2015-11-07 16:21:01 -05:00
Keith Bostic
d0260a9107 Rework the metadata cursor change to transparently support opening
multiple metadata cursors at the same time.
2015-11-07 16:06:24 -05:00
Keith Bostic
e760f35e97 Merge branch 'develop' into wt-2073-metadata-cleanup 2015-11-07 14:34:49 -05:00
Keith Bostic
465dca8b46 Merge branch 'develop' into mongodb-3.2 2015-11-03 10:33:14 -05:00
Alex Gorrod
f95877af13 Merge branch 'develop' into mongodb-3.2 2015-11-03 22:18:00 +11:00
Alex Gorrod
62c1a7aa36 Merge branch 'develop' into mongodb-3.2 2015-11-02 03:59:53 +00:00
Michael Cahill
0dc3f20df6 Merge branch 'develop' into mongodb-3.2 2015-11-02 11:43:14 +11:00
Keith Bostic
d25a46591c WT-2073: minor cleanup, make the LAS cursor open code look like the
metadata cursor open code: the underlying function is responsible for
saving/restoring the session's data-handle, both are named XXX_open.
2015-10-20 21:03:26 -04:00
Keith Bostic
d653c60ea7 WT-2073: review comments, rename __wt_metadata_cursor to
__wt_metadata_cursor_open __wt_metadata_session_cursor to
__wt_metadata_cursor.
2015-10-20 20:47:24 -04:00
Keith Bostic
7f62733d13 WT-2073: change the open-index and open-table code to use the session's
cached metadata cursor instead of opening a new one.
2015-10-20 17:21:54 -04:00
Keith Bostic
d6e30284af WT-2073: Change __metadata_load_bulk() to use the session's cached
metadata cursor instead of opening a new one.
2015-10-20 17:03:51 -04:00
Keith Bostic
d992bb7b58 WT-2073: __wt_meta_btree_apply can't use the cached session cursor,
add a comment that explains why.

Split the __wt_meta_btree_apply() function into two parts so we don't
need to hand-craft the save/restore of the session's data-handle and
don't need to jump to an error label.
2015-10-20 16:40:43 -04:00
Keith Bostic
bab02d0cdb WT-2073: whitespace 2015-10-20 16:16:02 -04:00
Keith Bostic
eb9deee8be WT-2073: __wt_meta_btree_apply() doesn't need a tret variable, it can just
use ret instead.
2015-10-20 16:12:36 -04:00
Keith Bostic
5eef7e4b84 WT-2073, document we're not using the cached session metadata cursor
for an external metadata cursor.
2015-10-20 14:56:45 -04:00
Keith Bostic
f0b4417c90 WT-2073: change hot backup to use the existing WT_SESSION metadata
cursor instead of opening a new one.
2015-10-20 14:55:04 -04:00
Keith Bostic
87530f25db WT-2073: cache a metadata WT_CURSOR in the WT_SESSION, rather than a
WT_DATA_HANDLE.
2015-10-20 14:43:36 -04:00
Keith Bostic
166cce8ff4 WT-2073: "overwrite" is the default, there's no reason to specify it. 2015-10-19 16:03:44 -04:00
Michael Cahill
0537648e03 Merge branch 'develop' into mongodb-3.2 2015-10-09 17:07:24 +11:00
Alex Gorrod
3c856645c8 Merge branch 'develop' into mongodb-3.2 2015-09-30 15:01:57 +10:00
Michael Cahill
10208e8284 Merge branch 'develop' into mongodb-3.2 2015-09-25 15:00:04 +10:00
Michael Cahill
16e3e48d98 Merge branch 'develop' into mongodb-3.2 2015-09-18 12:56:14 +10:00
Michael Cahill
5205bb1f0f Merge branch 'develop' into mongodb-3.2 2015-09-11 16:23:01 +10:00
Michael Cahill
dca63120b7 Merge branch 'develop' into mongodb-3.2 2015-09-11 12:21:49 +10:00
sueloverso
0cccab30c0 WT-2064 Don't spin indefinitely waiting for the handle list lock in eviction
Merge pull request #2155 from wiredtiger/WT-2064

(cherry picked from commit 66757f7247)
2015-08-28 11:48:29 +10:00
Alex Gorrod
578a856c19 Merge pull request #2156 from wiredtiger/WT-2066
WT-2066 - Update the oldest transaction ID from eviction
(cherry picked from commit 8f42f02d3c)
2015-08-28 11:47:56 +10:00
Alex Gorrod
a85c5cda41 Merge pull request #2152 from wiredtiger/WT-2062
WT-2062 Try harder to make progress on in-memory splits
(cherry picked from commit 3e0c7bfa3a)
2015-08-28 11:47:30 +10:00
Michael Cahill
6da2dc175b Merge commit '12044d22cce1a79804254ac9c80b1120701bd7c8' into mongodb-3.2 2015-08-28 11:45:48 +10:00
Michael Cahill
7ffa315e39 Merge branch 'develop' into mongodb-3.2 2015-08-18 10:25:36 +10:00
Michael Cahill
26d1ad271f Merge branch 'develop' into mongodb-3.2 2015-08-12 20:36:04 +10:00
Alex Gorrod
fdedd3621c Merge branch 'develop' into mongodb-3.2 2015-07-23 15:53:52 +10:00
Alex Gorrod
4187f419f8 Merge branch 'develop' into mongodb-3.2 2015-07-23 15:50:57 +10:00
Michael Cahill
42823c9682 Merge branch 'develop' into mongodb-3.2 2015-07-17 22:19:04 +10:00
Alex Gorrod
fbaf1cf4f5 Merge branch 'develop' into mongodb-3.2 2015-06-26 05:09:48 +00:00
Alex Gorrod
3d845c98cb Merge branch 'develop' into mongodb-3.2 2015-06-10 18:54:48 +00:00
Michael Cahill
1d2fe8a145 Merge branch 'develop' into mongodb-3.2 2015-06-09 01:26:55 +10:00
Alex Gorrod
bdaaaec87d Merge branch 'develop' into mongodb-3.2 2015-05-29 00:19:26 +00:00
Michael Cahill
35cc116acd Merge branch 'develop' into mongodb-3.2 2015-05-18 15:02:56 +10:00
Alex Gorrod
cbe0fad3e9 Merge branch 'develop' into mongodb-3.2 2015-05-15 06:07:13 +00:00
Michael Cahill
4f9aa1c548 Merge branch 'develop' into mongodb-3.2 2015-05-08 14:19:20 +10:00
Michael Cahill
1f44c05f91 Merge branch 'develop' into mongodb-3.2 2015-04-27 17:43:11 +10:00
Michael Cahill
e31aa8cf29 Merge branch 'develop' into mongodb-3.2 2015-04-27 17:23:58 +10:00
Michael Cahill
c90bc747e1 Merge branch 'develop' into mongodb-3.2 2015-04-24 17:17:50 +10:00
Alex Gorrod
2c1b7aa80b Update MongoDB changelog with latest merge commits. 2015-04-23 17:28:27 +10:00
Alex Gorrod
41762ae13c Merge branch 'develop' into mongodb-3.2 2015-04-23 17:25:06 +10:00
Alex Gorrod
f7691f63a6 Add long version of commit log to NEWS.MONGODB 2015-04-23 17:21:01 +10:00
Alex Gorrod
9be5497753 Add in MongoDB changelog from 3.0 2015-04-23 11:43:19 +10:00
574 changed files with 6900 additions and 2306 deletions

View File

@@ -1,4 +1,4 @@
Copyright (c) 2014-2015 MongoDB, Inc.
Copyright (c) 2014-2016 MongoDB, Inc.
Copyright (c) 2008-2014 WiredTiger, Inc.
All rights reserved.

2523
NEWS.MONGODB Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -290,6 +290,7 @@ wtbin = env.Program("wt", [
"src/utilities/util_misc.c",
"src/utilities/util_printlog.c",
"src/utilities/util_read.c",
"src/utilities/util_rebalance.c",
"src/utilities/util_rename.c",
"src/utilities/util_salvage.c",
"src/utilities/util_stat.c",
@@ -458,6 +459,7 @@ t = env.Program("wtperf", [
"bench/wtperf/misc.c",
"bench/wtperf/track.c",
"bench/wtperf/wtperf.c",
"bench/wtperf/wtperf_throttle.c",
"bench/wtperf/wtperf_truncate.c",
],
LIBS=[wtlib, shim] + wtlibs)

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -5,7 +5,8 @@ LDADD = $(top_builddir)/libwiredtiger.la -lm
noinst_PROGRAMS = wtperf
wtperf_LDFLAGS = -static
wtperf_SOURCES =\
config.c misc.c track.c wtperf.c wtperf_truncate.c wtperf.h wtperf_opt.i
config.c idle_table_cycle.c misc.c track.c wtperf.c \
wtperf.h wtperf_opt.i wtperf_throttle.c wtperf_truncate.c
TESTS = smoke.sh
AM_TESTS_ENVIRONMENT = rm -rf WT_TEST ; mkdir WT_TEST ;

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -55,29 +55,25 @@ int
config_assign(CONFIG *dest, const CONFIG *src)
{
CONFIG_QUEUE_ENTRY *conf_line, *tmp_line;
size_t i, len;
size_t i;
char *newstr, **pstr;
config_free(dest);
memcpy(dest, src, sizeof(CONFIG));
if (src->uris != NULL) {
dest->uris = calloc(src->table_count, sizeof(char *));
if (dest->uris == NULL)
return (enomem(dest));
dest->uris = dcalloc(src->table_count, sizeof(char *));
for (i = 0; i < src->table_count; i++)
dest->uris[i] = strdup(src->uris[i]);
dest->uris[i] = dstrdup(src->uris[i]);
}
dest->ckptthreads = NULL;
dest->popthreads = NULL;
dest->workers = NULL;
if (src->base_uri != NULL)
dest->base_uri = strdup(src->base_uri);
dest->base_uri = dstrdup(src->base_uri);
if (src->workload != NULL) {
dest->workload = calloc(WORKLOAD_MAX, sizeof(WORKLOAD));
if (dest->workload == NULL)
return (enomem(dest));
dest->workload = dcalloc(WORKLOAD_MAX, sizeof(WORKLOAD));
memcpy(dest->workload,
src->workload, WORKLOAD_MAX * sizeof(WORKLOAD));
}
@@ -88,10 +84,7 @@ config_assign(CONFIG *dest, const CONFIG *src)
pstr = (char **)
((u_char *)dest + config_opts[i].offset);
if (*pstr != NULL) {
len = strlen(*pstr) + 1;
if ((newstr = malloc(len)) == NULL)
return (enomem(src));
strncpy(newstr, *pstr, len);
newstr = dstrdup(*pstr);
*pstr = newstr;
}
}
@@ -101,12 +94,8 @@ config_assign(CONFIG *dest, const CONFIG *src)
/* Clone the config string information into the new cfg object */
TAILQ_FOREACH(conf_line, &src->config_head, c) {
len = strlen(conf_line->string);
if ((tmp_line = calloc(sizeof(CONFIG_QUEUE_ENTRY), 1)) == NULL)
return (enomem(src));
if ((tmp_line->string = calloc(len + 1, 1)) == NULL)
return (enomem(src));
strncpy(tmp_line->string, conf_line->string, len);
tmp_line = dcalloc(sizeof(CONFIG_QUEUE_ENTRY), 1);
tmp_line->string = dstrdup(conf_line->string);
TAILQ_INSERT_TAIL(&dest->config_head, tmp_line, c);
}
return (0);
@@ -212,8 +201,7 @@ config_threads(CONFIG *cfg, const char *config, size_t len)
cfg->workers_cnt = 0;
}
/* Allocate the workload array. */
if ((cfg->workload = calloc(WORKLOAD_MAX, sizeof(WORKLOAD))) == NULL)
return (enomem(cfg));
cfg->workload = dcalloc(WORKLOAD_MAX, sizeof(WORKLOAD));
cfg->workload_cnt = 0;
/*
@@ -249,8 +237,7 @@ config_threads(CONFIG *cfg, const char *config, size_t len)
continue;
}
if (STRING_MATCH("throttle", k.str, k.len)) {
if ((workp->throttle = v.val) < 0)
goto err;
workp->throttle = (uint64_t)v.val;
continue;
}
if (STRING_MATCH("insert", k.str, k.len) ||
@@ -426,13 +413,10 @@ config_opt(CONFIG *cfg, WT_CONFIG_ITEM *k, WT_CONFIG_ITEM *v)
strp = (char **)valueloc;
newlen = v->len + 1;
if (*strp == NULL) {
if ((newstr = calloc(newlen, sizeof(char))) == NULL)
return (enomem(cfg));
strncpy(newstr, v->str, v->len);
newstr = dstrdup(v->str);
} else {
newlen += (strlen(*strp) + 1);
if ((newstr = calloc(newlen, sizeof(char))) == NULL)
return (enomem(cfg));
newstr = dcalloc(newlen, sizeof(char));
snprintf(newstr, newlen,
"%s,%*s", *strp, (int)v->len, v->str);
/* Free the old value now we've copied it. */
@@ -457,10 +441,11 @@ config_opt(CONFIG *cfg, WT_CONFIG_ITEM *k, WT_CONFIG_ITEM *v)
}
strp = (char **)valueloc;
free(*strp);
if ((newstr = malloc(v->len + 1)) == NULL)
return (enomem(cfg));
strncpy(newstr, v->str, v->len);
newstr[v->len] = '\0';
/*
* We duplicate the string to len rather than len+1 as we want
* to truncate the trailing quotation mark.
*/
newstr = dstrndup(v->str, v->len);
*strp = newstr;
break;
}
@@ -495,11 +480,7 @@ config_opt_file(CONFIG *cfg, const char *filename)
goto err;
}
buf_size = (size_t)sb.st_size;
file_buf = calloc(buf_size + 2, 1);
if (file_buf == NULL) {
ret = ENOMEM;
goto err;
}
file_buf = dcalloc(buf_size + 2, 1);
read_size = read(fd, file_buf, buf_size);
if (read_size == -1
#ifndef _WIN32
@@ -595,7 +576,6 @@ config_opt_line(CONFIG *cfg, const char *optstr)
WT_CONFIG_PARSER *scan;
size_t len;
int ret, t_ret;
char *string_copy;
len = strlen(optstr);
if ((ret = wiredtiger_config_parser_open(
@@ -610,12 +590,8 @@ config_opt_line(CONFIG *cfg, const char *optstr)
* any parsed from the original config. We allocate len + 1 to allow for
* a null byte to be added.
*/
if ((string_copy = calloc(len + 1, 1)) == NULL)
return (enomem(cfg));
strncpy(string_copy, optstr, len);
config_line = calloc(sizeof(CONFIG_QUEUE_ENTRY), 1);
config_line->string = string_copy;
config_line = dcalloc(sizeof(CONFIG_QUEUE_ENTRY), 1);
config_line->string = dstrdup(optstr);
TAILQ_INSERT_TAIL(&cfg->config_head, config_line, c);
while (ret == 0) {
@@ -647,8 +623,7 @@ config_opt_str(CONFIG *cfg, const char *name, const char *value)
char *optstr;
/* name="value" */
if ((optstr = malloc(strlen(name) + strlen(value) + 4)) == NULL)
return (enomem(cfg));
optstr = dmalloc(strlen(name) + strlen(value) + 4);
sprintf(optstr, "%s=\"%s\"", name, value);
ret = config_opt_line(cfg, optstr);
free(optstr);
@@ -747,13 +722,9 @@ config_to_file(CONFIG *cfg)
fp = NULL;
/* Backup the config */
req_len = strlen(cfg->home) + 100;
if ((path = calloc(req_len, 1)) == NULL) {
(void)enomem(cfg);
goto err;
}
snprintf(path, req_len + 14, "%s/CONFIG.wtperf", cfg->home);
req_len = strlen(cfg->home) + strlen("/CONFIG.wtperf") + 1;
path = dcalloc(req_len, 1);
snprintf(path, req_len, "%s/CONFIG.wtperf", cfg->home);
if ((fp = fopen(path, "w")) == NULL) {
lprintf(cfg, errno, 0, "%s", path);
goto err;

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -0,0 +1,192 @@
/*-
* 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 "wtperf.h"
static int
check_timing(CONFIG *cfg,
const char *name, struct timespec start, struct timespec *stop)
{
uint64_t last_interval;
int ret;
if ((ret = __wt_epoch(NULL, stop)) != 0) {
lprintf(cfg, ret, 0,
"Get time failed in cycle_idle_tables.");
cfg->error = ret;
return (ret);
}
last_interval = (uint64_t)(WT_TIMEDIFF_SEC(*stop, start));
if (last_interval > cfg->idle_table_cycle) {
lprintf(cfg, ret, 0,
"Cycling idle table failed because %s took %" PRIu64
" seconds which is longer than configured acceptable"
" maximum of %" PRIu32 ".",
name, last_interval, cfg->idle_table_cycle);
cfg->error = ETIMEDOUT;
return (ETIMEDOUT);
}
return (0);
}
/*
* Regularly create, open a cursor and drop a table.
* Measure how long each step takes, and flag an error if it exceeds the
* configured maximum.
*/
static void *
cycle_idle_tables(void *arg)
{
struct timespec start, stop;
CONFIG *cfg;
WT_SESSION *session;
WT_CURSOR *cursor;
int cycle_count, ret;
char uri[512];
cfg = (CONFIG *)arg;
cycle_count = 0;
if ((ret = cfg->conn->open_session(
cfg->conn, NULL, cfg->sess_config, &session)) != 0) {
lprintf(cfg, ret, 0,
"Error opening a session on %s", cfg->home);
return (NULL);
}
for (cycle_count = 0; cfg->idle_cycle_run; ++cycle_count) {
snprintf(uri, 512, "%s_cycle%07d", cfg->uris[0], cycle_count);
/* Don't busy cycle in this loop. */
__wt_sleep(1, 0);
/* Setup a start timer. */
if ((ret = __wt_epoch(NULL, &start)) != 0) {
lprintf(cfg, ret, 0,
"Get time failed in cycle_idle_tables.");
cfg->error = ret;
return (NULL);
}
/* Create a table. */
if ((ret = session->create(
session, uri, cfg->table_config)) != 0) {
if (ret == EBUSY)
continue;
lprintf(cfg, ret, 0,
"Table create failed in cycle_idle_tables.");
cfg->error = ret;
return (NULL);
}
if (check_timing(cfg, "create", start, &stop) != 0)
return (NULL);
start = stop;
/* Open and close cursor. */
if ((ret = session->open_cursor(
session, uri, NULL, NULL, &cursor)) != 0) {
lprintf(cfg, ret, 0,
"Cursor open failed in cycle_idle_tables.");
cfg->error = ret;
return (NULL);
}
if ((ret = cursor->close(cursor)) != 0) {
lprintf(cfg, ret, 0,
"Cursor close failed in cycle_idle_tables.");
cfg->error = ret;
return (NULL);
}
if (check_timing(cfg, "cursor", start, &stop) != 0)
return (NULL);
start = stop;
/*
* Drop the table. Keep retrying on EBUSY failure - it is an
* expected return when checkpoints are happening.
*/
while ((ret = session->drop(session, uri, "force")) == EBUSY)
__wt_sleep(1, 0);
if (ret != 0 && ret != EBUSY) {
lprintf(cfg, ret, 0,
"Table drop failed in cycle_idle_tables.");
cfg->error = ret;
return (NULL);
}
if (check_timing(cfg, "drop", start, &stop) != 0)
return (NULL);
}
return (NULL);
}
/*
* Start a thread the creates and drops tables regularly.
* TODO: Currently accepts a pthread_t as a parameter, since it is not
* possible to portably statically initialize it in the global configuration
* structure. Should reshuffle the configuration structure so explicit static
* initialization isn't necessary.
*/
int
start_idle_table_cycle(CONFIG *cfg, pthread_t *idle_table_cycle_thread)
{
pthread_t thread_id;
int ret;
if (cfg->idle_table_cycle == 0)
return (0);
cfg->idle_cycle_run = true;
if ((ret = pthread_create(
&thread_id, NULL, cycle_idle_tables, cfg)) != 0) {
lprintf(
cfg, ret, 0, "Error creating idle table cycle thread.");
cfg->idle_cycle_run = false;
return (ret);
}
*idle_table_cycle_thread = thread_id;
return (0);
}
int
stop_idle_table_cycle(CONFIG *cfg, pthread_t idle_table_cycle_thread)
{
int ret;
if (cfg->idle_table_cycle == 0 || !cfg->idle_cycle_run)
return (0);
cfg->idle_cycle_run = false;
if ((ret = pthread_join(idle_table_cycle_thread, NULL)) != 0) {
lprintf(
cfg, ret, 0, "Error joining idle table cycle thread.");
return (ret);
}
return (0);
}

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -28,19 +28,6 @@
#include "wtperf.h"
int
enomem(const CONFIG *cfg)
{
const char *msg;
msg = "Unable to allocate memory";
if (cfg->logf == NULL)
fprintf(stderr, "%s\n", msg);
else
lprintf(cfg, ENOMEM, 0, "%s", msg);
return (ENOMEM);
}
/* Setup the logging output mechanism. */
int
setup_log_file(CONFIG *cfg)
@@ -53,9 +40,8 @@ setup_log_file(CONFIG *cfg)
if (cfg->verbose < 1)
return (0);
if ((fname = calloc(strlen(cfg->monitor_dir) +
strlen(cfg->table_name) + strlen(".stat") + 2, 1)) == NULL)
return (enomem(cfg));
fname = dcalloc(strlen(cfg->monitor_dir) +
strlen(cfg->table_name) + strlen(".stat") + 2, 1);
sprintf(fname, "%s/%s.stat", cfg->monitor_dir, cfg->table_name);
cfg->logf = fopen(fname, "w");

View File

@@ -0,0 +1,19 @@
# A stress configuration, to create long running checkpoints and see how
# they interfere with schema level operations (table create, drop).
# Setup a cache size large enough that checkpoints can take a long time.
conn_config="cache_size=8GB,log=(enabled=false),checkpoint=(wait=30)"
table_config="leaf_page_max=4k,internal_page_max=16k,type=file"
icount=10000000
table_count_idle=100
# Turn on create/drop of idle tables, and error if a single operation takes
# more than 5 seconds.
idle_table_cycle=5
populate_threads=5
checkpoint_threads=0
report_interval=5
# 100 million
random_range=100000000
run_time=1000
# Setup a workload that dirties a lot of the cache
threads=((count=2,reads=1),(count=2,inserts=1),(count=2,updates=1))
value_sz=500

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Public Domain 2014-2015 MongoDB, Inc.
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -57,6 +57,7 @@ static const CONFIG default_cfg = {
0, /* thread error */
0, /* notify threads to stop */
0, /* in warmup phase */
false, /* Signal for idle cycle thread */
0, /* total seconds running */
0, /* has truncate */
{NULL, NULL}, /* the truncate queue */
@@ -72,7 +73,6 @@ static const char * const debug_tconfig = "";
static void *checkpoint_worker(void *);
static int create_tables(CONFIG *);
static int create_uris(CONFIG *);
static int drop_all_tables(CONFIG *);
static int execute_populate(CONFIG *);
static int execute_workload(CONFIG *);
@@ -87,7 +87,7 @@ static int start_threads(CONFIG *,
static int stop_threads(CONFIG *, u_int, CONFIG_THREAD *);
static void *thread_run_wtperf(void *);
static void *worker(void *);
static void worker_throttle(int64_t, int64_t *, struct timespec *);
static uint64_t wtperf_rand(CONFIG_THREAD *);
static uint64_t wtperf_value_range(CONFIG *);
@@ -422,7 +422,7 @@ do_range_reads(CONFIG *cfg, WT_CURSOR *cursor)
static void *
worker(void *arg)
{
struct timespec start, stop, interval;
struct timespec start, stop;
CONFIG *cfg;
CONFIG_THREAD *thread;
TRACK *trk;
@@ -430,7 +430,7 @@ worker(void *arg)
WT_CURSOR **cursors, *cursor, *tmp_cursor;
WT_SESSION *session;
size_t i;
int64_t ops, ops_per_txn, throttle_ops;
int64_t ops, ops_per_txn;
uint64_t next_val, usecs;
uint8_t *op, *op_end;
int measure_latency, ret, truncated;
@@ -445,19 +445,13 @@ worker(void *arg)
ops_per_txn = thread->workload->ops_per_txn;
session = NULL;
trk = NULL;
throttle_ops = 0;
if ((ret = conn->open_session(
conn, NULL, cfg->sess_config, &session)) != 0) {
lprintf(cfg, ret, 0, "worker: WT_CONNECTION.open_session");
goto err;
}
cursors = calloc(cfg->table_count, sizeof(WT_CURSOR *));
if (cursors == NULL) {
lprintf(cfg, ENOMEM, 0,
"worker: couldn't allocate cursor array");
goto err;
}
cursors = dcalloc(cfg->table_count, sizeof(WT_CURSOR *));
for (i = 0; i < cfg->table_count_idle; i++) {
snprintf(buf, 512, "%s_idle%05d", cfg->uris[0], (int)i);
if ((ret = session->open_cursor(
@@ -483,10 +477,8 @@ worker(void *arg)
}
/* Setup the timer for throttling. */
if (thread->workload->throttle != 0 &&
(ret = __wt_epoch(NULL, &interval)) != 0) {
lprintf(cfg, ret, 0, "Get time call failed");
(ret = setup_throttle(thread)) != 0)
goto err;
}
/* Setup for truncate */
if (thread->workload->truncate != 0)
@@ -736,13 +728,11 @@ op_err: if (ret == WT_ROLLBACK && ops_per_txn != 0) {
op = thread->workload->ops;
/*
* Check throttling periodically to avoid taking too
* many time samples.
* Decrement throttle ops and check if we should sleep
* and then get more work to perform.
*/
if (thread->workload->throttle != 0 &&
throttle_ops++ % THROTTLE_OPS == 0)
worker_throttle(thread->workload->throttle,
&throttle_ops, &interval);
if (--thread->throttle_cfg.ops_count == 0)
worker_throttle(thread);
}
if ((ret = session->close(session, NULL)) != 0) {
@@ -917,12 +907,7 @@ populate_thread(void *arg)
cursor_config =
(cfg->populate_threads == 1 && !cfg->index) ? "bulk" : NULL;
/* Create the cursors. */
cursors = calloc(cfg->table_count, sizeof(WT_CURSOR *));
if (cursors == NULL) {
lprintf(cfg, ENOMEM, 0,
"worker: couldn't allocate cursor array");
goto err;
}
cursors = dcalloc(cfg->table_count, sizeof(WT_CURSOR *));
for (i = 0; i < cfg->table_count; i++) {
if ((ret = session->open_cursor(
session, cfg->uris[i], NULL,
@@ -1168,10 +1153,7 @@ monitor(void *arg)
/* Open the logging file. */
len = strlen(cfg->monitor_dir) + 100;
if ((path = malloc(len)) == NULL) {
(void)enomem(cfg);
goto err;
}
path = dmalloc(len);
snprintf(path, len, "%s/monitor", cfg->monitor_dir);
if ((fp = fopen(path, "w")) == NULL) {
lprintf(cfg, errno, 0, "%s", path);
@@ -1378,6 +1360,7 @@ execute_populate(CONFIG *cfg)
struct timespec start, stop;
CONFIG_THREAD *popth;
WT_ASYNC_OP *asyncop;
pthread_t idle_table_cycle_thread;
size_t i;
uint64_t last_ops, msecs, print_ops_sec;
uint32_t interval, tables;
@@ -1390,11 +1373,13 @@ execute_populate(CONFIG *cfg)
" populate thread(s) for %" PRIu32 " items",
cfg->populate_threads, cfg->icount);
/* Start cycling idle tables if configured. */
if ((ret = start_idle_table_cycle(cfg, &idle_table_cycle_thread)) != 0)
return (ret);
cfg->insert_key = 0;
if ((cfg->popthreads =
calloc(cfg->populate_threads, sizeof(CONFIG_THREAD))) == NULL)
return (enomem(cfg));
cfg->popthreads = dcalloc(cfg->populate_threads, sizeof(CONFIG_THREAD));
if (cfg->use_asyncops > 0) {
lprintf(cfg, 0, 1, "Starting %" PRIu32 " async thread(s)",
cfg->async_threads);
@@ -1519,6 +1504,11 @@ execute_populate(CONFIG *cfg)
(uint64_t)(WT_TIMEDIFF_SEC(stop, start)));
assert(tables == 0);
}
/* Stop cycling idle tables. */
if ((ret = stop_idle_table_cycle(cfg, idle_table_cycle_thread)) != 0)
return (ret);
return (0);
}
@@ -1568,6 +1558,7 @@ execute_workload(CONFIG *cfg)
{
CONFIG_THREAD *threads;
WORKLOAD *workp;
pthread_t idle_table_cycle_thread;
uint64_t last_ckpts, last_inserts, last_reads, last_truncates;
uint64_t last_updates;
uint32_t interval, run_ops, run_time;
@@ -1583,15 +1574,15 @@ execute_workload(CONFIG *cfg)
last_updates = 0;
ret = 0;
/* Start cycling idle tables. */
if ((ret = start_idle_table_cycle(cfg, &idle_table_cycle_thread)) != 0)
return (ret);
if (cfg->warmup != 0)
cfg->in_warmup = 1;
/* Allocate memory for the worker threads. */
if ((cfg->workers =
calloc((size_t)cfg->workers_cnt, sizeof(CONFIG_THREAD))) == NULL) {
ret = enomem(cfg);
goto err;
}
cfg->workers = dcalloc((size_t)cfg->workers_cnt, sizeof(CONFIG_THREAD));
if (cfg->use_asyncops > 0) {
lprintf(cfg, 0, 1, "Starting %" PRIu32 " async thread(s)",
@@ -1682,6 +1673,10 @@ execute_workload(CONFIG *cfg)
/* Notify the worker threads they are done. */
err: cfg->stop = 1;
/* Stop cycling idle tables. */
if ((ret = stop_idle_table_cycle(cfg, idle_table_cycle_thread)) != 0)
return (ret);
if ((t_ret = stop_threads(
cfg, (u_int)cfg->workers_cnt, cfg->workers)) != 0 && ret == 0)
ret = t_ret;
@@ -1763,27 +1758,17 @@ out: return (ret);
/*
* Populate the uri array if more than one table is being used.
*/
static int
static void
create_uris(CONFIG *cfg)
{
size_t base_uri_len;
uint32_t i;
int ret;
char *uri;
ret = 0;
base_uri_len = strlen(cfg->base_uri);
cfg->uris = calloc(cfg->table_count, sizeof(char *));
if (cfg->uris == NULL) {
ret = ENOMEM;
goto err;
}
cfg->uris = dcalloc(cfg->table_count, sizeof(char *));
for (i = 0; i < cfg->table_count; i++) {
uri = cfg->uris[i] = calloc(base_uri_len + 5, 1);
if (uri == NULL) {
ret = ENOMEM;
goto err;
}
uri = cfg->uris[i] = dcalloc(base_uri_len + 5, 1);
/*
* If there is only one table, just use base name.
*/
@@ -1792,13 +1777,6 @@ create_uris(CONFIG *cfg)
else
sprintf(uri, "%s%05d", cfg->base_uri, i);
}
err: if (ret != 0 && cfg->uris != NULL) {
for (i = 0; i < cfg->table_count; i++)
free(cfg->uris[i]);
free(cfg->uris);
cfg->uris = NULL;
}
return (ret);
}
static int
@@ -1880,40 +1858,22 @@ start_all_runs(CONFIG *cfg)
return (start_run(cfg));
/* Allocate an array to hold our config struct copies. */
configs = calloc(cfg->database_count, sizeof(CONFIG *));
if (configs == NULL)
return (ENOMEM);
configs = dcalloc(cfg->database_count, sizeof(CONFIG *));
/* Allocate an array to hold our thread IDs. */
threads = calloc(cfg->database_count, sizeof(pthread_t));
if (threads == NULL) {
ret = ENOMEM;
goto err;
}
threads = dcalloc(cfg->database_count, sizeof(pthread_t));
home_len = strlen(cfg->home);
cmd_len = (home_len * 2) + 30; /* Add some slop. */
cmd_buf = calloc(cmd_len, 1);
if (cmd_buf == NULL) {
ret = ENOMEM;
goto err;
}
cmd_buf = dcalloc(cmd_len, 1);
for (i = 0; i < cfg->database_count; i++) {
next_cfg = calloc(1, sizeof(CONFIG));
if (next_cfg == NULL) {
ret = ENOMEM;
goto err;
}
next_cfg = dcalloc(1, sizeof(CONFIG));
configs[i] = next_cfg;
if ((ret = config_assign(next_cfg, cfg)) != 0)
goto err;
/* Setup a unique home directory for each database. */
new_home = malloc(home_len + 5);
if (new_home == NULL) {
ret = ENOMEM;
goto err;
}
new_home = dmalloc(home_len + 5);
snprintf(new_home, home_len + 5, "%s/D%02d", cfg->home, (int)i);
next_cfg->home = new_home;
@@ -2003,8 +1963,7 @@ start_run(CONFIG *cfg)
ret, 0, "Error loading Helium: %s", helium_buf);
}
if ((ret = create_uris(cfg)) != 0)
goto err;
create_uris(cfg);
if ((ret = create_tables(cfg)) != 0)
goto err;
@@ -2041,12 +2000,8 @@ start_run(CONFIG *cfg)
lprintf(cfg, 0, 1,
"Starting %" PRIu32 " checkpoint thread(s)",
cfg->checkpoint_threads);
if ((cfg->ckptthreads =
calloc(cfg->checkpoint_threads,
sizeof(CONFIG_THREAD))) == NULL) {
ret = enomem(cfg);
goto err;
}
cfg->ckptthreads = dcalloc(
cfg->checkpoint_threads, sizeof(CONFIG_THREAD));
if (start_threads(cfg, NULL, cfg->ckptthreads,
cfg->checkpoint_threads, checkpoint_worker) != 0)
goto err;
@@ -2165,9 +2120,9 @@ main(int argc, char *argv[])
switch (ch) {
case 'C':
if (user_cconfig == NULL)
user_cconfig = strdup(__wt_optarg);
user_cconfig = dstrdup(__wt_optarg);
else {
user_cconfig = realloc(user_cconfig,
user_cconfig = drealloc(user_cconfig,
strlen(user_cconfig) +
strlen(__wt_optarg) + 2);
strcat(user_cconfig, ",");
@@ -2182,9 +2137,9 @@ main(int argc, char *argv[])
break;
case 'T':
if (user_tconfig == NULL)
user_tconfig = strdup(__wt_optarg);
user_tconfig = dstrdup(__wt_optarg);
else {
user_tconfig = realloc(user_tconfig,
user_tconfig = drealloc(user_tconfig,
strlen(user_tconfig) +
strlen(__wt_optarg) + 2);
strcat(user_tconfig, ",");
@@ -2255,10 +2210,7 @@ main(int argc, char *argv[])
* to 4096 if needed.
*/
req_len = strlen(",async=(enabled=true,threads=)") + 4;
if ((cfg->async_config = calloc(req_len, 1)) == NULL) {
ret = enomem(cfg);
goto err;
}
cfg->async_config = dcalloc(req_len, 1);
snprintf(cfg->async_config, req_len,
",async=(enabled=true,threads=%d)",
cfg->async_threads);
@@ -2281,10 +2233,7 @@ main(int argc, char *argv[])
/* Build the URI from the table name. */
req_len = strlen("table:") +
strlen(HELIUM_NAME) + strlen(cfg->table_name) + 2;
if ((cfg->base_uri = calloc(req_len, 1)) == NULL) {
ret = enomem(cfg);
goto err;
}
cfg->base_uri = dcalloc(req_len, 1);
snprintf(cfg->base_uri, req_len, "table:%s%s%s",
cfg->helium_mount == NULL ? "" : HELIUM_NAME,
cfg->helium_mount == NULL ? "" : "/",
@@ -2303,10 +2252,7 @@ main(int argc, char *argv[])
req_len += strlen(cfg->async_config);
if (cfg->compress_ext != NULL)
req_len += strlen(cfg->compress_ext);
if ((cc_buf = calloc(req_len, 1)) == NULL) {
ret = enomem(cfg);
goto err;
}
cc_buf = dcalloc(req_len, 1);
/*
* This is getting hard to parse.
*/
@@ -2331,10 +2277,7 @@ main(int argc, char *argv[])
req_len += strlen(cfg->compress_table);
if (cfg->index)
req_len += strlen(INDEX_COL_NAMES);
if ((tc_buf = calloc(req_len, 1)) == NULL) {
ret = enomem(cfg);
goto err;
}
tc_buf = dcalloc(req_len, 1);
/*
* This is getting hard to parse.
*/
@@ -2353,10 +2296,7 @@ main(int argc, char *argv[])
if (cfg->log_partial && cfg->table_count > 1) {
req_len = strlen(cfg->table_config) +
strlen(LOG_PARTIAL_CONFIG) + 1;
if ((cfg->partial_config = calloc(req_len, 1)) == NULL) {
ret = enomem(cfg);
goto err;
}
cfg->partial_config = dcalloc(req_len, 1);
snprintf((char *)cfg->partial_config, req_len, "%s%s",
(char *)cfg->table_config, LOG_PARTIAL_CONFIG);
}
@@ -2416,10 +2356,8 @@ start_threads(CONFIG *cfg,
* don't, it's not enough memory to bother. These buffers hold
* strings: trailing NUL is included in the size.
*/
if ((thread->key_buf = calloc(cfg->key_sz, 1)) == NULL)
return (enomem(cfg));
if ((thread->value_buf = calloc(cfg->value_sz, 1)) == NULL)
return (enomem(cfg));
thread->key_buf = dcalloc(cfg->key_sz, 1);
thread->value_buf = dcalloc(cfg->value_sz, 1);
/*
* Initialize and then toss in a bit of random values if needed.
*/
@@ -2479,40 +2417,6 @@ stop_threads(CONFIG *cfg, u_int num, CONFIG_THREAD *threads)
return (0);
}
/*
* TODO: Spread the stalls out, so we don't flood at the start of each
* second and then pause. Doing this every 10th of a second is probably enough
*/
static void
worker_throttle(int64_t throttle, int64_t *ops, struct timespec *interval)
{
struct timespec now;
uint64_t usecs_to_complete;
if (*ops < throttle)
return;
/* Ignore errors, we don't really care. */
if (__wt_epoch(NULL, &now) != 0)
return;
/*
* If we've completed enough operations, reset the counters.
* If we did enough operations in less than a second, sleep for
* the rest of the second.
*/
usecs_to_complete = WT_TIMEDIFF_US(now, *interval);
if (usecs_to_complete < USEC_PER_SEC)
(void)usleep((useconds_t)(USEC_PER_SEC - usecs_to_complete));
/*
* After sleeping, set the interval to the current time.
*/
if (__wt_epoch(NULL, &now) != 0)
return;
*ops = 0;
*interval = now;
}
static int
drop_all_tables(CONFIG *cfg)
{

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -66,6 +66,7 @@
typedef struct __config CONFIG;
typedef struct __config_thread CONFIG_THREAD;
typedef struct __truncate_queue_entry TRUNCATE_QUEUE_ENTRY;
#define EXT_PFX ",extensions=("
#define EXT_SFX ")"
@@ -90,7 +91,7 @@ typedef struct {
int64_t insert; /* Insert ratio */
int64_t read; /* Read ratio */
int64_t update; /* Update ratio */
int64_t throttle; /* Maximum operations/second */
uint64_t throttle; /* Maximum operations/second */
/* Number of operations per transaction. Zero for autocommit */
int64_t ops_per_txn;
int64_t truncate; /* Truncate ratio */
@@ -106,8 +107,7 @@ typedef struct {
} WORKLOAD;
/* Steering items for the truncate workload */
typedef struct __truncate_struct TRUNCATE_CONFIG;
struct __truncate_struct {
typedef struct {
uint64_t stone_gap;
uint64_t needed_stones;
uint64_t final_stone_gap;
@@ -117,7 +117,7 @@ struct __truncate_struct {
uint64_t num_stones;
uint64_t last_key;
uint64_t catchup_multiplier;
};
} TRUNCATE_CONFIG;
/* Queue entry for use with the Truncate Logic */
struct __truncate_queue_entry {
@@ -125,7 +125,6 @@ struct __truncate_queue_entry {
uint64_t diff; /* Number of items to be truncated*/
TAILQ_ENTRY(__truncate_queue_entry) q;
};
typedef struct __truncate_queue_entry TRUNCATE_QUEUE_ENTRY;
struct __config_queue_entry {
char *string;
@@ -133,6 +132,14 @@ struct __config_queue_entry {
};
typedef struct __config_queue_entry CONFIG_QUEUE_ENTRY;
/* Steering for the throttle configuration */
typedef struct {
struct timespec last_increment; /* Time that we last added more ops */
uint64_t ops_count; /* The number of ops this increment */
uint64_t ops_per_increment; /* Ops to add per increment */
uint64_t usecs_increment; /* Time interval of each increment */
} THROTTLE_CONFIG;
#define LOG_PARTIAL_CONFIG ",log=(enabled=false)"
/*
* NOTE: If you add any fields to this structure here, you must also add
@@ -180,6 +187,8 @@ struct __config { /* Configuration structure */
volatile int stop; /* notify threads to stop */
volatile int in_warmup; /* Running warmup phase */
volatile bool idle_cycle_run; /* Signal for idle cycle thread */
volatile uint32_t totalsec; /* total seconds running */
u_int has_truncate; /* if there is a truncate workload */
@@ -264,14 +273,16 @@ struct __config_thread { /* Per-thread structure */
WORKLOAD *workload; /* Workload */
THROTTLE_CONFIG throttle_cfg; /* Throttle configuration */
TRUNCATE_CONFIG trunc_cfg; /* Truncate configuration */
TRACK ckpt; /* Checkpoint operations */
TRACK insert; /* Insert operations */
TRACK read; /* Read operations */
TRACK update; /* Update operations */
TRACK truncate; /* Truncate operations */
TRACK truncate_sleep; /* Truncate sleep operations */
TRUNCATE_CONFIG trunc_cfg; /* Truncate configuration */
};
void cleanup_truncate_config(CONFIG *);
@@ -289,11 +300,13 @@ void latency_insert(CONFIG *, uint32_t *, uint32_t *, uint32_t *);
void latency_read(CONFIG *, uint32_t *, uint32_t *, uint32_t *);
void latency_update(CONFIG *, uint32_t *, uint32_t *, uint32_t *);
void latency_print(CONFIG *);
int enomem(const CONFIG *);
int run_truncate(
CONFIG *, CONFIG_THREAD *, WT_CURSOR *, WT_SESSION *, int *);
int setup_log_file(CONFIG *);
int setup_throttle(CONFIG_THREAD*);
int setup_truncate(CONFIG *, CONFIG_THREAD *, WT_SESSION *);
int start_idle_table_cycle(CONFIG *, pthread_t *);
int stop_idle_table_cycle(CONFIG *, pthread_t);
uint64_t sum_ckpt_ops(CONFIG *);
uint64_t sum_insert_ops(CONFIG *);
uint64_t sum_pop_ops(CONFIG *);
@@ -301,6 +314,7 @@ uint64_t sum_read_ops(CONFIG *);
uint64_t sum_truncate_ops(CONFIG *);
uint64_t sum_update_ops(CONFIG *);
void usage(void);
int worker_throttle(CONFIG_THREAD*);
void lprintf(const CONFIG *, int err, uint32_t, const char *, ...)
#if defined(__GNUC__)
@@ -323,4 +337,85 @@ extract_key(char *key_buf, uint64_t *keynop)
sscanf(key_buf, "%" SCNu64, keynop);
}
/*
* die --
* Print message and exit on failure.
*/
static inline void
die(int e, const char *str)
{
fprintf(stderr, "Call to %s failed: %s", str, wiredtiger_strerror(e));
exit(EXIT_FAILURE);
}
/*
* dmalloc --
* Call malloc, dying on failure.
*/
static inline void *
dmalloc(size_t len)
{
void *p;
if ((p = malloc(len)) == NULL)
die(errno, "malloc");
return (p);
}
/*
* dcalloc --
* Call calloc, dying on failure.
*/
static inline void *
dcalloc(size_t num, size_t len)
{
void *p;
if ((p = calloc(len, num)) == NULL)
die(errno, "calloc");
return (p);
}
/*
* drealloc --
* Call realloc, dying on failure.
*/
static inline void *
drealloc(void *p, size_t len)
{
void *repl;
if ((repl = realloc(p, len)) == NULL)
die(errno, "realloc");
return (repl);
}
/*
* dstrdup --
* Call strdup, dying on failure.
*/
static inline char *
dstrdup(const char *str)
{
char *p;
if ((p = strdup(str)) == NULL)
die(errno, "strdup");
return (p);
}
/*
* dstrndup --
* Call strndup, dying on failure.
*/
static inline char *
dstrndup(const char *str, const size_t len)
{
char *p;
if ((p = strndup(str, len)) == NULL)
die(errno, "strndup");
return (p);
}
#endif

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -110,6 +110,10 @@ DEF_OPT_AS_UINT32(drop_tables, 0,
DEF_OPT_AS_UINT32(icount, 5000,
"number of records to initially populate. If multiple tables are "
"configured the count is spread evenly across all tables.")
DEF_OPT_AS_UINT32(idle_table_cycle, 0,
"Enable regular create and drop of idle tables, value is the maximum "
"number of seconds a create or drop is allowed before flagging an error. "
"Default 0 which means disabled.")
DEF_OPT_AS_BOOL(index, 0,
"Whether to create an index on the value field.")
DEF_OPT_AS_BOOL(insert_rmw, 0,

View File

@@ -0,0 +1,121 @@
/*-
* Public Domain 2014-2015 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 "wtperf.h"
/*
* Put the initial config together for running a throttled workload.
*/
int
setup_throttle(CONFIG_THREAD *thread)
{
THROTTLE_CONFIG *throttle_cfg;
throttle_cfg = &thread->throttle_cfg;
/*
* Setup how the number of operations to run each interval in order to
* meet our desired max throughput.
* - If we have a very small number of them we can do one op
* on a larger increment. Given there is overhead in throttle logic
* we want to avoid running the throttle check regularly.
* - For most workloads, we aim to do 100 ops per interval and adjust
* the sleep period accordingly.
* - For high throughput workloads, we aim to do many ops in 100us
* increments.
*/
if (thread->workload->throttle < THROTTLE_OPS) {
/* If the interval is very small, we do one operation */
throttle_cfg->usecs_increment =
USEC_PER_SEC / thread->workload->throttle;
throttle_cfg->ops_per_increment = 1;
} else if (thread->workload->throttle < USEC_PER_SEC / THROTTLE_OPS) {
throttle_cfg->usecs_increment =
USEC_PER_SEC / thread->workload->throttle * THROTTLE_OPS;
throttle_cfg->ops_per_increment = THROTTLE_OPS;
} else {
/* If the interval is large, we do more ops per interval */
throttle_cfg->usecs_increment = USEC_PER_SEC / THROTTLE_OPS;
throttle_cfg->ops_per_increment =
thread->workload->throttle / THROTTLE_OPS;
}
/* Give the queue some initial operations to work with */
throttle_cfg->ops_count = throttle_cfg->ops_per_increment;
/* Set the first timestamp of when we incremented */
WT_RET(__wt_epoch(NULL, &throttle_cfg->last_increment));
return (0);
}
/*
* Run the throttle function. We will sleep if needed and then reload the
* counter to perform more operations.
*/
int
worker_throttle(CONFIG_THREAD *thread)
{
THROTTLE_CONFIG *throttle_cfg;
struct timespec now;
uint64_t usecs_delta;
throttle_cfg = &thread->throttle_cfg;
WT_RET(__wt_epoch(NULL, &now));
/*
* If we did enough operations in the current interval, sleep for
* the rest of the interval. Then add more operations to the queue.
*/
usecs_delta = WT_TIMEDIFF_US(now, throttle_cfg->last_increment);
if (usecs_delta < throttle_cfg->usecs_increment) {
(void)usleep(
(useconds_t)(throttle_cfg->usecs_increment - usecs_delta));
throttle_cfg->ops_count =
throttle_cfg->ops_per_increment;
/*
* After sleeping, set the interval to the current time.
*/
WT_RET(__wt_epoch(NULL, &throttle_cfg->last_increment));
} else {
throttle_cfg->ops_count =
(uint64_t) (float)(usecs_delta /
throttle_cfg->usecs_increment) *
(float)throttle_cfg->ops_per_increment;
throttle_cfg->last_increment = now;
}
/*
* Take the minimum so we don't overfill the queue.
*/
throttle_cfg->ops_count =
WT_MIN(throttle_cfg->ops_count, thread->workload->throttle);
return (0);
}

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -41,7 +41,7 @@ setup_truncate(CONFIG *cfg, CONFIG_THREAD *thread, WT_SESSION *session) {
TRUNCATE_QUEUE_ENTRY *truncate_item;
WORKLOAD *workload;
WT_CURSOR *cursor;
char *key, *truncate_key;
char *key;
int ret;
uint64_t end_point, final_stone_gap, i, start_point;
@@ -102,23 +102,14 @@ setup_truncate(CONFIG *cfg, CONFIG_THREAD *thread, WT_SESSION *session) {
if (trunc_cfg->stone_gap != 0) {
trunc_cfg->expected_total = (end_point - start_point);
for (i = 1; i <= trunc_cfg->needed_stones; i++) {
truncate_key = calloc(cfg->key_sz, 1);
if (truncate_key == NULL) {
ret = enomem(cfg);
goto err;
}
truncate_item = calloc(sizeof(TRUNCATE_QUEUE_ENTRY), 1);
if (truncate_item == NULL) {
free(truncate_key);
ret = enomem(cfg);
goto err;
}
truncate_item =
dcalloc(sizeof(TRUNCATE_QUEUE_ENTRY), 1);
truncate_item->key = dcalloc(cfg->key_sz, 1);
generate_key(
cfg, truncate_key, trunc_cfg->stone_gap * i);
truncate_item->key = truncate_key;
cfg, truncate_item->key, trunc_cfg->stone_gap * i);
truncate_item->diff =
(trunc_cfg->stone_gap * i) - trunc_cfg->last_key;
TAILQ_INSERT_TAIL( &cfg->stone_head, truncate_item, q);
TAILQ_INSERT_TAIL(&cfg->stone_head, truncate_item, q);
trunc_cfg->last_key = trunc_cfg->stone_gap * i;
trunc_cfg->num_stones++;
}
@@ -137,7 +128,6 @@ run_truncate(CONFIG *cfg, CONFIG_THREAD *thread,
TRUNCATE_CONFIG *trunc_cfg;
TRUNCATE_QUEUE_ENTRY *truncate_item;
char *truncate_key;
int ret, t_ret;
uint64_t used_stone_gap;
@@ -178,21 +168,9 @@ run_truncate(CONFIG *cfg, CONFIG_THREAD *thread,
while (trunc_cfg->num_stones < trunc_cfg->needed_stones) {
trunc_cfg->last_key += used_stone_gap;
truncate_key = calloc(cfg->key_sz, 1);
if (truncate_key == NULL) {
lprintf(cfg, ENOMEM, 0,
"truncate: couldn't allocate key array");
return (ENOMEM);
}
truncate_item = calloc(sizeof(TRUNCATE_QUEUE_ENTRY), 1);
if (truncate_item == NULL) {
free(truncate_key);
lprintf(cfg, ENOMEM, 0,
"truncate: couldn't allocate item");
return (ENOMEM);
}
generate_key(cfg, truncate_key, trunc_cfg->last_key);
truncate_item->key = truncate_key;
truncate_item = dcalloc(sizeof(TRUNCATE_QUEUE_ENTRY), 1);
truncate_item->key = dcalloc(cfg->key_sz, 1);
generate_key(cfg, truncate_item->key, trunc_cfg->last_key);
truncate_item->diff = used_stone_gap;
TAILQ_INSERT_TAIL(&cfg->stone_head, truncate_item, q);
trunc_cfg->num_stones++;

View File

@@ -31,6 +31,7 @@ wt_SOURCES =\
src/utilities/util_misc.c \
src/utilities/util_printlog.c \
src/utilities/util_read.c \
src/utilities/util_rebalance.c \
src/utilities/util_rename.c \
src/utilities/util_salvage.c \
src/utilities/util_stat.c \

View File

@@ -31,6 +31,7 @@ src/btree/bt_misc.c
src/btree/bt_ovfl.c
src/btree/bt_page.c
src/btree/bt_read.c
src/btree/bt_rebalance.c
src/btree/bt_ret.c
src/btree/bt_slvg.c
src/btree/bt_split.c

6
dist/api_data.py vendored
View File

@@ -564,6 +564,7 @@ connection_runtime_config = [
'mutex',
'overflow',
'read',
'rebalance',
'reconcile',
'recovery',
'salvage',
@@ -770,6 +771,10 @@ methods = {
Config('remove_files', 'true', r'''
should the underlying files be removed?''',
type='boolean'),
Config('lock_wait', 'true', r'''
wait for locks, if \c lock_wait=false, fail if any required locks are
not available immediately''',
type='boolean'),
]),
'WT_SESSION.join' : Method([
@@ -892,6 +897,7 @@ methods = {
type='list'),
]),
'WT_SESSION.rebalance' : Method([]),
'WT_SESSION.rename' : Method([]),
'WT_SESSION.reset' : Method([]),
'WT_SESSION.salvage' : Method([

1
dist/filelist vendored
View File

@@ -31,6 +31,7 @@ src/btree/bt_misc.c
src/btree/bt_ovfl.c
src/btree/bt_page.c
src/btree/bt_read.c
src/btree/bt_rebalance.c
src/btree/bt_ret.c
src/btree/bt_slvg.c
src/btree/bt_split.c

4
dist/flags.py vendored
View File

@@ -31,11 +31,13 @@ flags = {
'page_read' : [
'READ_CACHE',
'READ_COMPACT',
'READ_NOTFOUND_OK',
'READ_NO_EMPTY',
'READ_NO_EVICT',
'READ_NO_GEN',
'READ_NO_WAIT',
'READ_PREV',
'READ_RESTART_OK',
'READ_SKIP_INTL',
'READ_SKIP_LEAF',
'READ_TRUNCATE',
@@ -70,6 +72,7 @@ flags = {
'VERB_MUTEX',
'VERB_OVERFLOW',
'VERB_READ',
'VERB_REBALANCE',
'VERB_RECONCILE',
'VERB_RECOVERY',
'VERB_SALVAGE',
@@ -108,6 +111,7 @@ flags = {
'SESSION_CAN_WAIT',
'SESSION_CLEAR_EVICT_WALK',
'SESSION_INTERNAL',
'SESSION_LOCK_NO_WAIT',
'SESSION_LOCKED_CHECKPOINT',
'SESSION_LOCKED_HANDLE_LIST',
'SESSION_LOCKED_SCHEMA',

8
dist/s_all vendored
View File

@@ -88,7 +88,13 @@ COMMANDS="
2>&1 ./s_win > ${t_pfx}s_win
2>&1 ./s_docs > ${t_pfx}s_docs"
echo "$COMMANDS" | xargs -P 20 -I{} /bin/sh -c {}
# Parallelize if possible.
xp=""
echo date | xargs -P 20 >/dev/null 2>&1
if test $? -eq 0; then
xp="-P 20"
fi
echo "$COMMANDS" | xargs $xp -I{} /bin/sh -c {}
for f in `find . -name ${t_pfx}\*`; do
if ! `test -s $f`; then

12
dist/s_copyright vendored
View File

@@ -1,5 +1,8 @@
#! /bin/sh
# Only run when building a release
test -z "$WT_RELEASE_BUILD" && exit 0
# Check the copyrights.
c1=__wt.copyright.1
@@ -95,6 +98,13 @@ cat > $c5 <<ENDOFTEXT
* are met:
ENDOFTEXT
# Parallelize if possible.
xp=""
echo date | xargs -P 20 >/dev/null 2>&1
if test $? -eq 0; then
xp="-P 20"
fi
# Search for files, skipping some well-known 3rd party directories.
(cd .. && find [a-z]* -name '*.[chi]' \
-o -name '*.cxx' \
@@ -111,7 +121,7 @@ ENDOFTEXT
-e '/\/node_modules\//d' \
-e '/dist\/__/d' \
-e 's/^\.\///' |
xargs -P 20 -n 1 -I{} sh dist/s_copyright {})
xargs $xp -n 1 -I{} sh dist/s_copyright {})
# A few special cases: LICENSE, documentation, wt utility, some of which have
# more than one copyright notice in the file. For files that have only a single

7
dist/s_string.ok vendored
View File

@@ -255,6 +255,7 @@ RNG
RPC
RUNDIR
Radu
Rebalance
RedHat
Redistributions
Resize
@@ -498,6 +499,7 @@ datasets
datasource
datastore
dbc
dcalloc
decile
deciles
decl
@@ -537,6 +539,7 @@ dmalloc
dmsg
doxgen
doxygen
drealloc
ds
dsb
dsk
@@ -544,6 +547,7 @@ dsrc
dst
dstlen
dstrdup
dstrndup
dsync
dumpcmp
dumpfile
@@ -827,6 +831,7 @@ perf
pfx
poptable
popthreads
portably
pos
posint
posix
@@ -867,6 +872,8 @@ readlock
readonly
readunlock
realloc
rebalance
rebalanced
rebalancing
recno
recnos

9
dist/s_style vendored
View File

@@ -4,6 +4,13 @@
t=__wt.$$
trap 'rm -f $t; exit 0' 0 1 2 3 13 15
# Parallelize if possible.
xp=""
echo date | xargs -P 20 >/dev/null 2>&1
if test $? -eq 0; then
xp="-P 20"
fi
# s_style is re-entrant, when run with no parameters it calls itself
# again for each file that needs checking.
if [ $# -ne 1 ]; then
@@ -12,7 +19,7 @@ if [ $# -ne 1 ]; then
find bench examples ext src test \
-name '*.[chisy]' -o -name '*.in' -o -name '*.dox' |
sed -e '/Makefile.in/d' -e '/build_win\/wiredtiger_config.h/d' |
xargs -P 20 -n 1 -I{} sh ./dist/s_style {}
xargs $xp -n 1 -I{} sh ./dist/s_style {}
else
# General style correction and cleanup for a single file
f=$1

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -673,6 +673,10 @@ session_ops(WT_SESSION *session)
ret = session->compact(session, "table:mytable", NULL);
/*! [Compact a table] */
/*! [Rebalance a table] */
ret = session->rebalance(session, "table:mytable", NULL);
/*! [Rebalance a table] */
/*! [Rename a table] */
ret = session->rename(session, "table:old", "table:new", NULL);
/*! [Rename a table] */

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Public Domain 2014-2015 MongoDB, Inc.
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Public Domain 2014-2015 MongoDB, Inc.
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -45,6 +45,7 @@ JAVA_JUNIT = \
$(JAVATEST)/AutoCloseTest.java \
$(JAVATEST)/AsyncTest.java \
$(JAVATEST)/BackupCursorTest.java \
$(JAVATEST)/ConfigTest.java \
$(JAVATEST)/CursorTest.java \
$(JAVATEST)/CursorTest02.java \
$(JAVATEST)/ExceptionTest.java \

View File

@@ -36,6 +36,7 @@ COPYDOC(__wt_session, WT_SESSION, drop)
COPYDOC(__wt_session, WT_SESSION, join)
COPYDOC(__wt_session, WT_SESSION, log_flush)
COPYDOC(__wt_session, WT_SESSION, log_printf)
COPYDOC(__wt_session, WT_SESSION, rebalance)
COPYDOC(__wt_session, WT_SESSION, rename)
COPYDOC(__wt_session, WT_SESSION, reset)
COPYDOC(__wt_session, WT_SESSION, salvage)

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -206,14 +206,11 @@ public class PackOutputStream {
} else {
stringLen = value.length();
}
if (havesize) {
if (havesize || fieldFormat == 's') {
size = format.getLengthFromFormat(true);
if (stringLen > size) {
stringLen = size;
}
} else if (fieldFormat == 's') {
havesize = true;
size = 1;
}
if (fieldFormat == 'S' && !havesize) {

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Public Domain 2014-2015 MongoDB, Inc.
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.

View File

@@ -1,5 +1,5 @@
/*-
* Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Public Domain 2014-2015 MongoDB, Inc.
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Public Domain 2014-2015 MongoDB, Inc.
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Public Domain 2014-2015 MongoDB, Inc.
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -70,6 +70,8 @@ def __unpack_iter_fmt(fmt):
size = (size * 10) + int(char)
havesize = 1
else:
if not havesize:
size = 1
yield offset, havesize, size, char
size = 0
havesize = 0
@@ -83,14 +85,12 @@ def unpack(fmt, s):
result = []
for offset, havesize, size, f in __unpack_iter_fmt(fmt):
if f == 'x':
if not havesize:
size = 1
s = s[size:]
# Note: no value, don't increment i
elif f in 'SsUu':
if not havesize:
if f == 's':
size = 1
pass
elif f == 'S':
size = s.find('\0')
elif f == 'u' and offset == len(fmt) - 1:
@@ -106,14 +106,10 @@ def unpack(fmt, s):
s = s[size:]
elif f in 't':
# bit type, size is number of bits
if not havesize:
size = 1
result.append(ord(s[0:1]))
s = s[1:]
elif f in 'Bb':
# byte type
if not havesize:
size = 1
for i in xrange(size):
v = ord(s[0:1])
if f != 'B':
@@ -122,8 +118,6 @@ def unpack(fmt, s):
s = s[1:]
else:
# integral type
if not havesize:
size = 1
for j in xrange(size):
v, s = unpack_int(s)
result.append(v)
@@ -164,11 +158,9 @@ def pack(fmt, *values):
l = val.find('\0')
else:
l = len(val)
if havesize:
if havesize or f == 's':
if l > size:
l = size
elif f == 's':
havesize = size = 1
elif (f == 'u' and offset != len(fmt) - 1) or f == 'U':
result += pack_int(l)
if type(val) is unicode and f in 'Ss':

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -11,36 +11,13 @@
static int __desc_read(WT_SESSION_IMPL *, WT_BLOCK *);
/*
* __wt_block_manager_truncate --
* Truncate a file.
* __wt_block_manager_drop --
* Drop a file.
*/
int
__wt_block_manager_truncate(
WT_SESSION_IMPL *session, const char *filename, uint32_t allocsize)
__wt_block_manager_drop(WT_SESSION_IMPL *session, const char *filename)
{
WT_DECL_RET;
WT_FH *fh;
/* Open the underlying file handle. */
WT_RET(__wt_open(
session, filename, false, false, WT_FILE_TYPE_DATA, &fh));
/* Truncate the file. */
WT_ERR(__wt_block_truncate(session, fh, (wt_off_t)0));
/* Write out the file's meta-data. */
WT_ERR(__wt_desc_init(session, fh, allocsize));
/*
* Ensure the truncated file has made it to disk, then the upper-level
* is never surprised.
*/
WT_ERR(__wt_fsync(session, fh));
/* Close the file handle. */
err: WT_TRET(__wt_close(session, &fh));
return (ret);
return (__wt_remove_if_exists(session, filename));
}
/*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*

Some files were not shown because too many files have changed in this diff Show More