dgraph icon indicating copy to clipboard operation
dgraph copied to clipboard

Crash during Benchmark test

Open squalfof opened this issue 9 years ago • 8 comments

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

squalfof avatar Apr 10 '17 03:04 squalfof

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.

manishrjain avatar Apr 10 '17 03:04 manishrjain

@squalfof I couldn't reproduce the issue. It seems like a bug in trace.go. Can you please share the steps to reproduce this.

janardhan1993 avatar Apr 10 '17 04:04 janardhan1993

@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.

janardhan1993 avatar Apr 10 '17 06:04 janardhan1993

sure, i've already raise a bug under the benchmark repo, let me add some details as well

squalfof avatar Apr 10 '17 06:04 squalfof

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.

pawanrawal avatar Apr 10 '17 06:04 pawanrawal

Cool, with modification on worker/sort.go, this bug is fixed. I tried 4 more times, no crashes any more. @janardhan1993

squalfof avatar Apr 10 '17 08:04 squalfof

Can you please share the fix? Send a PR.

manishrjain avatar Apr 10 '17 20:04 manishrjain

@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 ?

squalfof avatar Apr 11 '17 01:04 squalfof