Commit Graph

444 Commits (defbfd35afe342d7fa821ab3cfc53232c31e8d0e)

Author SHA1 Message Date
Ben Johnson defbfd35af Merge pull request #234 from benbjohnson/testing
Testing cleanup
2014-07-26 19:47:10 -06:00
Ben Johnson bbf2da4c90 Fix go vet. 2014-07-26 19:41:05 -06:00
Ben Johnson 44e6192d2b Remove testify. 2014-07-26 17:17:03 -06:00
Ben Johnson ba6badc57f Move tests to a test package. 2014-07-26 15:11:47 -06:00
Ben Johnson ca2339d7cb Remove wrapping test closures. 2014-07-26 14:44:04 -06:00
Ben Johnson 06222e06de Remove withTempPath() helper. 2014-07-25 23:14:17 -06:00
Ben Johnson f7a40c7fb5 Merge pull request #230 from benbjohnson/doc
Documentation!
2014-07-25 22:12:17 -06:00
Ben Johnson ddb6b2f0ed README 2014-07-25 11:20:39 -06:00
Ben Johnson d021755f07 Merge pull request #229 from benbjohnson/bucket-fill-percent
Change fill percent to be per-bucket.
2014-07-24 11:25:57 -06:00
Ben Johnson cb17016062 Add FillPercent documentation. 2014-07-24 11:25:25 -06:00
Ben Johnson c3400efefd Change fill percent to be per-bucket.
This commit moves the DB.FillPercent field to Bucket.FillPercent. This
allows the fill percentage to be specified per-bucket, per-tx. This
value is not persisted and should be set whenever using it.
2014-07-24 10:36:09 -06:00
Ben Johnson 5fb781318f Merge pull request #228 from benbjohnson/fix-large-append
Fix root split on very large append.
2014-07-23 15:44:17 -06:00
Ben Johnson aa66291b9b Fix root split on very large append.
This commit fixes a bug where a root split on a very large insert would
cause an overflow of the root node. The problem was that the new root
was not split when it was created so a new root with more than 64K child
nodes would overflow the page.count (uint16).
2014-07-23 15:08:59 -06:00
Ben Johnson 40adaef94e Merge pull request #227 from benbjohnson/fix-double-spill
Fix double spill
2014-07-23 14:35:52 -06:00
Ben Johnson fd3c1d44b0 Fix double spill.
This fixes an issue where split nodes can be double spilled. This is typically
not noticable but it can have large effects when bulk inserting as double
spilled nodes will get added to the freelist which will grow quickly.
2014-07-23 09:04:36 -06:00
Ben Johnson 5c993fdecf Merge pull request #226 from benbjohnson/optimize-large-append
Optimize large append.
2014-07-22 13:17:51 -06:00
Ben Johnson b0c97d887a Optimize large append.
This commit fixes an issue where large nodes would take up most of
the insert time because the entire node size would be calculated to
check if it could fit in a page or not. This changes the behavior
so that a node's size is only calculated up to the size it needs to
check and then returns.
2014-07-22 13:02:38 -06:00
Ben Johnson c0308f777f Merge pull request #221 from cmars/win32
Fixed cast for 32-bit windows.
2014-07-16 15:02:46 -06:00
Ben Johnson 89f9735610 Merge pull request #225 from benbjohnson/no-sync
Add DB.NoSync option for bulk loading.
2014-07-15 07:45:39 -06:00
Ben Johnson 048d3f19b2 Add DB.NoSync option for bulk loading.
This commit adds the DB.NoSync flag to skip fsync() calls on each commit. This should only
be used for bulk loading as it can corrupt your database in the event of a system failure.

Initial tests show it can provide a 2x speed up for sequential inserts.
2014-07-15 07:37:46 -06:00
Ben Johnson 1395a04d97 Merge pull request #224 from benbjohnson/rebalance-time
Only update rebalance time if nodes are rebalanced
2014-07-15 07:29:10 -06:00
Ben Johnson 6e977e2f19 Only update rebalance time if nodes are rebalanced.
This commit changes TxStats.RebalanceTime to only update if there are nodes that have been
rebalanced. Previously, the RebalanceTime would include a small amount of time to check if
there were nodes to rebalance but this is confusing to users and not terribly helpful.
2014-07-15 07:26:02 -06:00
Casey Marshall 1409473547 Fixed cast for 32-bit windows. 2014-07-13 03:14:27 -05:00
Ben Johnson f873035fc9 Remove unreachable test code. 2014-07-11 10:07:24 -06:00
Ben Johnson ba4adce39b Merge pull request #220 from benbjohnson/handle-panic
Recover from panics appropriately.
2014-07-11 10:04:28 -06:00
Ben Johnson ac4838472d Recover from panics appropriately.
This commit adds a defer handler to ensure that transactions are always closed out - even
in the event of a panic within user code. It's recommended that applications always fail
in the event of a panic but some packages such as net/http will automatically recover
which is a problem (IHMO).
2014-07-11 09:54:10 -06:00
Ben Johnson fe9a0781e2 Merge pull request #219 from benbjohnson/freelist-overflow
Allow freelist overflow.
2014-07-10 15:06:19 -06:00
Ben Johnson 88c8709cb1 Remove ErrFreelistOverflow error. 2014-07-10 15:01:50 -06:00
Ben Johnson ce0754b0d3 Allow freelist overflow.
This commit is a backwards compatible change that allows the freelist to overflow the
page.count (uint16). It works by checking if the overflow will occur and marking the
page.count as 0xFFFF and setting the actual count to the first element of the freelist.

