Commit Graph

312 Commits

Author SHA1 Message Date
James Mills
80d8ff89da
Fix go.sum 2021-03-02 23:59:53 +10:00
James Mills
19478ff94d
Drop support for Go 1.12 in CI 2021-03-02 23:27:46 +10:00
dependabot-preview[bot]
7235887aca
Bump github.com/sirupsen/logrus from 1.7.1 to 1.8.0 (#209) 2021-02-18 06:49:55 +10:00
dependabot-preview[bot]
3f804c2d81
Bump github.com/sirupsen/logrus from 1.7.0 to 1.7.1 (#208) 2021-02-17 07:18:46 +10:00
dependabot-preview[bot]
babc735772
Bump github.com/stretchr/testify from 1.6.1 to 1.7.0 (#207) 2021-01-14 08:42:56 +10:00
shiniao
4f823851e2
'make bench' excluded the effect of test on the results (#205)
* Refactored Save function for config

* Refactored Save function for config

* 'make bench' excluded the effect of test on the results
2020-12-29 19:27:45 +10:00
James Mills
cbbe36f0ae
Document good and possibly poor use-cases of Bitcask (#199)
* Document good and possibly poor use-cases of Bitcask (Fixes #193)

* Reference Issue #193
2020-12-23 18:48:49 +10:00
Yash Suresh Chandra
5c6ceadac1
Add support for keys with ttl (#177)
* ttl support first commit

* imports fix

* put api args correction

* put options added

* upgrade method added

* upgrade log added

* v0 to v1 migration script added

* error assertion added

* temp migration dir fix

Co-authored-by: yash <yash.chandra@grabpay.com>
2020-12-21 17:41:43 +10:00
Yash Suresh Chandra
f397bec88f
retain lock file after merge (#201)
* Add test case for Locking after Merge

* retain lock file after merge

* remove replacing lock file (not needed)

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Co-authored-by: yash <yash.chandra@grabpay.com>
2020-12-19 02:25:58 +10:00
James Mills
6e423ae179
Update CHANGELOG for v0.3.10 2020-12-18 23:18:50 +10:00
James Mills
8a60b5a370
Fix a bug when MaxValueSize == 0 on Merge operations 2020-12-18 07:35:16 +10:00
Haleem Assal
29e1cf648b
Save metadata on Sync (#197)
* Save metadata on Sync

* Add test
2020-12-15 06:32:48 +10:00
Yash Suresh Chandra
3a6235ea03
exclusive lock before closing db in merge (#196)
Co-authored-by: yash <yash.chandra@grabpay.com>
2020-12-13 21:28:54 +10:00
James Mills
4e7414e920
Fix link to bitcask-bench 2020-12-12 07:55:29 +10:00
James Mills
a6ed0bc12f
Update README.md 2020-12-12 07:54:07 +10:00
James Mills
0ab7d79246
Add support for unlimited key/value sizes 2020-12-12 02:16:36 +10:00
Georges Varouchas
38156e8461
Gv/issue 165 unlock race condition (#175)
* add failing test case to highlight the race condition on bug

note : the test "TestLock" is non deterministic, its outcome depends
on the sequence of instructions yielded by the go scheduler on each run.

There are two values, "goroutines" and "succesfulLockCount", which can
be edited to see how the test performs.
With the committed value, resp "20" and "50", I had a 100% failure on
my local machine, running linux (Ubuntu 20.04).

Sample test output :

$ go test . -run TestLock
--- FAIL: TestLock (0.17s)
    lock_test.go:91: [runner 14] lockCounter was > 1 on  5 occasions, max seen value was  2
    lock_test.go:91: [runner 03] lockCounter was > 1 on  2 occasions, max seen value was  3
    lock_test.go:91: [runner 02] lockCounter was > 1 on  3 occasions, max seen value was  3
    lock_test.go:91: [runner 00] lockCounter was > 1 on  1 occasions, max seen value was  2
    lock_test.go:91: [runner 12] lockCounter was > 1 on  7 occasions, max seen value was  3
    lock_test.go:91: [runner 01] lockCounter was > 1 on  8 occasions, max seen value was  2
    lock_test.go:91: [runner 04] lockCounter was > 1 on  6 occasions, max seen value was  4
    lock_test.go:91: [runner 13] lockCounter was > 1 on  1 occasions, max seen value was  2
    lock_test.go:91: [runner 17] lockCounter was > 1 on  4 occasions, max seen value was  2
    lock_test.go:91: [runner 10] lockCounter was > 1 on  3 occasions, max seen value was  2
    lock_test.go:91: [runner 08] lockCounter was > 1 on  6 occasions, max seen value was  2
    lock_test.go:91: [runner 09] lockCounter was > 1 on  4 occasions, max seen value was  2
    lock_test.go:91: [runner 05] lockCounter was > 1 on  1 occasions, max seen value was  2
    lock_test.go:91: [runner 19] lockCounter was > 1 on  3 occasions, max seen value was  3
    lock_test.go:91: [runner 07] lockCounter was > 1 on  4 occasions, max seen value was  3
    lock_test.go:91: [runner 11] lockCounter was > 1 on  9 occasions, max seen value was  2
    lock_test.go:91: [runner 15] lockCounter was > 1 on  1 occasions, max seen value was  3
    lock_test.go:91: [runner 16] lockCounter was > 1 on  1 occasions, max seen value was  3
FAIL
FAIL	github.com/prologic/bitcask	0.176s
FAIL

* flock: create a wrapper module, local to bitcask, around gofrs.Flock

the racy TestLock has been moved to bitcask/flock

* flock: add test for expected regular locking behavior

* flock: replace gofrs/flock with local implementation

* update go.sum

* Add build constraint for flock_unix.go

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
2020-12-11 20:56:58 +10:00
Yash Suresh Chandra
e1cdffd8f1
new merge approach (#191)
* new merge approach

* code refactor

* comment added

* isMerging flag added to allow 1 merge operation at a time

* get api modified. merge updated (no recursive read locks)

Co-authored-by: yash <yash.chandra@grabpay.com>
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
2020-12-11 20:48:41 +10:00
James Mills
80c06a3572
Remove some workflows that won't work on Forks anyway 2020-12-11 20:45:26 +10:00
James Mills
9172eb0f90
Fix CI (again) 2020-12-11 20:43:56 +10:00
James Mills
c09ce153e9
Fix CI 2020-12-11 20:41:44 +10:00
James Mills
d3428bac8c
Drop support for Windows (Closes #192) 2020-12-11 20:33:53 +10:00
yashschandra
158f6d9888
Get space that can be reclaimed (#189)
* get reclaimable space added

* import order fix

Co-authored-by: yash <yash.chandra@grabpay.com>
2020-12-01 06:07:00 +10:00
yashschandra
f4357e6f18
local live backup support (#185)
* live backup first commit

* exclude lock file in backup

* create path if not exist for backup

Co-authored-by: yash <yash.chandra@grabpay.com>
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
2020-11-30 07:49:02 +10:00
James Mills
5e01d6d098
Add a few more test cases for concurrent operations 2020-11-27 16:52:08 +10:00
James Mills
c0c0b5369a
Update CHANGELOG for v0.3.9 2020-11-17 19:30:54 +10:00
James Mills
720f03c6c2
Fix a race condition around .Close() and .Sync() 2020-11-17 19:30:44 +10:00
James Mills
e900e2fa77
Update CHANGELOG for v0.3.8 2020-11-17 19:19:38 +10:00
James Mills
a2c0d16ba4
Update CHANGELOG for v0.3.7 2020-11-17 19:14:23 +10:00
James Mills
08d2adcd17
go mod tidy 2020-11-17 19:14:14 +10:00
James Mills
e61d1a9b42
Update CHANGELOG for v0.3.6 2020-11-17 19:11:35 +10:00
James Mills
4cfd5bf8ad
Ignore built binraires 2020-11-17 19:11:22 +10:00
dependabot-preview[bot]
51942cb5d8
Bump github.com/tidwall/redcon from 1.3.3 to 1.4.0 (#184)
Bumps [github.com/tidwall/redcon](https://github.com/tidwall/redcon) from 1.3.3 to 1.4.0.
- [Release notes](https://github.com/tidwall/redcon/releases)
- [Commits](https://github.com/tidwall/redcon/compare/v1.3.3...v1.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-07 06:49:42 +10:00
Bryan Stenson
295301a44c
Add configuration options for FileMode (#183)
* Add configuration options for FileMode

Add two additional configuration values, and their corresponding default values:

* DirFileModeBeforeUmask - Dir FileMode is used on all directories created.  DefaultDirFileModeBeforeUmask is 0700.
* FileFileModeBeforeUmask - File FileMode is used on all files created, except for the "lock" file (managed by the Flock library).  DefaultFileFileModeBeforeUmask is 0600.

When using these bits of configuration, keep in mind these FileMode values are set BEFORE any umask rules are applied.  For example, if the user's umask is 022, setting DirFileFileModeBeforeUmask to 777 will result in directories with FileMode set to 755 (this umask prevents the write bit from being applied to group and world permissions).

* moving defer statements after checking for errors

use os.ModePerm const instead of os.FileMode(777)

* fix spelling/grammar

* skip these tests for Windows as they appear to break - Windows is less POSIX-y than it claims

* ignore "lock" file for default case too -- this was incorrectly passing before including this, as my local dev station has umask 022
2020-11-05 08:06:45 +10:00
Mark Wylde
2e1a91f2af
Add imports and log in example code (#182) 2020-11-04 13:46:26 +10:00
dependabot-preview[bot]
190b119338
Bump github.com/tidwall/redcon from 1.3.2 to 1.3.3 (#180)
Bumps [github.com/tidwall/redcon](https://github.com/tidwall/redcon) from 1.3.2 to 1.3.3.
- [Release notes](https://github.com/tidwall/redcon/releases)
- [Commits](https://github.com/tidwall/redcon/compare/v1.3.2...v1.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-31 07:15:50 +10:00
shiniao
643e578585
Refactored Save function for config (#179)
* Refactored Save function for config

* Refactored Save function for config
2020-10-29 21:47:08 +10:00
dependabot-preview[bot]
b7e2012b80
Bump github.com/sirupsen/logrus from 1.6.0 to 1.7.0 (#176)
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.6.0...v1.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-15 16:49:57 +10:00
dependabot-preview[bot]
0c1c74e6c4
Bump github.com/gofrs/flock from 0.7.3 to 0.8.0 (#174)
Bumps [github.com/gofrs/flock](https://github.com/gofrs/flock) from 0.7.3 to 0.8.0.
- [Release notes](https://github.com/gofrs/flock/releases)
- [Commits](https://github.com/gofrs/flock/compare/v0.7.3...v0.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-28 13:15:34 +10:00
garsue
4006519992
Fix typo in labeler (#172)
* Fix typo in labeler

Maybe just a typo :)

* Update AUTHORS

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
2020-08-25 20:55:44 +10:00
James Mills
27ec7a23e3
Update README.md 2020-08-25 16:33:56 +10:00
dependabot-preview[bot]
6634ccde21
Bump github.com/gofrs/flock from 0.7.1 to 0.7.3 (#173)
Bumps [github.com/gofrs/flock](https://github.com/gofrs/flock) from 0.7.1 to 0.7.3.
- [Release notes](https://github.com/gofrs/flock/releases)
- [Commits](https://github.com/gofrs/flock/compare/v0.7.1...v0.7.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-25 15:49:15 +10:00
dependabot-preview[bot]
13912e383a
Bump github.com/plar/go-adaptive-radix-tree from 1.0.3 to 1.0.4 (#170)
Bumps [github.com/plar/go-adaptive-radix-tree](https://github.com/plar/go-adaptive-radix-tree) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/plar/go-adaptive-radix-tree/releases)
- [Commits](https://github.com/plar/go-adaptive-radix-tree/compare/v1.0.3...v1.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-19 21:45:42 +10:00
James Mills
1a0d77e045
Remove Stargazers grpah (kind of useless0 2020-08-15 22:25:07 +10:00
dependabot-preview[bot]
b326f2c662
Bump github.com/plar/go-adaptive-radix-tree from 1.0.1 to 1.0.3 (#169)
Bumps [github.com/plar/go-adaptive-radix-tree](https://github.com/plar/go-adaptive-radix-tree) from 1.0.1 to 1.0.3.
- [Release notes](https://github.com/plar/go-adaptive-radix-tree/releases)
- [Commits](https://github.com/plar/go-adaptive-radix-tree/compare/v1.0.1...v1.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-13 22:49:21 +10:00
dependabot-preview[bot]
90bbe650d3
Bump github.com/spf13/viper from 1.7.0 to 1.7.1 (#167)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.7.0...v1.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-04 14:11:08 +10:00
James Mills
c4a0ab37b1
Fix builds configuration for goreleaser 2020-07-27 11:13:12 +10:00
James Mills
8411c42f00
Update CHANGELOG for v0.3.6 2020-07-27 11:11:37 +10:00
James Mills
063bc3590a
Fix (again) goreleaser config 2020-07-27 11:11:27 +10:00
James Mills
0f0a400e79
Update CHANGELOG for v0.3.6 2020-07-27 11:10:18 +10:00