Crash during Benchmark test
Writing snapshot to WAL: {Data:[9 1 0 0 0 0 0 0 0 16 1 26 15 108 111 99 97 108 104 111 115 116 58 49 50 51 52 53] Metadata:{ConfState:{Nodes:[1] XXX_unrecognized:[]} Index:64145 Term:5 XXX_unrecognized:[]} XXX_unrecognized:[]}
panic: runtime error: index out of range
goroutine 222571 [running]:
golang.org/x/net/trace.(*trace).addEvent(0xc4216b2820, 0xb7e9a0, 0xc42268f9e0, 0xc4243f0000)
/home/terark/go/src/golang.org/x/net/trace/trace.go:769 +0x65f
golang.org/x/net/trace.(*trace).LazyPrintf(0xc4216b2820, 0xc5ee02, 0x16, 0xc4243febf0, 0x1, 0x1)
/home/terark/go/src/golang.org/x/net/trace/trace.go:798 +0xa5
github.com/dgraph-io/dgraph/x.Trace(0x11b9580, 0xc424114280, 0xc5ee02, 0x16, 0xc4243febf0, 0x1, 0x1)
/home/terark/go/src/github.com/dgraph-io/dgraph/x/x.go:110 +0xcd
github.com/dgraph-io/dgraph/worker.sortWithIndex(0x7f171d341840, 0xc424114280, 0xc422132280, 0x0, 0x0, 0x0)
/home/terark/go/src/github.com/dgraph-io/dgraph/worker/sort.go:210 +0x893
github.com/dgraph-io/dgraph/worker.processSort.func2(0x7f171d341840, 0xc424114280, 0xc422132280, 0xc42ddfba40)
/home/terark/go/src/github.com/dgraph-io/dgraph/worker/sort.go:274 +0x43
created by github.com/dgraph-io/dgraph/worker.processSort
/home/terark/go/src/github.com/dgraph-io/dgraph/worker/sort.go:279 +0x197
On v0.7.4, loaded with 21million data, run benchmark test
go test -v -bench=Dgraph -benchtime=5s .
Besides i've updated the query_test.go according to newest query syntax, and set poolSize = 32
Though, this looks like a bug in trace.go, than Dgraph. Can you confirm, @janardhan1993 ?
Update: Saw this in trace.go code.
NOTE TO DEBUGGERS
If you are here because your program panicked in this code,
it is almost definitely the fault of code using this package,
and very unlikely to be the fault of this code.
The most likely scenario is that some code elsewhere is using
a trace.Trace after its Finish method is called.
You can temporarily set the DebugUseAfterFinish var
to help discover where that is; do not leave that var set,
since it makes this package much less efficient.
@squalfof I couldn't reproduce the issue. It seems like a bug in trace.go. Can you please share the steps to reproduce this.
@squalfof The benchmark code doesn't work with latest version of dgraph. Can you please raise a PR for the changes you did to make it work with latest version.
sure, i've already raise a bug under the benchmark repo, let me add some details as well
Oh, we missed the issue under benchmark repo. Usually we only look for issues in the Dgraph repo. I will update the benchmark tests by tomorrow.
Cool, with modification on worker/sort.go, this bug is fixed. I tried 4 more times, no crashes any more. @janardhan1993
Can you please share the fix? Send a PR.
@manishrjain: @janardhan1993 fixed this issue, i copied his code, then retries the case several times, all works well. Thought @janardhan1993 has submitted the code already ?