Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7592

EOFException while opening index should be rethrown as CorruptIndexException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4, 7.0
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      When opening an index, if some files were previously truncated then this should throw the more general CorruptIndexException instead of the specific EOFException to indicate to a consumer that this is not a transient or internally recoverable state.

      1. LUCENE-7592.patch
        1 kB
        Mike Drob
      2. LUCENE-7592.patch
        3 kB
        Mike Drob

        Issue Links

          Activity

          Hide
          mikemccand Michael McCandless added a comment -

          Did you forget to assign to yourself?

          I tend not to bother doing this Just an extra seemingly useless step.

          Show
          mikemccand Michael McCandless added a comment - Did you forget to assign to yourself? I tend not to bother doing this Just an extra seemingly useless step.
          Hide
          mdrob Mike Drob added a comment -

          Thanks, Michael McCandless!

          Did you forget to assign to yourself?

          Show
          mdrob Mike Drob added a comment - Thanks, Michael McCandless ! Did you forget to assign to yourself?
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit b4bb461c4391b93d511e960208c8c4dd5e233021 in lucene-solr's branch refs/heads/branch_6x from Mike McCandless
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b4bb461 ]

          LUCENE-7592: if segments file is truncated, throw CorruptIndexException

          Show
          jira-bot ASF subversion and git services added a comment - Commit b4bb461c4391b93d511e960208c8c4dd5e233021 in lucene-solr's branch refs/heads/branch_6x from Mike McCandless [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b4bb461 ] LUCENE-7592 : if segments file is truncated, throw CorruptIndexException
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit e4f31fab2f98b7af6d2ec12a2eb3456521b446df in lucene-solr's branch refs/heads/master from Mike McCandless
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=e4f31fa ]

          LUCENE-7592: if segments file is truncated, throw CorruptIndexException

          Show
          jira-bot ASF subversion and git services added a comment - Commit e4f31fab2f98b7af6d2ec12a2eb3456521b446df in lucene-solr's branch refs/heads/master from Mike McCandless [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=e4f31fa ] LUCENE-7592 : if segments file is truncated, throw CorruptIndexException
          Hide
          mikemccand Michael McCandless added a comment -

          Thanks Mike Drob, that's looks great; I'll push.

          Show
          mikemccand Michael McCandless added a comment - Thanks Mike Drob , that's looks great; I'll push.
          Hide
          mdrob Mike Drob added a comment -

          Yea, the solr changes accidentally leaked in from a different issue.

          Attaching patch with nested try-catch blocks.

          Show
          mdrob Mike Drob added a comment - Yea, the solr changes accidentally leaked in from a different issue. Attaching patch with nested try-catch blocks.
          Hide
          mikemccand Michael McCandless added a comment -

          +1 to report CorruptIndexException not an unhandled EOFException.

          But, can you instead use an inner try inside the try-with-resources, so that you can directly pass input to the CorruptIndexException ctor? Then you don't need to make your own resourceDescription I think?

          Also, are the solr source changes in this patch separate?

          Show
          mikemccand Michael McCandless added a comment - +1 to report CorruptIndexException not an unhandled EOFException . But, can you instead use an inner try inside the try-with-resources, so that you can directly pass input to the CorruptIndexException ctor? Then you don't need to make your own resourceDescription I think? Also, are the solr source changes in this patch separate?
          Hide
          mdrob Mike Drob added a comment -

          One possible approach.

          Show
          mdrob Mike Drob added a comment - One possible approach.

            People

            • Assignee:
              Unassigned
              Reporter:
              mdrob Mike Drob
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development