mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07: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)
|
close(resumeC)
|
||||||
resumeC = nil
|
resumeC = nil
|
||||||
case <-db.closeC:
|
case <-db.closeC:
|
||||||
return
|
db.compactionExitTransact()
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -338,7 +338,7 @@ func (db *DB) memCompaction() {
|
|||||||
case <-resumeC:
|
case <-resumeC:
|
||||||
close(resumeC)
|
close(resumeC)
|
||||||
case <-db.closeC:
|
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
|
package leveldb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -15,6 +16,10 @@ import (
|
|||||||
"github.com/syndtr/goleveldb/leveldb/storage"
|
"github.com/syndtr/goleveldb/leveldb/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
errHasFrozenMem = errors.New("has frozen mem")
|
||||||
|
)
|
||||||
|
|
||||||
type memDB struct {
|
type memDB struct {
|
||||||
db *DB
|
db *DB
|
||||||
*memdb.DB
|
*memdb.DB
|
||||||
@ -126,7 +131,7 @@ func (db *DB) newMem(n int) (mem *memDB, err error) {
|
|||||||
defer db.memMu.Unlock()
|
defer db.memMu.Unlock()
|
||||||
|
|
||||||
if db.frozenMem != nil {
|
if db.frozenMem != nil {
|
||||||
panic("still has frozen mem")
|
return nil, errHasFrozenMem
|
||||||
}
|
}
|
||||||
|
|
||||||
if db.journal == nil {
|
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) {
|
func (db *DB) rotateMem(n int, wait bool) (mem *memDB, err error) {
|
||||||
|
retryLimit := 3
|
||||||
|
retry:
|
||||||
// Wait for pending memdb compaction.
|
// Wait for pending memdb compaction.
|
||||||
err = db.compTriggerWait(db.mcompCmdC)
|
err = db.compTriggerWait(db.mcompCmdC)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
retryLimit--
|
||||||
|
|
||||||
// Create new memdb and journal.
|
// Create new memdb and journal.
|
||||||
mem, err = db.newMem(n)
|
mem, err = db.newMem(n)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err == errHasFrozenMem {
|
||||||
|
if retryLimit <= 0 {
|
||||||
|
panic("BUG: still has frozen memdb")
|
||||||
|
}
|
||||||
|
goto retry
|
||||||
|
}
|
||||||
return
|
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:
|
case blockTypeSnappyCompression:
|
||||||
decLen, err := snappy.DecodedLen(data[:bh.length])
|
decLen, err := snappy.DecodedLen(data[:bh.length])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
r.bpool.Put(data)
|
||||||
return nil, r.newErrCorruptedBH(bh, err.Error())
|
return nil, r.newErrCorruptedBH(bh, err.Error())
|
||||||
}
|
}
|
||||||
decData := r.bpool.Get(decLen)
|
decData := r.bpool.Get(decLen)
|
||||||
|
2
vendor/manifest
vendored
2
vendor/manifest
vendored
@ -265,7 +265,7 @@
|
|||||||
"importpath": "github.com/syndtr/goleveldb",
|
"importpath": "github.com/syndtr/goleveldb",
|
||||||
"repository": "https://github.com/syndtr/goleveldb",
|
"repository": "https://github.com/syndtr/goleveldb",
|
||||||
"vcs": "git",
|
"vcs": "git",
|
||||||
"revision": "23851d93a2292dcc56e71a18ec9e0624d84a0f65",
|
"revision": "3c5717caf1475fd25964109a0fc640bd150fce43",
|
||||||
"branch": "master"
|
"branch": "master"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user