Fix invalid queue.db error

This commit is contained in:
tidwall 2021-03-30 15:38:42 -07:00
parent 40105e6b7e
commit 87a3ed5f0a
7 changed files with 17 additions and 4 deletions

2
go.mod
View File

@ -14,7 +14,7 @@ require (
github.com/peterh/liner v1.2.1
github.com/streadway/amqp v1.0.0
github.com/tidwall/btree v0.4.2
github.com/tidwall/buntdb v1.2.1
github.com/tidwall/buntdb v1.2.2
github.com/tidwall/geoindex v1.4.3
github.com/tidwall/geojson v1.2.7
github.com/tidwall/gjson v1.7.4

4
go.sum
View File

@ -118,6 +118,8 @@ github.com/tidwall/btree v0.4.2 h1:aLwwJlG+InuFzdAPuBf9YCAR1LvSQ9zhC5aorFPlIPs=
github.com/tidwall/btree v0.4.2/go.mod h1:huei1BkDWJ3/sLXmO+bsCNELL+Bp2Kks9OLyQFkzvA8=
github.com/tidwall/buntdb v1.2.1 h1:+s5TqjuAfo6IdMa8boDkCx5PzT2mlP5AwgNN4yxJba8=
github.com/tidwall/buntdb v1.2.1/go.mod h1:4FUodsOaaFBuhPvQyTafaxVM5GFdQZnz98W3BaNmve4=
github.com/tidwall/buntdb v1.2.2 h1:46G3ulKw8NYo0JAvsZkf7Xq1c8OHOPRuHQVTfL6z+lE=
github.com/tidwall/buntdb v1.2.2/go.mod h1:+i/gBwYOHWG19wLgwMXFLkl00twh9+VWkkaOhuNQ4PA=
github.com/tidwall/cities v0.1.0 h1:CVNkmMf7NEC9Bvokf5GoSsArHCKRMTgLuubRTHnH0mE=
github.com/tidwall/cities v0.1.0/go.mod h1:lV/HDp2gCcRcHJWqgt6Di54GiDrTZwh1aG2ZUPNbqa4=
github.com/tidwall/geoindex v1.4.3 h1:zowx7LtzibIE6JPbL6CRgVgw9qp13dJ8Pzfa4/f+4us=
@ -130,6 +132,8 @@ github.com/tidwall/grect v0.1.1 h1:+kMEkxhoqB7rniVXzMEIA66XwU07STgINqxh+qVIndY=
github.com/tidwall/grect v0.1.1/go.mod h1:CzvbGiFbWUwiJ1JohXLb28McpyBsI00TK9Y6pDWLGRQ=
github.com/tidwall/lotsa v1.0.1 h1:w4gpDvI7RdkgbMC0q5ndKqG2ffrwCgerUY/gM2TYkH4=
github.com/tidwall/lotsa v1.0.1/go.mod h1:X6NiU+4yHA3fE3Puvpnn1XMDrFZrE9JO2/w+UMuqgR8=
github.com/tidwall/lotsa v1.0.2 h1:dNVBH5MErdaQ/xd9s769R31/n2dXavsQ0Yf4TMEHHw8=
github.com/tidwall/lotsa v1.0.2/go.mod h1:X6NiU+4yHA3fE3Puvpnn1XMDrFZrE9JO2/w+UMuqgR8=
github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE=
github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8=

View File

@ -861,6 +861,7 @@ func (db *DB) readLoad(rd io.Reader, modTime time.Time) (n int64, err error) {
}
// copy string
parts = append(parts, string(data[:n]))
cmdByteSize += int64(n + 2)
}
// finished reading the command

View File

@ -6,6 +6,7 @@ require (
github.com/tidwall/btree v0.4.2
github.com/tidwall/gjson v1.7.4
github.com/tidwall/grect v0.1.1
github.com/tidwall/lotsa v1.0.2
github.com/tidwall/match v1.0.3
github.com/tidwall/rtred v0.1.2
)

View File

@ -4,6 +4,8 @@ github.com/tidwall/gjson v1.7.4 h1:19cchw8FOxkG5mdLRkGf9jqIqEyqdZhPqW60XfyFxk8=
github.com/tidwall/gjson v1.7.4/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk=
github.com/tidwall/grect v0.1.1 h1:+kMEkxhoqB7rniVXzMEIA66XwU07STgINqxh+qVIndY=
github.com/tidwall/grect v0.1.1/go.mod h1:CzvbGiFbWUwiJ1JohXLb28McpyBsI00TK9Y6pDWLGRQ=
github.com/tidwall/lotsa v1.0.2 h1:dNVBH5MErdaQ/xd9s769R31/n2dXavsQ0Yf4TMEHHw8=
github.com/tidwall/lotsa v1.0.2/go.mod h1:X6NiU+4yHA3fE3Puvpnn1XMDrFZrE9JO2/w+UMuqgR8=
github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE=
github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8=

View File

@ -49,9 +49,14 @@ func Ops(count, threads int, op func(i, thread int)) {
dur := time.Since(start)
var alloc uint64
if MemUsage {
runtime.GC()
var ms2 runtime.MemStats
runtime.ReadMemStats(&ms2)
alloc = ms2.HeapAlloc - ms1.HeapAlloc
if ms1.HeapAlloc > ms2.HeapAlloc {
alloc = 0
} else {
alloc = ms2.HeapAlloc - ms1.HeapAlloc
}
}
WriteOutput(output, count, threads, dur, alloc)
}

4
vendor/modules.txt vendored
View File

@ -117,7 +117,7 @@ github.com/streadway/amqp
# github.com/tidwall/btree v0.4.2
## explicit
github.com/tidwall/btree
# github.com/tidwall/buntdb v1.2.1
# github.com/tidwall/buntdb v1.2.2
## explicit
github.com/tidwall/buntdb
# github.com/tidwall/cities v0.1.0
@ -137,7 +137,7 @@ github.com/tidwall/geojson/geometry
github.com/tidwall/gjson
# github.com/tidwall/grect v0.1.1
github.com/tidwall/grect
# github.com/tidwall/lotsa v1.0.1
# github.com/tidwall/lotsa v1.0.2
github.com/tidwall/lotsa
# github.com/tidwall/match v1.0.3
## explicit