You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Mark Harwood (JIRA)" <ji...@apache.org> on 2011/06/28 16:49:17 UTC

[jira] [Created] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Corrupted segment file not detected and wipes index contents
------------------------------------------------------------

                 Key: LUCENE-3255
                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
             Project: Lucene - Java
          Issue Type: Bug
    Affects Versions: 3.2, 2.9.4
            Reporter: Mark Harwood
         Attachments: BadSegmentsFileTest.java

Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Assigned] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless reassigned LUCENE-3255:
------------------------------------------

    Assignee: Michael McCandless

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056602#comment-13056602 ] 

Michael McCandless commented on LUCENE-3255:
--------------------------------------------

Nice catch!  Indeed, because of back compat, we read a leading 0 as being an ancient format, and then interpret the next 0 to mean index has no segments.

However, that ancient format predates 1.9, so the fix for 3.x is easy (remove support for this ancient format).

Not sure what to do if we really need to fix this in pre-3.x releases...

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Simon Willnauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057052#comment-13057052 ] 

Simon Willnauer commented on LUCENE-3255:
-----------------------------------------

I wonder if we could check the latest segments_N file against a previous one and if the version of that file is older that the previous one we drop it since we don't provide forward compatibility. we could even spin a 2.9 bugfix release for that though.


> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>             Fix For: 3.4
>
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, CorruptionCheckerForPreLucene3.java, LUCENE-3255.patch, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057186#comment-13057186 ] 

Michael McCandless commented on LUCENE-3255:
--------------------------------------------

Actually, we can do something even simpler here: in the 1.9.x days Lucene never wrote a generation (_N) segments file.  It always wrote just "segments", so, if we see first int is a 0, and the file has a generation in it, then it's corrupt.

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>             Fix For: 3.4
>
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, CorruptionCheckerForPreLucene3.java, LUCENE-3255.patch, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Greg Tarr (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056550#comment-13056550 ] 

Greg Tarr commented on LUCENE-3255:
-----------------------------------

Thanks for this Mark. A speedy resolution would be extremely helpful for confidence in our lucene-based implementation.

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-3255:
---------------------------------------

    Fix Version/s: 3.4

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>             Fix For: 3.4
>
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, LUCENE-3255.patch, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Mark Harwood (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056619#comment-13056619 ] 

Mark Harwood commented on LUCENE-3255:
--------------------------------------

Thanks for the quick turnaround Mike/Simon.

Greg is on 2.9.x and so the suggestion I have is that he adds some checking code in the app to remove the latest segments_n file if it looks to have anything other than -9 as a format value given he knows that his Lucene indexes should always be of that version. Maybe that could be a utility class that can be posted here on this issue for others who might share this issue. I'm guessing it's a quirk of the  file system to leave that all-zeros file in place prior to a flush of some kind?



> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>             Fix For: 3.4
>
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, LUCENE-3255.patch, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056605#comment-13056605 ] 

Michael McCandless commented on LUCENE-3255:
--------------------------------------------

4.0 is not affected because we had already removed this back compat code.

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Mark Harwood (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Harwood updated LUCENE-3255:
---------------------------------

    Attachment: BadSegmentsFileTest.java

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>         Attachments: BadSegmentsFileTest.java
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057144#comment-13057144 ] 

Michael McCandless commented on LUCENE-3255:
--------------------------------------------

Ahh, good idea Simon!  That should work.

Another simple thing we could do is, throw an exc if we did not consume all bytes from the segments file.  In this case, the segments file was 20 bytes long, but the double 0 ints only consumes 8 bytes (two 0 ints).

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>             Fix For: 3.4
>
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, CorruptionCheckerForPreLucene3.java, LUCENE-3255.patch, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056639#comment-13056639 ] 

Michael McCandless commented on LUCENE-3255:
--------------------------------------------

That sounds like a good fix for 2.9.x.

+1 for posting a utility here.

bq. I'm guessing it's a quirk of the file system to leave that all-zeros file in place prior to a flush of some kind?

Actually I think various filesystems could conceivably do this (write all 0s to a file), eg on OS/hardware crash, if the file was written by not yet sync'd.

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>             Fix For: 3.4
>
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, CorruptionCheckerForPreLucene3.java, LUCENE-3255.patch, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Simon Willnauer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon Willnauer updated LUCENE-3255:
------------------------------------

    Attachment: LUCENE-3255_testcase.patch

here is a more self contained testcase showing the problem - applies on 3.x and trunk

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-3255:
---------------------------------------

    Attachment: LUCENE-3255.patch

Patch; I'll commit shortly...

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>             Fix For: 3.4
>
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, LUCENE-3255.patch, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Simon Willnauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056606#comment-13056606 ] 

Simon Willnauer commented on LUCENE-3255:
-----------------------------------------

bq. Not sure what to do if we really need to fix this in pre-3.x releases...
there is not much todo really here. I don't see a good way to fix this there. :/ 

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Resolved] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless resolved LUCENE-3255.
----------------------------------------

    Resolution: Fixed

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>             Fix For: 3.4
>
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, LUCENE-3255.patch, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Mark Harwood (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Harwood updated LUCENE-3255:
---------------------------------

    Attachment: CorruptionCheckerForPreLucene3.java

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>            Assignee: Michael McCandless
>             Fix For: 3.4
>
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java, CorruptionCheckerForPreLucene3.java, LUCENE-3255.patch, LUCENE-3255_testcase.patch
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3255) Corrupted segment file not detected and wipes index contents

Posted by "Mark Harwood (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Harwood updated LUCENE-3255:
---------------------------------

    Attachment: AllZerosSegmentFile

> Corrupted segment file not detected and wipes index contents
> ------------------------------------------------------------
>
>                 Key: LUCENE-3255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3255
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 3.2
>            Reporter: Mark Harwood
>         Attachments: AllZerosSegmentFile, BadSegmentsFileTest.java
>
>
> Lucene will happily wipe an existing index if presented with a latest generation segments_n file of all zeros. File format documentation says segments_N files should start with a format of -9 but SegmentInfos.read accepts >=0 as valid for backward compatibility reasons.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org