Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 41411 invoked from network); 20 Apr 2005 23:05:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Apr 2005 23:05:34 -0000 Received: (qmail 27883 invoked by uid 500); 20 Apr 2005 23:05:35 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 27866 invoked by uid 500); 20 Apr 2005 23:05:35 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Delivered-To: moderator for java-user@lucene.apache.org Received: (qmail 92429 invoked by uid 99); 20 Apr 2005 12:52:06 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Best way to purposely corrupt an index? Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Date: Wed, 20 Apr 2005 08:52:07 -0400 Message-ID: <6C1FF371E2319F45BABA49F9BA1BD039036F3F@mail.lou.emergint.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Best way to purposely corrupt an index? Thread-Index: AcVFhJFtZ8W4wb/ERQaMSPR13Eg17wAIKYpw From: "Kevin L. Cobb" To: X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N My policy on this type of exception handling is to only byte off what you can chew. If you catch an IOException, then you simply report to the user that an unexpected error has occurred and the search engine is unobtainable at the moment. Errors should be logged and developers should look at the specifics of the error to solve the issue. As you implied, either it's a corrupted index, a permission problem, or another access problem.=20 Trying to attack the issue much deeper than this will sacrifice development/maintenance time for very little payback in the end if you expect this error to occur infrequently.=20 -----Original Message----- From: Andy Roberts [mailto:mail@andy-roberts.net]=20 Sent: Wednesday, April 20, 2005 5:43 AM To: java-user@lucene.apache.org Subject: Re: Best way to purposely corrupt an index? On Wednesday 20 Apr 2005 08:27, Maik Schreiber wrote: > > As the index is rather critical to my program, I just wanted to make it > > really robust, and able to cope should a problem occur with the index > > itself. Otherwise, the user will be left with a non-functioning program > > with no explanation. That's my reasoning anyway. > > You should perhaps go about implementing an automatic index backup feature > of some sort. In the case of index corruption you would at least be able to > go back to the latest backup. Don't worry, I know what I intend to do *should* an error exist. My original=20 post was about how to detect corrupt indexes, and also how to purposely=20 corrupt an index for the purposes of testing. Note, IndexReader throws IOExceptions, but, this could be for a multitude of=20 reasons, not just a corrupt index. I was rather hoping for a=20 CorruptIndexException of some sort! It looks to me that if I do get an IOException, I will then have to perform a=20 number of additional checks to eliminate the other possible causes of=20 IOExceptions (such as permissions issues), and by a process of elimination,=20 determine a corrupt index. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org