Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 17681 invoked from network); 18 Sep 2009 09:37:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Sep 2009 09:37:20 -0000 Received: (qmail 10401 invoked by uid 500); 18 Sep 2009 09:37:19 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 10322 invoked by uid 500); 18 Sep 2009 09:37:19 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 10304 invoked by uid 99); 18 Sep 2009 09:37:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Sep 2009 09:37:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Sep 2009 09:37:17 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6F1F5234C044 for ; Fri, 18 Sep 2009 02:36:57 -0700 (PDT) Message-ID: <2007854457.1253266617453.JavaMail.jira@brutus> Date: Fri, 18 Sep 2009 02:36:57 -0700 (PDT) From: "Michael McCandless (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-1918) Adding empty ParallelReader indexes to an IndexWriter may cause ArrayIndexOutOfBoundsException or NoSuchElementException In-Reply-To: <496846960.1253222637783.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1918?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D127= 57080#action_12757080 ]=20 Michael McCandless commented on LUCENE-1918: -------------------------------------------- Mark, I think we should commit this for 2.9? > Adding empty ParallelReader indexes to an IndexWriter may cause ArrayInde= xOutOfBoundsException or NoSuchElementException > -------------------------------------------------------------------------= ----------------------------------------------- > > Key: LUCENE-1918 > URL: https://issues.apache.org/jira/browse/LUCENE-1918 > Project: Lucene - Java > Issue Type: Bug > Components: Index > Affects Versions: 2.4.1, 2.4.2, 2.9 > Environment: any > Reporter: Christian Kohlsch=C3=BCtter > Assignee: Michael McCandless > Fix For: 2.4.1, 2.9 > > Attachments: LUCENE-1918.patch, ParallelReaderWithEmptyIndex-test= case.patch, ParallelReaderWithEmptyIndex.patch > > Original Estimate: 0.5h > Remaining Estimate: 0.5h > > Hi, > I recently stumbled upon this: > It is possible (and perfectly legal) to add empty indexes (IndexReaders) = to an IndexWriter. However, when using ParallelReaders in this context, in = two situations RuntimeExceptions may occur for no good reason. > Condition 1: > The indexes within the ParallelReader are just empty. > When adding them to the IndexWriter, we get a java.util.NoSuchElementExce= ption triggered by ParallelTermEnum's constructor. The reason for that is t= he TreeMap#firstKey() method which was assumed to return null if there is n= o entry (which is not true, apparently -- it only returns null if the first= key in the Map is null). > Condition 2 (Assuming the aforementioned bug is fixed): > The indexes within the ParallelReader originally contained one or more fi= elds with TermVectors, but all documents have been marked as deleted. > When adding the indexes to the IndexWriter, we get a java.lang.ArrayIndex= OutOfBoundsException triggered by TermVectorsWriter#addAllDocVectors. The r= eason here is that TermVectorsWriter assumes that if the index is marked to= have TermVectors, at least one field actually exists for that. This unfort= unately is not true, either. > Patches and a testcase demonstrating the two bugs are provided. > Cheers, > Christian --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org