Commit Graph

817 Commits (1bc3b1f90e0d33d43fd2b329a3f2b8489e6fbd27)

Author SHA1 Message Date
Marc 1bc3b1f90e
build: Add build consts for MIPS and MIPSLE 2021-04-30 14:57:55 +01:00
Ben Johnson fd01fc79c5
Merge pull request #748 from Chyroc/add/tx-copy-deprecated
add tx-copy-deprecated
2018-03-02 11:00:52 -07:00
Chyroc fa91bb2ff8 add tx-copy-deprecated 2018-03-01 22:29:23 +08:00
Ben Johnson 9da3174536
Merge pull request #736 from tv42/silly-if
Remove unnecessary if in batch handling
2017-11-19 18:03:07 -07:00
Tommi Virtanen 32cc6eb166 Remove unnecessary if in batch handling
This is safe, as the only place that creates call values always
explicitly sets err. It's a leftover from an earlier iteration of the
code.
2017-11-17 20:00:15 -07:00
Ben Johnson fa5367d20c README 2017-09-07 14:20:52 -06:00
Ben Johnson 2f1ce7a837 Merge pull request #703 from nilslice/patch-1
Add Ponzu CMS to list of projects using Bolt
2017-07-17 11:11:48 -06:00
Steve Manuel f7f91ab543 Add Ponzu CMS to list of projects using Bolt 2017-07-10 16:15:44 -06:00
Ben Johnson e9cf4fae01 Merge pull request #654 from benbjohnson/revert-ca9f208
Revert "replace unix implementation to be the same as solaris to fix …"
2017-01-31 12:20:18 -07:00
Ben Johnson 82ecdfe9ef
Revert "replace unix implementation to be the same as solaris to fix an issue with glusterfs"
This reverts commit ca9f2088aa.
2017-01-31 07:53:51 -07:00
Ben Johnson 9145e04770 Merge pull request #651 from zweizeichen/master
hexidecimal -> hexadecimal
2017-01-30 08:30:26 -07:00
Sebastian 4660afd75e hexidecimal -> hexadecimal
Small spelling fix :)
2017-01-28 10:26:39 +01:00
Ben Johnson a705895fda Merge pull request #642 from josharian/fix629
Ensure that keys generated by testing/quick are unique
2016-12-28 16:26:56 -07:00
Josh Bleecher Snyder 18ced60c94 Ensure that keys generated by testing/quick are unique
Quick seed 21691 used to generate duplicate keys, 
which caused some Puts of values to overwrite other values,
causing spurious test failures.

Fixes #629.
2016-12-28 14:09:56 -08:00
Ben Johnson b9eb643780
Clean up timeout tests.
The new FCTNL locking does not support multiple locks from the
same process which makes those tests fail. The lock tests have
been removed.
2016-12-27 15:28:53 -07:00
Ben Johnson 2c3edd782c Merge pull request #616 from sinwav/idiomatic
Fix return statement inside else block at the end of function
2016-12-27 14:08:26 -07:00
Ben Johnson ebe310138b Merge pull request #625 from vrecan/FcntlFlock
replace unix implementation to be the same as solaris to fix an issue with glusterfs
2016-12-27 14:07:51 -07:00
Ben Johnson f57d45558d Merge pull request #628 from bep/patch-1
Fix prefix scan example
2016-12-27 14:06:03 -07:00
Ben Johnson 2e25e3bb42 Merge pull request #641 from josharian/cleanup
Minor cleanup and bug fixes
2016-12-23 10:44:54 -07:00
Josh Bleecher Snyder 10c6e01e1f Allow GC to reclaim completed transactions
The existing append-based implementation left a hanging reference to
the last tx.

For example, if db.txs was:

[]*Tx{0x1, 0x2, 0x3, 0x4, 0x5}

and we removed the second element, db.txs would now be:

[]*Tx{0x1, 0x3, 0x4, 0x5, 0x5}[:4]

The garbage collector cannot reclaim anything anywhere in a slice,
even pointers between its len and cap, because the len can always
be extended up to the cap.

This hanging reference to the Tx could last indefinitely,
and since the Tx has a reference to user-provided functions,
which could be closures, this bug could prevent arbitrary
amounts of user garbage from being collected.

