mirror of
https://github.com/gogrlx/bitcask.git
synced 2026-04-04 12:02:46 -07:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c0c0b5369a | |||
| 720f03c6c2 | |||
| e900e2fa77 |
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,7 +1,27 @@
|
||||
|
||||
<a name="v0.3.9"></a>
|
||||
## [v0.3.9](https://github.com/prologic/bitcask/compare/v0.3.8...v0.3.9) (2020-11-17)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix a race condition around .Close() and .Sync()
|
||||
|
||||
|
||||
<a name="v0.3.8"></a>
|
||||
## [v0.3.8](https://github.com/prologic/bitcask/compare/v0.3.7...v0.3.8) (2020-11-17)
|
||||
|
||||
### Updates
|
||||
|
||||
* Update CHANGELOG for v0.3.8
|
||||
|
||||
|
||||
<a name="v0.3.7"></a>
|
||||
## [v0.3.7](https://github.com/prologic/bitcask/compare/v0.3.6...v0.3.7) (2020-11-17)
|
||||
|
||||
### Updates
|
||||
|
||||
* Update CHANGELOG for v0.3.7
|
||||
|
||||
|
||||
<a name="v0.3.6"></a>
|
||||
## [v0.3.6](https://github.com/prologic/bitcask/compare/v0.3.5...v0.3.6) (2020-11-17)
|
||||
|
||||
@@ -87,7 +87,10 @@ func (b *Bitcask) Stats() (stats Stats, err error) {
|
||||
// Close() as this is the only way to cleanup the lock held by the open
|
||||
// database.
|
||||
func (b *Bitcask) Close() error {
|
||||
b.mu.RLock()
|
||||
|
||||
defer func() {
|
||||
b.mu.RUnlock()
|
||||
b.Flock.Unlock()
|
||||
os.Remove(b.Flock.Path())
|
||||
}()
|
||||
@@ -107,6 +110,8 @@ func (b *Bitcask) Close() error {
|
||||
|
||||
// Sync flushes all buffers to disk ensuring all data is written
|
||||
func (b *Bitcask) Sync() error {
|
||||
b.mu.RLock()
|
||||
defer b.mu.RUnlock()
|
||||
return b.curr.Sync()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user