401 Commits

Author SHA1 Message Date
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
Ben Johnson
622c1f1525 Merge pull request #209 from benbjohnson/next-seq-uint64
Change Bucket.NextSequence() to return uint64
2014-06-22 10:00:04 -06:00
Ben Johnson
0f585358f4 Change Bucket.NextSequence() to return uint64.
This commit changes NextSequence() to return a uint64 instead of an int. This also
removes the ErrSequenceOverflow error condition since overflowing a uint64 is unlikely.

Fixes #39.
2014-06-22 09:33:28 -06:00
Ben Johnson
00ee0da528 Add Open() options, flock timeout.
This commit changes Open() to provide an additional Options argument. The options
argument currently only has a Timeout which will cause the Open() to return
ErrTimeout if a file lock cannot be obtained in time.

Fixes #207.
2014-06-21 14:44:28 -06:00
Ben Johnson
0a59a75472 Merge pull request #206 from Shopify/pending_page_stats
Split the freelist page count stats to free and pending
2014-06-20 09:03:24 -06:00
Martin Kobetic
571f201672 split the freelist page count stats to free and pending 2014-06-20 14:53:25 +00:00
Ben Johnson
42b4cae0fd Merge pull request #202 from benbjohnson/refactor-split
Fix split-merge regression.
2014-06-19 07:17:36 -06:00
Ben Johnson
b1dbd35da1 Fix merge-split regression.
This commit reverts merge-split and fixes the node.split() to do a multi-page split. This issue
caused problems with bulk loading because it would split into a small page and a very large page.
The very large page, in turn, would be an arbitrary size so when it was freed later it would be
difficult to reuse and would cause serious fragmentation issues.
2014-06-18 16:16:58 -06:00
Ben Johnson
5043a9e839 Merge pull request #200 from benbjohnson/fix-i686
Fix i686 build error.
2014-06-18 15:28:43 -06:00
Ben Johnson
56de9902a8 Merge pull request #201 from Shopify/freelist_stats_cleanup
Fix up freelist stats naming and add FreeAlloc
2014-06-18 12:35:13 -06:00
Martin Kobetic
8a386756df fix up freelist stats naming and add FreeAlloc 2014-06-18 18:10:42 +00:00
Ben Johnson
515bf03ff9 Fix i686 build error. 2014-06-18 11:53:01 -06:00
Ben Johnson
afd38460ef Merge pull request #199 from kardianos/patch-1
Update README.md
2014-06-18 10:04:45 -06:00
Daniel Theophanes
c3ae6e7307 Update README.md 2014-06-18 09:02:06 -07:00
Ben Johnson
4e3b3d3b2d Merge pull request #198 from yosssi/patch-1
Add "BoltStore" link on README.md
2014-06-18 09:53:47 -06:00
Keiji Yoshida
ce59819e84 Add "BoltStore" link on README.md
I completed creating [BoltStore](https://github.com/yosssi/boltstore) and added its link on README.md.
2014-06-18 15:24:52 +09:00
Ben Johnson
f8365b732e Merge pull request #197 from Shopify/freelist_stats
Add freelist stats to db stats
2014-06-17 13:34:15 -06:00
Martin Kobetic
4918ce8301 drop mergeStats and move freelist stats update to Tx 2014-06-17 19:30:10 +00:00
Martin Kobetic
c105316292 add freelist stats to db stats 2014-06-17 18:40:56 +00:00
Ben Johnson
41aa602f27 Document key/value lifecycle.
This commit adds a caveat to the godoc that explains how key and value
byte slices will only be valid for the life of the transaction.
2014-06-16 09:42:59 -06:00
Ben Johnson
0329b03f58 Merge pull request #193 from benbjohnson/check-freelist-overflow
Check for freelist overflow
2014-06-13 16:02:47 -06:00
Ben Johnson
4db99647eb Fix freelist rollback. 2014-06-13 15:50:47 -06:00
Ben Johnson
8137a18374 Merge pull request #194 from benbjohnson/fix-deadlock
Fix deadlock on remmap.
2014-06-13 12:29:59 -06:00
Ben Johnson
defdb743cd Fix deadlock on remmap.
This commit fixes a deadlock situation that can occur when Bolt's database size crosses a threshold
and requires remapping the mmap.
2014-06-13 12:07:37 -06:00
Ben Johnson
f448639ce4 Check for freelist overflow. 2014-06-13 07:56:10 -06:00
Ben Johnson
01bc9be72f Merge pull request #191 from benbjohnson/win-ftw
Windows Support
2014-06-13 07:07:33 -06:00
Ben Johnson
a2535f64ec Merge pull request #190 from Shopify/cursor_delete
Add Cursor.Delete()
2014-06-12 10:45:07 -06:00
Ben Johnson
8eaea4c150 Remove errcheck. 2014-06-12 09:32:29 -06:00
Ben Johnson
1c97a490dd Add Windows support.
This commit adds Windows support to Bolt. Windows memory maps return an address instead of a byte
slice so the DB.data field had to be refactored to be a pointer to a large byte array.
2014-06-12 09:23:30 -06:00
Martin Kobetic
a00a88baef add Cursor.Delete() 2014-06-11 21:46:19 +00:00
Ben Johnson
c2577db1c2 Add Windows support. 2014-06-11 11:11:21 -06:00
Ben Johnson
5e9ce18567 Merge pull request #189 from benbjohnson/increase-max-nodes-per-page
Increase max nodes per page.
2014-06-10 10:06:01 -06:00
Ben Johnson
fd7b0efeb5 Increase max nodes per page.
This commit changes the maxNodesPerPage constant so that it is essentially unlimited.
Previously, a single large transaction could create more nodes than the mock array
could handle.

Fixes #188.
2014-06-10 09:38:40 -06:00
Ben Johnson
c9b983c853 Merge pull request #187 from benbjohnson/fix-seek
Fix in-between page seek
2014-06-09 12:59:29 -06:00
Ben Johnson
511ecba69b Refactor Cursor.Next() to use Cursor.next(). 2014-06-09 12:37:07 -06:00
Ben Johnson
63a9afd028 Add seek forward test. 2014-06-09 12:31:52 -06:00
Ben Johnson
6ddb056698 Fix last element seek.
This commit fixes a bug with seeks where seeking to a key between the end
of a page and the beginning of the next page causes it to return nil. This
was fixed by calling Cursor.next() when the cursor ends up between pages.

This also changes Cursor.Next() so that calling Next() at the end of a bucket
leaves the cursor at the end instead of zeroing out the stack.

Fixes #186.

/cc @PreetamJinka
2014-06-09 11:07:25 -06:00
Ben Johnson
9e8a6194ed Merge pull request #185 from benbjohnson/fix-bulk-delete
Fix double free in merge-left rebalance.
2014-06-06 19:04:49 -06:00
Ben Johnson
2321036228 Fix double free in merge-left rebalance.
This commit fixes a bug where deletions that caused merge-left rebalances were updating
the parent node which caused a node to "reappear" even after it had been deleted. This was
fixed in merge-right rebalances a while ago but merge-left is less frequent so it was
missed until now.

Many thanks to Jordan Sherer (@jsherer) for finding and reporting the bug.
2014-06-06 17:14:17 -06:00
Ben Johnson
9ffb29787a Merge pull request #183 from benbjohnson/copy-fallback
Add fallback for O_DIRECT in Tx.Copy().
2014-06-05 10:18:58 -06:00
Ben Johnson
63373660bc Add fallback for O_DIRECT in Tx.Copy().
This commit adds the ability for Bolt to fallback to using a regular file open if Tx.Copy()
errors while opening with O_DIRECT. This only affects Linux.
2014-06-05 09:58:41 -06:00
Ben Johnson
510143d852 Merge pull request #181 from benbjohnson/split-merge
Allow split nodes to be merged with the next node.
2014-06-03 16:44:58 -06:00
Ben Johnson
54cad40a78 Fix merge-split spill issues. 2014-06-03 13:40:24 -06:00
Ben Johnson
a96185e8b6 Allow split nodes to be merged with the next node.
This commit changes the node.split() functionality to check if the next node has
available space and, if so, it will merge the newly split keys into the next node.

Previously, keys could be continually put into the left side of a split causing that
first half to split off small right side nodes. This was especially problematic with
databases with a high fill percent.
2014-06-02 15:26:58 -06:00