Commit Graph

375 Commits (0329b03f58799ab8e51e7567f836c80c24258a16)

Author SHA1 Message Date
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
Ben Johnson 10074ee8f4 Add ipxed to README. 2014-06-02 09:17:37 -06:00
Ben Johnson ba43ee8c64 Add event-shuttle to README. 2014-06-02 09:15:49 -06:00
Ben Johnson b15b963550 Merge pull request #180 from yosssi/fix-example-bucket-put
Fix `ExampleBucket_Put` to use `db.View` instead of `db.Update`.
2014-06-02 09:08:53 -06:00
yosssi a9189ddefb Fix `ExampleBucket_Put` to use `db.View` instead of `db.Update`. 2014-05-31 11:22:50 +09:00
Ben Johnson 2ee5806031 Merge pull request #179 from benbjohnson/freelist-assertion
Add freelist assertion on every free().
2014-05-29 08:17:54 -06:00
Ben Johnson 2eaf8f7ce0 Add freelist assertion on every free().
This commit performs a check on the freelist pages to ensure that a double free can never happen.
2014-05-29 08:02:15 -06:00
Ben Johnson 4e31e9d8f9 Merge pull request #177 from tv42/tx-copy-rollback
Do not attempt manual transaction rollback in Tx.Copy
2014-05-28 13:31:41 -06:00
Ben Johnson 2652bec51e Merge pull request #178 from benbjohnson/optimize-check
Optimize Tx.Check().
2014-05-28 13:10:20 -06:00
Ben Johnson 754966bea0 Optimize Tx.Check().
This commit removes several memory allocations occurring on every page and also caches the freelist map used when iterating over the pages. This results in significantly better performance.
2014-05-28 12:50:48 -06:00
Tommi Virtanen 394862d541 Do not attempt manual transaction rollback in Tx.Copy
The typical use these days is with a managed transaction, via db.View.

The first case (error when re-opening database file) is not tested;
it is harder to instrument, and I have other plans for it.
2014-05-28 10:15:49 -07:00
Ben Johnson b9b1bb5b29 Merge pull request #176 from benbjohnson/streaming-check
Add streaming check.
2014-05-28 10:46:21 -06:00
Ben Johnson b789691976 Add streaming check.
This commit changes Tx.Check() to return a channel through which check errors are returned. This allows
errors to be found before checking the entire data file.
2014-05-28 10:31:22 -06:00
Ben Johnson 4508a00891 Merge pull request #175 from benbjohnson/check-loop
Add circular dependency integrity check.
2014-05-28 09:00:19 -06:00
Ben Johnson cefc3c5ebd Add circular dependency integrity check.
This commit adds a check to prevent circular dependencies in branch nodes. If a circular dependency occurs
then a panic will be called and the commit will be prevented. This only works for a single branch level
and will not recursively search the tree.
2014-05-28 08:02:55 -06:00
Ben Johnson 93338e17ec Merge pull request #174 from benbjohnson/remove-db-check
Remove DB.Check(). Allow read-only Tx.Check().
2014-05-27 12:08:33 -06:00
Ben Johnson 92a9f2e200 Remove DB.Check(). Allow read-only Tx.Check().
This commit removes the DB.Check() function and instead makes the user decide
whether a transaction should be writable or read-only. Tx.Check() is not safe
to use concurrently on a read-only transaction, however, it significantly
improves the performance of it.
2014-05-27 11:31:55 -06:00
Ben Johnson 746dbb3566 Merge branch 'master' of https://github.com/boltdb/bolt 2014-05-27 08:28:06 -06:00
Ben Johnson 271129e40c Merge pull request #172 from benbjohnson/allocation
Remove allocations from read-only buckets.
2014-05-23 13:04:18 -06:00
Ben Johnson bfccbb2cb5 Avoid trashing page cache on Tx.Copy().
This commit change the database copy to use O_DIRECT so that the Linux page
cache is not trashed during a backup. This is only available on Linux.
2014-05-23 11:40:05 -06:00
Ben Johnson 06b01dbb67 Remove allocations from read-only buckets. 2014-05-23 10:40:09 -06:00
Ben Johnson 7432bc341f Merge pull request #169 from benbjohnson/allocation
Fix freelist allocation direction.
2014-05-21 13:46:12 -06:00
Ben Johnson 6fcc7fdb3d Merge pull request #171 from Shopify/tx_copy
Move Copy/CopyFile from DB to Tx and make sure it copies exactly Tx.Size() bytes
2014-05-21 11:04:08 -06:00
Martin Kobetic 8cd1c60f7c review comments 2014-05-21 16:57:29 +00:00
Martin Kobetic 0eda6c9f15 add tx.Size() and ensure tx.Copy() copies exactly that many bytes 2014-05-21 15:43:11 +00:00
Martin Kobetic 519d65228e move Copy and CopyFile from DB to Tx 2014-05-21 15:08:37 +00:00
Ben Johnson 644a949855 README 2014-05-19 16:16:36 -06:00