Since db.txs is unordered anyway, switch to a simpler--and O(1) instead
of O(n)--implementation. Swap the last element into the spot to be
deleted, nil out the original last element, and shrink the slice.
2016-12-23 09:18:57 -08:00
Josh Bleecher Snyder 7adfa44e02 Fix freelist.size calculation for large freelists
freelist.size did not account for the extra
fake freelist item used to hold the number of
elements when the freelist is large.
2016-12-23 09:18:57 -08:00
Josh Bleecher Snyder 0e120dc470 Precalculate size of pending pgids in freelist.copyall
This recovers the slight alloc regression in #636.
2016-12-23 09:18:47 -08:00
Josh Bleecher Snyder 1858583b3b Clean up after #636
freelist.lenall duplicated freelist.count.
freelist.copyall and mergepgids docs had typos.
2016-12-23 08:56:04 -08:00
Ben Johnson f0cf3bfd5b Merge pull request #636 from josharian/perf
Don't allocate huge slices to merge pgids in freelist.write
2016-12-21 16:46:06 -07:00
Ben Johnson 7614a4738b Merge pull request #638 from boltdb/fix-634
Document multi-process limitation in README
2016-12-21 08:52:53 -07:00
Ben Johnson 30095231de README
Add limitation about multiple processes opening databases concurrently.
2016-12-21 08:52:12 -07:00
Josh Bleecher Snyder 4d8824b05d Don't allocate huge slices to merge pgids in freelist.write
Using a large (50gb) database with a read-write-delete heavy load,
nearly 100% of allocated space came from freelists.
1/3 came from freelist.release, 1/3 from freelist.write,
and 1/3 came from tx.allocate to make space for freelist.write.
In the case of freelist.write, the newly allocated giant slice gets
copied to the space prepared by tx.allocate and then discarded.

To avoid this, add func mergepgids that accepts a destination slice,
and use it in freelist.write.

This has a mild negative impact on the existing benchmarks,
but cuts allocated space in my real world db by over 30%.

name                      old time/op    new time/op    delta
_FreelistRelease10K-8       18.7µs ±10%    18.2µs ± 4%    ~             (p=0.548 n=5+5)
_FreelistRelease100K-8       233µs ± 5%     258µs ±20%    ~             (p=0.151 n=5+5)
_FreelistRelease1000K-8     3.34ms ± 8%    3.13ms ± 8%    ~             (p=0.151 n=5+5)
_FreelistRelease10000K-8    32.3ms ± 1%    32.2ms ± 7%    ~             (p=0.690 n=5+5)
DBBatchAutomatic-8          2.18ms ± 3%    2.19ms ± 4%    ~             (p=0.421 n=5+5)
DBBatchSingle-8              140ms ± 6%     140ms ± 4%    ~             (p=0.841 n=5+5)
DBBatchManual10x100-8       4.41ms ± 2%    4.37ms ± 3%    ~             (p=0.548 n=5+5)

name                      old alloc/op   new alloc/op   delta
_FreelistRelease10K-8       82.5kB ± 0%    82.5kB ± 0%    ~     (all samples are equal)
_FreelistRelease100K-8       805kB ± 0%     805kB ± 0%    ~     (all samples are equal)
_FreelistRelease1000K-8     8.05MB ± 0%    8.05MB ± 0%    ~     (all samples are equal)
_FreelistRelease10000K-8    80.4MB ± 0%    80.4MB ± 0%    ~             (p=1.000 n=5+5)
DBBatchAutomatic-8           384kB ± 0%     384kB ± 0%    ~             (p=0.095 n=5+5)
DBBatchSingle-8             17.2MB ± 1%    17.2MB ± 1%    ~             (p=0.310 n=5+5)
DBBatchManual10x100-8        908kB ± 0%     902kB ± 1%    ~             (p=0.730 n=4+5)

