Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 69624 invoked from network); 4 Feb 2005 21:04:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 4 Feb 2005 21:04:37 -0000 Received: (qmail 17354 invoked by uid 500); 4 Feb 2005 21:04:36 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 16497 invoked by uid 500); 4 Feb 2005 21:04:33 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 16482 invoked by uid 99); 4 Feb 2005 21:04:33 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mailer.syr.edu (HELO mailer.syr.edu) (128.230.18.29) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 04 Feb 2005 13:04:32 -0800 Received: from [128.230.38.212] (syru38-212.syr.edu) by mailer.syr.edu (LSMTP for Windows NT v1.1b) with SMTP id <0.13C4471C@mailer.syr.edu>; Fri, 4 Feb 2005 16:04:29 -0500 Message-ID: <4203E35C.2080402@syr.edu> Date: Fri, 04 Feb 2005 16:04:28 -0500 From: Steven Rowe User-Agent: Mozilla Thunderbird 0.9 (Windows/20041111) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lucene Users List Subject: Re: Optimize not deleting all files References: <20050204165525.23042.qmail@web30201.mail.mud.yahoo.com> <4203DB18.8030703@infovia.com.ar> In-Reply-To: <4203DB18.8030703@infovia.com.ar> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Patricio, Is it the case that the "old index files" are not removed from session to session, or only within the same session? The discussion below pertains to the latter case, that is, where the "old index files" are used in the same process as the files replacing them. I was having a similar problem, and tracked the source down to IndexReaders not being closed in my application. As far as I can tell, in order for IndexReaders to present a consistent view of an index while changes are being made to it, read-only copies of the index are kept around until all IndexReaders using them are closed. If any IndexReaders are open on the index, IndexWriters first make a copy, then operate on the copy. If you track down all of these open IndexReaders and close them before optimization, all of the "old index files" should be deleted. (Lucene Gurus, please correct this if I have misrepresented the situation). In my application, I had a bad interaction between IndexReader caching, garbage collection, and incremental indexing, in which a new IndexReader was being opened on an index after each indexing increment, without closing the already-opened IndexReaders. On Windows, operating-system level file locking caused by IndexReaders left open was disallowing index re-creation, because the IndexWriter wasn't allowed to delete the index files opened by the abandoned IndexReaders. In short, if you need to write to an index more than once in a single session, be sure to keep careful track of your IndexReaders. Hope it helps, Steve Patricio Keilty wrote: > Hi Otis, tried version 1.4.3 without success, old index files still > remain in the directory. > Also tried not calling optimize(), and still getting the same behaviour, > maybe our problem is not related to optimize() call at all. > > --p > > Otis Gospodnetic wrote: > >> Get and try Lucene 1.4.3. One of the older versions had a bug that was >> not deleting old index files. >> >> Otis >> >> --- yahootintin.1247688@bloglines.com wrote: >> >> >>> Hi, >>> >>> When I run an optimize in our production environment, old index are >>> left in the directory and are not deleted. >>> My understanding is that an >>> optimize will create new index files and all existing index files >>> should be >>> deleted. Is this correct? >>> >>> We are running Lucene 1.4.2 on Windows. >>> >>> Any help is appreciated. Thanks! --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org