blevesearch / bleve

A modern text/numeric/geo-spatial/vector indexing library for go
Apache License 2.0
10.1k stars 686 forks source link

index out of range [-1] in the zapx lib #1648

Open meirwah opened 2 years ago

meirwah commented 2 years ago

issue I'm seeing happening in logs with zapx v15:

panic: runtime error: index out of range [-1]
goroutine 205 [running]:
github.com/blevesearch/zapx/v15.mergeStoredAndRemap.func2(0xc0076e2cf0, 0x27, 0x74, 0xc005d7cd3c, 0x15, 0x336b8, 0x0, 0x0, 0x0, 0x1)
/builds/gopath/pkg/mod/github.com/blevesearch/zapx/v15@v15.2.1/merge.go:722 +0x57b
github.com/blevesearch/zapx/v15.(*SegmentBase).visitStoredFields(0xc000770800, 0xc001c14000, 0x5d7, 0xc002777698, 0x2df, 0x0)
/builds/gopath/pkg/mod/github.com/blevesearch/zapx/v15@v15.2.1/segment.go:382 +0x39c
github.com/blevesearch/zapx/v15.mergeStoredAndRemap(0xc00950e060, 0x3, 0x3, 0xc00950e048, 0x3, 0x3, 0xc00c3de690, 0xc002780000, 0x216e2, 0x216e2, ...)
 /builds/gopath/pkg/mod/github.com/blevesearch/zapx/v15@v15.2.1/merge.go:720 +0x48b
github.com/blevesearch/zapx/v15.MergeToWriter(0xc00950e060, 0x3, 0x3, 0xc00950e048, 0x3, 0x3, 0x402, 0xc0093c24b0, 0xc0093f6060, 0x40fc1b, ...)
/builds/gopath/pkg/mod/github.com/blevesearch/zapx/v15@v15.2.1/merge.go:131 +0x1fc
github.com/blevesearch/zapx/v15.mergeSegmentBases(0xc00950e060, 0x3, 0x3, 0xc00950e048, 0x3, 0x3, 0xc0005f6000, 0x3e, 0x402, 0xc0093f6060, ...)
/builds/gopath/pkg/mod/github.com/blevesearch/zapx/v15@v15.2.1/merge.go:78 +0x259
github.com/blevesearch/zapx/v15.(*ZapPlugin).Merge(0x512b408, 0xc0093c2480, 0x3, 0x3, 0xc00950e048, 0x3, 0x3, 0xc0005f6000, 0x3e, 0xc0093f6060, ...)
/builds/gopath/pkg/mod/github.com/blevesearch/zapx/v15@v15.2.1/merge.go:53 +0x14c
github.com/blevesearch/bleve/v2/index/scorch.(*Scorch).planMergeAtSnapshot(0xc000776c00, 0x36880d0, 0xc000040060, 0xc009470140, 0xc0002d4b00, 0x0, 0x0)
/builds/gopath/pkg/mod/github.com/blevesearch/bleve/v2@v2.0.6/index/scorch/merge.go:322 +0xb93
github.com/blevesearch/bleve/v2/index/scorch.(*Scorch).mergerLoop(0xc000776c00)/builds/gopath/pkg/mod/github.com/blevesearch/bleve/v2@v2.0.6/index/scorch/merge.go:68 +0x574
created by github.com/blevesearch/bleve/v2/index/scorch.(*Scorch).Open
/builds/gopath/pkg/mod/github.com/blevesearch/bleve/v2@v2.0.6/index/scorch/scorch.go:186 +0x129

unable to give here reproduce steps

and sorry if I needed to open this in zapx repo, wasn't sure about it

abhinavdangeti commented 2 years ago

sorry if I needed to open this in zapx repo, wasn't sure about it

@meirwah That's fine.

A unit test or at least a sequence of steps to reproduce this stack trace would've helped. Let me take a stab at it, meanwhile do share any more information on this if you think it'd help.