mirror of
https://github.com/apache/lucene.git
synced 2025-03-01 13:59:12 +00:00
LUCENE-1520: prevent OOM in CheckIndex with large segment that has many fields w/ norms
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@734967 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
888af0337d
commit
5c948da5fb
@ -414,7 +414,8 @@ public class CheckIndex {
|
||||
Iterator it = fieldNames.iterator();
|
||||
while(it.hasNext()) {
|
||||
final String fieldName = (String) it.next();
|
||||
byte[] b = reader.norms(fieldName);
|
||||
final byte[] b = new byte[reader.maxDoc()];
|
||||
reader.norms(fieldName, b, 0);
|
||||
if (b.length != info.docCount)
|
||||
throw new RuntimeException("norms for field \"" + fieldName + "\" is length " + b.length + " != maxDoc " + info.docCount);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user