-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index out of range when visiting stored fields #123
Comments
@enex hello! Do you get this all the time? Is there a reproducer? Have you re-created your indexes from scratch or trying to use existing index with new version? |
I recreated the index with the new version (using the old immediately fails). It always crashes after a few batches. I am currently trying to create a simple example that behaves the same |
I reproduced similar panic by stressing our tests too. Though in my case it was originating from different path (from merger). But I think the root cause may be the same.
Moreover, with v0.2.1 I am observing occasional
We are using |
Found a test case that reproduces both panics (most of the time it fails on my machine with one of the panics mentioned above). Maybe it's possible to simplify it further. func TestPanic(t *testing.T) {
indexWriter, err := OpenWriter(InMemoryOnlyConfig())
if err != nil {
t.Fatal(err)
}
batch := NewBatch()
for i := 0; i < 1000; i++ {
doc := NewDocument("a" + strconv.Itoa(i)).
AddField(NewKeywordField("location", "/a").Aggregatable().StoreValue())
batch.Update(doc.ID(), doc)
}
err = indexWriter.Batch(batch)
if err != nil {
t.Error(err)
}
batch.Reset()
for i := 0; i < 1000; i++ {
doc := NewDocument("a" + strconv.Itoa(i+1000))
batch.Update(doc.ID(), doc)
}
err = indexWriter.Batch(batch)
if err != nil {
t.Error(err)
}
indexReader, err := indexWriter.Reader()
if err != nil {
t.Fatalf("error getting reader: %v", err)
}
defer func() { _ = indexReader.Close() }()
req := NewAllMatches(NewPrefixQuery("/a").SetField("location"))
documentMatchIterator, err := indexReader.Search(context.Background(), req)
if err != nil {
t.Fatalf("error search: %v", err)
}
match, err := documentMatchIterator.Next()
for err == nil && match != nil {
err = match.VisitStoredFields(func(field string, value []byte) bool {
return true
})
match, err = documentMatchIterator.Next()
}
if err != nil {
t.Fatalf("error iterating: %v", err)
}
} |
since the update to ice v2 I get the following error:
Am I doing something wrong? Should there be an additional check?
The text was updated successfully, but these errors were encountered: