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

IndexWriter.getTragicException() may not reflect all corrupting exceptions (notably: NoSuchFileException)

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Backstory...

      Solr has a "LeaderTragicEventTest" which uses MockDirectoryWrapper's corruptFiles to introduce corruption into the "leader" node's index and then assert that this solr node gives up it's leadership of the shard and another replica takes over.

      This can currently fail sporadically (but usually reproducibly - see SOLR-13237) due to the leader not giving up it's leadership even after the corruption causes an update/commit to fail. Solr's leadership code makes this decision after encountering an exception from the IndexWriter based on wether IndexWriter.getTragicException() is (non-)null.


      While investigating this, I created an isolated Lucene-Core equivilent test that demonstrates the same basic situation:

      • Gradually cause corruption on an index untill (otherwise) valid execution of IW.add() + IW.commit() calls throw an exception to the IW client.
      • assert that if an exception is thrown to the IW client, getTragicException() is now non-null.

      It's fairly easy to make my new test fail reproducibly – in every situation I've seen the underlying exception is a NoSuchFileException (ie: the randomly introduced corruption was to delete some file).

        Attachments

        1. LUCENE-8692.patch
          11 kB
          Hoss Man
        2. LUCENE-8692.patch
          11 kB
          Hoss Man
        3. LUCENE-8692.patch
          13 kB
          Hoss Man
        4. LUCENE-8692_test.patch
          4 kB
          Hoss Man

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                hossman Hoss Man
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated: