LUCENE-9935: Clone term vectors reader for merges (#182)

The newly added assertion in the bulk-merge logic doesn't always hold 
because we do not create a new instance of
Lucene90CompressingTermVectorsReader for merges and that reader can be
accessed in tests (as long as it happens on the same thread).

This change clones a new term vectors reader for merges.
This commit is contained in:
Nhat Nguyen 2021-06-15 07:10:30 -04:00 committed by GitHub
parent 50607e0fb9
commit 6f5a413ec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -304,6 +304,11 @@ public final class Lucene90CompressingTermVectorsReader extends TermVectorsReade
return new Lucene90CompressingTermVectorsReader(this);
}
@Override
public TermVectorsReader getMergeInstance() {
return new Lucene90CompressingTermVectorsReader(this);
}
private static RandomAccessInput slice(IndexInput in) throws IOException {
final int length = in.readVInt();
final byte[] bytes = new byte[length];