Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Switch to bbolt #5

Open
wants to merge 102 commits into
base: master
Choose a base branch
from
Open

Switch to bbolt #5

wants to merge 102 commits into from

Conversation

lukechampine
Copy link
Member

This merges all the bbolt code, plus my patch that adds MmapError.

This is a little unconventional; it's probably more "correct" to fork bbolt to NebulousLabs/bbolt, and then rewrite our Sia import paths to bbolt. I think we could also setup a NebulousLabs/bolt -> NebulousLabs/bbolt redirect.

buptmiao and others added 30 commits September 25, 2016 00:55
Read txns would lock pages allocated after the txn, keeping those pages
off the free list until closing the read txn. Instead, track allocating
txid to compute page lifetime, freeing pages if all txns between
page allocation and page free are closed.
*: use coreos/bbolt as import path
When the database has a lot of freepages, the cost to sync all
freepages down to disk is high. If the total database size is
small (<10GB), and the application can tolerate ~10 seconds
recovery time, then it is reasonable to simply not sync freelist
and rescan the db to rebuild freelist on recovery.
add option to skip freelist sync
Garbage collect pages allocated after minimum txid
Writes pgidNoFreelist to the meta freelist page to detect when freelists
haven't been synced down.

Fixes #5
rebuild freelist when opening with FreelistSync after NoFreelistSync
Confirm that the number of freed pages exceeds the overflow count, then check
that reopening gives the same number of free pages.
count is not shifted up by start index when taking subslice of free
list, dropping the last entry in the list.
Default/nil quick.Config uses 1000 rounds, causing TestBucker_Put_Single to
run for over 3 minutes in CI. The default count (via qconfig()) for boltdb
is 5, so use that.
* unconditionally free freelist, if any, when committing txn

* only treat freelist pages as reachable if set to valid pgid

Fixes boltdb#9
test: use qconfig() instead of defaults in TestBucket_Put_Single
fix NoSyncFreelist reachability checking
freelist: read all free pages on count overflow
Configure the db page size at runtime. Makes cross-arch debugging a bit easier.
Added a test to check that bucket is actually non-nil before getting a
cursor on it. This happens when querying non-bucket entries, the
Bucket() method does not return explicit errors, so we can guess it's
probably because it's a key of the wrong type (ie: not leaf). No clear
idea wether the results in the case described '-read-mode=seq
-write-mode=rnd-nest' really do make sense, it looks like read are
zero whatsoever.
* gosimple
* unused
* gofmt
By default, pages are split when they reach half full. For 'bolt compact' we want to fill the entire page for maximum compaction.
As of now the test fails and tries to delete the next key returned by
the cursor, which happens to be a nested bucket. That's why Delete is
fails.

Signed-off-by: Pavel Borzenkov <[email protected]>
xiang90 and others added 30 commits September 20, 2017 12:18
Fix CLI tool print entire freelist. Add option to dump leaf element keys/value bytes.
Otherwise, nil dereference on ReadOnly DB

Fixes boltdb#45
tx: load freelist on Check() [continuation of PR#49]
Trivial. Removed 'moribund' from README.md
Was filling up all the disk space in Jenkins VMs.

Signed-off-by: Gyu-Ho Lee <[email protected]>
db_test.go: remove temp files after tests
Add 'boltcli' to the list of projects that use Bolt
fix funlock error when call db.Close on windows
Panic if page provided to freelist.read is incorrect page type.
Was causing freelist corruption on tx.WriteTo
Reliably triggers consistency check failures on ramdisk without freelist
free fix.
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.
Remove unnecessary if in batch handling
tx: fix the number of pages is incorrectly counted
If this var is missing building on the ppc architecture fails.
This PR adds it.
bolt_ppc.go: define `var brokenUnaligned`
DB.Close() actually waits for the transactions to finish now, since the PR 377.
boltdb#377
Close waits for the transactions to finish
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.