This approach was used because it's backwards compatible and it doesn't make sense to
change the data type of all page counts when only the freelist's page can overflow.

Fixes #192.
2014-07-10 14:50:21 -06:00
Ben Johnson 4d4ae58c6d Merge pull request #215 from benbjohnson/free-cache
Add freelist cache.
2014-07-10 14:20:40 -06:00
Ben Johnson 333c586ed0 Clean up freelist reindex. 2014-07-10 14:16:26 -06:00
Ben Johnson cc8004c980 Merge branch 'master' of https://github.com/boltdb/bolt into free-cache 2014-07-10 14:00:32 -06:00
Ben Johnson 90fe8d9c12 Fix test for path errors. 2014-07-10 09:41:40 -06:00
Ben Johnson ca5f582710 Merge pull request #218 from benbjohnson/fix-win
Fix Windows mmap sizing.
2014-07-10 07:35:40 -06:00
Ben Johnson e903703e61 Fix Windows mmap sizing.
This commit fixes an issue on Windows where the database was doubling
when it was re-opened. This occurred because Windows has to truncate the
file to the mmap size and the mmap resizing code was doubling the size
whenever the DB size was at the next threshold. This has been changed so
that the DB size will double only when the DB size is above the next
threshold.
2014-07-10 07:11:01 -06:00
Ben Johnson d9a0f51bee Add 'Intro to BoltDB' link. 2014-07-07 08:39:59 -06:00
Ben Johnson def455554b Add freelist cache.
This commit adds a cache to the freelist which combines the available free pages and pending free pages in
a single map. This was added to improve performance where freelist.isFree() was consuming 70% of CPU time
for large freelists.
2014-06-30 08:01:41 -06:00
Ben Johnson e4ad031878 Merge pull request #214 from Shopify/fix_stats_sub
Copy the free pages stats from the receiver
2014-06-27 11:40:46 -06:00
Martin Kobetic 8c386e72f3 Copy the free pages stats from the receiver 2014-06-27 17:38:06 +00:00
Ben Johnson d1a77a9c82 Minor fix. 2014-06-24 11:58:46 -06:00
Ben Johnson 283c556aa8 Merge pull request #213 from Shopify/stats_sub2
Drop the *s guard in Stats.Sub()
2014-06-24 11:56:55 -06:00
Martin Kobetic bae0fbd290 review tweaks 2014-06-24 17:54:40 +00:00
Martin Kobetic ba79a0a355 drop the *s guard 2014-06-24 17:40:53 +00:00
Ben Johnson 78d08e0438 Merge pull request #212 from Shopify/stats_sub
Improve Stats.Sub()
2014-06-24 11:37:16 -06:00
Martin Kobetic 8dd18bd620 review tweaks 2014-06-24 17:19:50 +00:00
Martin Kobetic 32e22b3bb6 add some guards for nil pointers 2014-06-24 15:32:04 +00:00
Martin Kobetic bbee09da30 copy receiver stats in Stats.Sub() 2014-06-24 15:32:04 +00:00
Ben Johnson c45c4a1ae6 Merge pull request #210 from benbjohnson/default-options
Add DefaultOptions variable.
2014-06-22 14:19:26 -06:00
Ben Johnson 642b104396 Add DefaultOptions variable.
This commit adds an explicit DefaultOptions variable for additional documentation.
Open() can still be passed a nil options which will cause options to be change to
the DefaultOptions variable. This change also allows options to be set globally for
an application if more than one database is being opened in a process.

This commit also moves all errors to errors.go so that the godoc groups them together.
2014-06-22 12:44:20 -06:00
Ben Johnson 4f428feecc Merge pull request #208 from benbjohnson/open-timeout
Add Open() options, flock timeout.
2014-06-22 10:10:55 -06:00