Anthony Romano
9fc2cf177d
Merge pull request #23 from heyitsanthony/del-nonexisting
...
Fix deletion of non-existing keys
2017-08-11 10:43:32 -07:00
Anthony Romano
a6c45c18c3
Merge pull request #16 from heyitsanthony/config-page-size
...
Options.PageSize
2017-08-11 10:43:09 -07:00
Anthony Romano
2fe83be160
Merge pull request #19 from heyitsanthony/skip-freelist-read
...
do not read freelist if database opened readonly
2017-08-11 10:11:03 -07:00
Anthony Romano
c5d7f33536
Merge pull request #22 from heyitsanthony/fill-compact
...
Set FillPercent=1.0 in 'bolt compact'.
2017-08-11 10:05:38 -07:00
Anthony Romano
6b378d844e
Merge pull request #18 from heyitsanthony/fmt
...
more fmt passes
2017-08-11 09:58:09 -07:00
Anthony Romano
ca5f9b69f3
Merge pull request #21 from heyitsanthony/add_mips_support
...
Add support for mips, mips64
2017-08-11 09:57:29 -07:00
Anthony Romano
045bd0e3bc
Merge pull request #26 from heyitsanthony/fix-32bit-test
...
fix overflow breaking 32-bit test builds
2017-08-11 09:57:09 -07:00
Anthony Romano
1ab9756653
fix overflow breaking 32-bit test builds
2017-08-10 23:36:52 -07:00
Pavel Borzenkov
6336a429d1
Fix deletion of non-existing keys
...
Doc for Bucket.Delete says that a Delete() on non-existing key is a
no-op. Right now it tries to delete the next key returned by the
cursor. Fix this by checking for key equivalence before deletion.
Fixes #349
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
2017-08-10 23:07:50 -07:00
Pavel Borzenkov
3c6c3ac0a2
Add a test for deletion of non-existing key
...
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 <pavel.borzenkov@gmail.com>
2017-08-10 23:07:50 -07:00
dogben
ef8e711cfb
Set FillPercent=1.0 in 'bolt compact'.
...
By default, pages are split when they reach half full. For 'bolt compact' we want to fill the entire page for maximum compaction.
2017-08-10 22:58:57 -07:00
Vladimir Stefanovic
e264e743a9
Add support for mips, mips64
2017-08-10 22:49:48 -07:00
Sokolov Yura aka funny_falcon
ec37ce8e9b
do not read freelist if database opened readonly
2017-08-10 22:30:40 -07:00
Anthony Romano
d3d8bbd794
pass gofmt
2017-08-10 22:07:25 -07:00
Anthony Romano
32c9f9e929
pass unused
2017-08-10 22:07:25 -07:00
Anthony Romano
e5514a24a6
pass gosimple
2017-08-10 22:07:25 -07:00
Anthony Romano
89b9a2c19e
make fmt
...
* gosimple
* unused
* gofmt
2017-08-10 22:07:25 -07:00
Anthony Romano
012f88489b
add PageSize to Option struct
...
Configure the db page size at runtime. Makes cross-arch debugging a bit easier.
2017-08-10 20:46:08 -07:00
Anthony Romano
78ca4fde00
get rid of os.Getpagesize() calls where appropriate
2017-08-10 20:46:08 -07:00
Anthony Romano
12923fe56c
Merge pull request #12 from heyitsanthony/skip-freelist-overflow
...
freelist: read all free pages on count overflow
2017-08-10 14:28:08 -07:00
Anthony Romano
b219ffc6cc
Merge pull request #10 from heyitsanthony/fix-freepage-test
...
fix NoSyncFreelist reachability checking
2017-08-09 08:48:36 -07:00
Anthony Romano
7bc833016a
Merge pull request #13 from heyitsanthony/weaken-single-put
...
test: use qconfig() instead of defaults in TestBucket_Put_Single
2017-08-09 08:41:24 -07:00
Anthony Romano
fd5de8495a
fix NoSyncFreelist reachability checking
...
* unconditionally free freelist, if any, when committing txn
* only treat freelist pages as reachable if set to valid pgid
Fixes #9
2017-08-09 07:24:02 -07:00
Anthony Romano
1038faf165
test: use qconfig() instead of defaults in TestBucket_Put_Single
...
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.
2017-08-09 00:30:52 -07:00
Anthony Romano
03f5e16968
freelist: read all free pages on count overflow
...
count is not shifted up by start index when taking subslice of free
list, dropping the last entry in the list.
2017-08-08 23:38:46 -07:00
Anthony Romano
f50ad8e90c
test: check free page counts on close/reopen for freelist overflow
...
Confirm that the number of freed pages exceeds the overflow count, then check
that reopening gives the same number of free pages.
2017-08-08 23:37:24 -07:00
Gyu-Ho Lee
2ab139b399
Merge pull request #8 from gyuho/ci
...
gofmt, change git path
2017-07-27 15:05:25 -07:00
Gyu-Ho Lee
a30394a020
*: update git paths to 'coreos/bbolt'
2017-07-27 14:58:03 -07:00
Gyu-Ho Lee
7ce671beee
*: fix gofmt style issues in 'range'
2017-07-27 14:57:54 -07:00
Anthony Romano
c359265bcd
Merge pull request #6 from heyitsanthony/restore-freelist
...
rebuild freelist when opening with FreelistSync after NoFreelistSync
2017-07-25 10:02:42 -07:00
Anthony Romano
05bfb3bd9a
rebuild freelist when opening with FreelistSync after NoFreelistSync
...
Writes pgidNoFreelist to the meta freelist page to detect when freelists
haven't been synced down.
Fixes #5
2017-07-25 08:01:43 -07:00
Xiang Li
ad39960eb4
Merge pull request #3 from heyitsanthony/range-gc
...
Garbage collect pages allocated after minimum txid
2017-06-23 18:19:54 -07:00
Xiang Li
572a8e0d3f
Merge pull request #1 from coreos/no_sync
...
add option to skip freelist sync
2017-06-22 12:52:29 -07:00
Xiang
7149270521
*: add option to skip freelist sync
...
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.
2017-06-22 12:46:56 -07:00
Xiang Li
bffefe5dd6
Merge pull request #4 from coreos/import_test
...
*: use coreos/bbolt as import path
2017-06-20 11:48:57 -07:00
Xiang
78b54a42e1
*: use coreos/bbolt as import path
2017-06-20 11:03:31 -07:00
Anthony Romano
78d099ed1f
Garbage collect pages allocated after minimum txid
...
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.
2017-06-05 16:07:55 -07: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