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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.