name                      old allocs/op  new allocs/op  delta
_FreelistRelease10K-8         5.00 ± 0%      5.00 ± 0%    ~     (all samples are equal)
_FreelistRelease100K-8        5.00 ± 0%      5.00 ± 0%    ~     (all samples are equal)
_FreelistRelease1000K-8       5.00 ± 0%      5.00 ± 0%    ~     (all samples are equal)
_FreelistRelease10000K-8      5.00 ± 0%      5.00 ± 0%    ~     (all samples are equal)
DBBatchAutomatic-8           10.2k ± 0%     10.2k ± 0%  +0.07%          (p=0.032 n=5+5)
DBBatchSingle-8              58.6k ± 0%     59.6k ± 0%  +1.70%          (p=0.008 n=5+5)
DBBatchManual10x100-8        6.02k ± 0%     6.03k ± 0%  +0.17%          (p=0.029 n=4+4)
2016-12-20 14:32:15 -08:00
Ben Johnson d98e43f69e Merge pull request #618 from tbe/master
[ppc64] added missing variable
2016-12-20 07:40:02 -07:00
Bjørn Erik Pedersen 714f31f39e Fix prefix scan example
The example is correct in isolation, but if people just copy the loop, it will go into infinite loop when given an empty byte slice.
2016-12-06 21:38:41 +01:00
Ben Johnson 0d9f544bb9 Merge pull request #626 from timshannon/patch-1
Added BoltHold and Ironsmith to the projects list
2016-11-21 09:51:43 -07:00
Tim Shannon a8a17933aa Added BoltHold and Ironsmith to the projects list 2016-11-20 21:14:40 -06:00
Ben Aldrich ca9f2088aa replace unix implementation to be the same as solaris to fix an issue with glusterfs 2016-11-16 02:08:01 +00:00
Ben Johnson 315c65d4cf Merge pull request #621 from jcvernaleo/jcv_readme
Add btcwallet and dcrwallet to projects using bolt.
2016-11-09 15:02:51 -07:00
John C. Vernaleo 01cb4852fd Make wording a little less redundant. 2016-11-09 16:43:38 -05:00
John C. Vernaleo 021e7e8a8c Add btcwallet and dcrwallet to projects using bolt. 2016-11-08 08:39:53 -05:00
tbe 84658f4d37 [ppc64] added missing variable
The variable `brokenUnaligned` was missing for ppc64.
2016-11-04 12:25:04 +01:00
nick ac86fb9530 Fix return statement inside else block at the end of function and gofmt windows file
Signed-off-by: nick <nicholasjamesrusso@gmail.com>
2016-10-31 20:49:40 -07:00
Ben Johnson 4b1ebc1869 Merge pull request #611 from jaredfolkins/master
enhc: update example for nested buckets
2016-10-28 13:36:45 -06:00
Jared Folkins 5accf28dbd enhc: update example for nested buckets 2016-10-28 12:08:50 -07:00
Ben Johnson dca969723b Merge pull request #609 from hasit/patch-1
Add 'bolter' to the list of projects that use Bolt
2016-10-28 11:42:55 -06:00
Hasit Mistry 0ac07c81d0 Add 'bolter' to the list of projects that use Bolt
[bolter](https://github.com/hasit/bolter) is a command-line app for viewing BoltDB file in your terminal using [tablewriter](https://github.com/olekukonko/tablewriter).
2016-10-18 11:57:33 -07:00
Ben Johnson 074dffcc83 Merge pull request #605 from seeekr/patch-1
fix typo in README.md
2016-10-08 09:24:23 -06:00
Denis Andrejew 302d3d2ca3 fix typo in README.md 2016-10-07 22:35:08 +02:00
Ben Johnson f4c032d907 Merge pull request #604 from gopherpit/master
Add gopherpit to projects that use Bolt
2016-10-05 16:16:53 -06:00
Janoš Guljaš 573be28cf3 Add gopherpit to projects that use Bolt 2016-10-05 19:58:12 +02:00
Ben Johnson f0d021274d Merge pull request #601 from benbjohnson/stats-tx-n
Fix Stats.Sub() for Stats.TxN.
2016-10-03 13:08:47 -06:00
Ben Johnson 0d68f169c5
Fix Stats.Sub() for Stats.TxN.
The subtraction for `TxN` was previously transposed which caused
the result to be a negative number. This change alters the order
to return the correct (positive) result.
2016-10-03 13:04:32 -06:00
Ben Johnson fff57c100f Merge pull request #595 from namore/add_warning_foreach_keys
Update README.md
2016-09-13 10:53:39 -06:00
Roman Naumann 1e271f5035 Update README.md
Add warning to README.md that keys and values in `ForEach()` are
invalid outside of transaction.
2016-09-13 11:19:31 +02:00
Ben Johnson 9dffd9de3b Merge pull request #594 from anacrolix/patch-1
Update README.md
2016-09-12 10:49:43 -06:00