tidwall/shardmap

panic: bad news

Closed this issue · 2 comments

CAFxX commented

This happens roughly once every few runs (other maps removed):

go run bench/main.go

go version go1.13 darwin/amd64

     number of cpus: 12
     number of keys: 10000000
            keysize: 10
        random seed: 1569543723944908000

-- github.com/tidwall/shardmap --
set: 10,000,000 ops over 12 threads in 973ms, 10,272,813/sec, 97 ns/op
get: panic: bad news

goroutine 66 [running]:
main.main.func2(0x8f87a3, 0xb)
        /Users/cafxx/go/src/github.com/tidwall/shardmap/bench/main.go:155 +0xa1
github.com/tidwall/lotsa.Ops.func1(0xc0174ef070, 0x989680, 0xc00006e180, 0xb, 0x8bdf47, 0x98967f)
        /Users/cafxx/go/src/github.com/tidwall/lotsa/lotsa.go:45 +0x98
created by github.com/tidwall/lotsa.Ops
        /Users/cafxx/go/src/github.com/tidwall/lotsa/lotsa.go:39 +0x16c

Bad news indeed! lol. I'll poke around a bit. Thanks for reporting.

I fixed the issue by ensuring the key randomizer does not include duplicates keys.