[ 
https://issues.apache.org/jira/browse/LUCENE-3627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13165228#comment-13165228
 ] 

Shane Detsch commented on LUCENE-3627:
--------------------------------------

Would you ever have the case there only one "segements_N" file is corrupt 'i.e. 
0 size'? If so how would another "segments_N" file be regenerated?  Does this 
0-sized "segments_N" file always happen on a newly generated "segmetns_N" and 
"segments_N-1" still exist and is considered active?  After deletion of the 
0-sized "segments_N" file is there a process to make sure that the currently 
active "segmetns_N" (not the 0-sized one) accurately represents the segments in 
the index?
                
> CorruptIndexException on indexing after a failure occurs after segments file 
> creation but before any bytes are written
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3627
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3627
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 3.5
>         Environment: lucene-3.5.0, src download from GA release 
> lucene.apache.org.
> Mac OS X 10.6.5, running tests in Eclipse Build id: 20100218-1602, 
> java version "1.6.0_24"
> Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
> Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)
>            Reporter: Ken McCracken
>            Assignee: Michael McCandless
>            Priority: Critical
>         Attachments: LUCENE-3627.patch, LUCENE-3627_initial_proposal.txt, 
> TestCrashCausesCorruptIndex.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> FSDirectory.createOutput(..) uses a RandomAccessFile to do its work.  On my 
> system the default FSDirectory.open(..) creates an NIOFSDirectory.  If 
> createOutput is called on a segments_* file and a crash occurs between 
> RandomAccessFile creation (file system shows a segments_* file exists but has 
> zero bytes) but before any bytes are written to the file, subsequent 
> IndexWriters cannot proceed.  The difficulty is that it does not know how to 
> clear the empty segments_* file.  None of the file deletions will happen on 
> such a segment file because the opening bytes cannot not be read to determine 
> format and version.
> An initial proposed patch file is attached below.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to