Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 52536 invoked from network); 12 Sep 2008 18:57:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Sep 2008 18:57:11 -0000 Received: (qmail 88948 invoked by uid 500); 12 Sep 2008 18:57:02 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 88900 invoked by uid 500); 12 Sep 2008 18:57:02 -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 88891 invoked by uid 99); 12 Sep 2008 18:57:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 11:57:01 -0700 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, 12 Sep 2008 18:56:12 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 37365234C1D7 for ; Fri, 12 Sep 2008 11:56:44 -0700 (PDT) Message-ID: <1564701460.1221245804224.JavaMail.jira@brutus> Date: Fri, 12 Sep 2008 11:56:44 -0700 (PDT) From: "Uwe Schindler (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Created: (LUCENE-1385) IndexReader.isIndexCurrent()==false -> IndexReader.reopen() -> still index not current MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org IndexReader.isIndexCurrent()==false -> IndexReader.reopen() -> still index not current -------------------------------------------------------------------------------------- Key: LUCENE-1385 URL: https://issues.apache.org/jira/browse/LUCENE-1385 Project: Lucene - Java Issue Type: Bug Components: Index Affects Versions: 2.3.2 Environment: Linux, Solaris, Windows XP Reporter: Uwe Schindler I found a strange error occurring with IndexReader.reopen. It is not always reproduceable, it only happens sometimes, but strangely on all my computers with different platforms at the same time. Maybe has something to to with the timestamp used in index versions. I have a search server using an IndexReader, that is openend in webapp startup and should stay open. Every half an hour this web application checks, if the index is still current using IndexReader.isCurrent(). When a parallel job that indexes documents (in another virtual machine) and modifies the indexes, isCurrent() return TRUE. The half-hourly cron-job then uses IndexReader.reopen() to reopen the index. But sometimes, directly after reopen() the Index is still not current (and no updates occur). Again calling reopen does not change it, too. Searching on the index shows all new/updated documents, but isCurrent() still return false. The problem with this is, that now the index is reopened all the time, because the detection of a current index does not work any more. I have now a workaround in my code to handle this: After calling IndexReader.reopen(), I test for IndexReader.isCurrent(), and if not, I close it hard and open a new instance. Most times IndexReader.reopen works correct, but sometimes this error occurs. Looking into the code of reopen(), I realized, that there is some extra check, if the Index has modifications, and if yes the reopen call returns the original reader (this maybe the problem I have). But the IndexReader is only used for searching, no updates occur. My questions: Why is there this check for modifications in reopen()? Why does this happen only at certain times on all my servers with different platforms? I want to use reopen, because in future, when the new FieldCache will be reopen-aware and does not everytime rebuild the full cache, it will be very important, to have this fixed. At the moment, I have no problem with the case, that reopen may fail and I have to do a rough reopen. -- 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