mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
vendor: Update github.com/syndtr/goleveldb
This commit is contained in:
parent
4e3fdfaeef
commit
151004d645
4
vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go
generated
vendored
4
vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go
generated
vendored
@ -289,7 +289,7 @@ func (db *DB) memCompaction() {
|
||||
close(resumeC)
|
||||
resumeC = nil
|
||||
case <-db.closeC:
|
||||
return
|
||||
db.compactionExitTransact()
|
||||
}
|
||||
|
||||
var (
|
||||
@ -338,7 +338,7 @@ func (db *DB) memCompaction() {
|
||||
case <-resumeC:
|
||||
close(resumeC)
|
||||
case <-db.closeC:
|
||||
return
|
||||
db.compactionExitTransact()
|
||||
}
|
||||
}
|
||||
|
||||
|
7
vendor/github.com/syndtr/goleveldb/leveldb/db_state.go
generated
vendored
7
vendor/github.com/syndtr/goleveldb/leveldb/db_state.go
generated
vendored
@ -7,6 +7,7 @@
|
||||
package leveldb
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
@ -15,6 +16,10 @@ import (
|
||||
"github.com/syndtr/goleveldb/leveldb/storage"
|
||||
)
|
||||
|
||||
var (
|
||||
errHasFrozenMem = errors.New("has frozen mem")
|
||||
)
|
||||
|
||||
type memDB struct {
|
||||
db *DB
|
||||
*memdb.DB
|
||||
@ -126,7 +131,7 @@ func (db *DB) newMem(n int) (mem *memDB, err error) {
|
||||
defer db.memMu.Unlock()
|
||||
|
||||
if db.frozenMem != nil {
|
||||
panic("still has frozen mem")
|
||||
return nil, errHasFrozenMem
|
||||
}
|
||||
|
||||
if db.journal == nil {
|
||||
|
9
vendor/github.com/syndtr/goleveldb/leveldb/db_write.go
generated
vendored
9
vendor/github.com/syndtr/goleveldb/leveldb/db_write.go
generated
vendored
@ -32,15 +32,24 @@ func (db *DB) writeJournal(batches []*Batch, seq uint64, sync bool) error {
|
||||
}
|
||||
|
||||
func (db *DB) rotateMem(n int, wait bool) (mem *memDB, err error) {
|
||||
retryLimit := 3
|
||||
retry:
|
||||
// Wait for pending memdb compaction.
|
||||
err = db.compTriggerWait(db.mcompCmdC)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
retryLimit--
|
||||
|
||||
// Create new memdb and journal.
|
||||
mem, err = db.newMem(n)
|
||||
if err != nil {
|
||||
if err == errHasFrozenMem {
|
||||
if retryLimit <= 0 {
|
||||
panic("BUG: still has frozen memdb")
|
||||
}
|
||||
goto retry
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
1
vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go
generated
vendored
1
vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go
generated
vendored
@ -581,6 +581,7 @@ func (r *Reader) readRawBlock(bh blockHandle, verifyChecksum bool) ([]byte, erro
|
||||
case blockTypeSnappyCompression:
|
||||
decLen, err := snappy.DecodedLen(data[:bh.length])
|
||||
if err != nil {
|
||||
r.bpool.Put(data)
|
||||
return nil, r.newErrCorruptedBH(bh, err.Error())
|
||||
}
|
||||
decData := r.bpool.Get(decLen)
|
||||
|
2
vendor/manifest
vendored
2
vendor/manifest
vendored
@ -265,7 +265,7 @@
|
||||
"importpath": "github.com/syndtr/goleveldb",
|
||||
"repository": "https://github.com/syndtr/goleveldb",
|
||||
"vcs": "git",
|
||||
"revision": "23851d93a2292dcc56e71a18ec9e0624d84a0f65",
|
||||
"revision": "3c5717caf1475fd25964109a0fc640bd150fce43",
|
||||
"branch": "master"
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user