This commit adds safety documentation to the data accessor functions
in Bolt as well as the README. This was documented once in the package
level godoc but it's important enough that it should be more clear.
This commit moves the functionality in Tx.Copy() to Tx.WriteTo(). This
allows Tx to be used as an io.WriterTo which makes it easier to mock.
The Tx.Copy() function still exists but it's simply a wrapper around
Tx.WriteTo().
This commit changes the maxAllocSize from 256GB to 2GB to handle large
values. It was previously 0xFFFFFFF and I tried adding one more "F" but
it caused an "array too large" error. I played around with the value
some more and found that 0x7FFFFFFF (2GB) is the highest allowed value.
This does not affect how the data is stored. It is simply used for type
converting pointers to array pointers in order to utilize zero copy
from the mmap.
DB.Batch makes it easy to make lots of small transactions with
significantly better performance. Batch combines multiple concurrent
Update calls into a single disk transaction, managing errors smartly.
This commit fixes a bug where only calling NextSequence() on a Bucket does not cause the Bucket to be
peristed. The simple fix is to simply materialize the root node so that the bucket is flushed out
during commit.
Thanks to Matthew Dawson (@MJDSys) for reporting.
https://github.com/boltdb/bolt/issues/296
This commit expands calls to _assert() that use variadic arguments. These calls require conversion to interface{} so there
was a large number of calls to Go's internal convT2E() function. In some profiling this was taking over 20% of total runtime.
I don't remember seeing this before Go 1.4 so perhaps something has changed.
This commit adds fixes suggested by @tv42 for the mmap step fix in 834b38e:
* Check max size before calculating the new the mmap size.
* Fix mmap step loop to go to 1GB instead of 512MB.
This commit fixes an issue where the database would grow whenever it was opened. This was caused by
a recent change that performed a truncation when the database grew. Now there are fixed growth sizes
for the database (1MB, 2MB, 4MB, 8MB, etc) up to 1GB and then the database will grow by 1GB when it
resizes.
See also: 6bb25854a1
Due to the fact that you want to iterate over all keys that are before or equal to `max` starting from `min` the bytes.Compare() check should look like the commit suggests.
This commit fixes an issue with ext3/ext4 filesystems where metadata file size is not synced
when resizing a file. It also resizes the entire resize instead of updating the size during
individual page writes.
Thanks to @tv42 for the fix.
The max mmap size was previous unchecked which resulted in a panic once
the maximum size was reached. This commit adds a check for the max size
when re-mapping and returns an error if the new map will exceed the size.
Thanks to Tamás Gulácsi for testing out the change on i386.
The import and export commands are a relic of early Bolt when the file
format was not stable. If the file format changed then users could export
their old data and import it into a new database with a new format.
The Bolt DB file format is stable and will not change so this command is no
longer needed.
Thanks to Alejandro Gaviria for pointing this out.