lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shalin Shekhar Mangar (JIRA)" <>
Subject [jira] [Commented] (SOLR-6640) ChaosMonkeySafeLeaderTest failure with CorruptIndexException
Date Mon, 29 Dec 2014 14:42:13 GMT


Shalin Shekhar Mangar commented on SOLR-6640:

I had a discussion with Varun about this issue. We have two problems here
# Solr corrupts the index during replication recovery
# Such a corrupt index puts Solr into an infinite recovery loop

For #1 the problem is clear -- we have open searchers on uncommitted/flushed files which are
mixed with files from the leader causing corruption.

Possible solutions for #1 are either a) switch to a different index dir and move/copy files
from committed segments and use the approach to open a searcher on the new
index dir or b) close the searcher then rollback the writer and then download the necessary

Closing the searcher.... is not as simple as it sounds because the searcher is ref counted
and close() doesn't really close immediately. Also, at any time, a request might open a new
searcher so it is a very involved change.

For #2, every where we open a reader/searcher or writer, we should be ready to handle the
corrupt index exceptions.

I think we should first try to first solve the problem of corrupting the index. So let's try
the deletion approach that Varun outlined. If that fails then we should switch to a new index
dir, move/copy over files from commit points, fetch the missing segments from the leader and
use the approach to completely move to a new index directory.

The second problem that we need to solve is that a corrupted index trashes the server. We
should be able to recover from such a scenario instead of going into an infinite recovery

Let's fix these two problems (in that order) and then figure out ways to optimize recovery.

Longer term we need to change our code such that we can close the searchers, rollback the
writer and delete uncommitted files and then attempt replication recovery.

Also my earlier comment on non-cloud Solr was wrong:
bq. In SolrCloud we could just close the searcher before rollback because a replica in recovery
won't get any search requests but that's not practical in standalone Solr because it'd cause

In stand alone Solr this is not a problem because indexing and soft-commits do not happen
on slaves. But anyway changing to close the searcher etc is a big change.

> ChaosMonkeySafeLeaderTest failure with CorruptIndexException
> ------------------------------------------------------------
>                 Key: SOLR-6640
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>          Components: replication (java)
>    Affects Versions: 5.0
>            Reporter: Shalin Shekhar Mangar
>             Fix For: 5.0
>         Attachments: Lucene-Solr-5.x-Linux-64bit-jdk1.8.0_20-Build-11333.txt, SOLR-6640.patch,
> Test failure found on jenkins:
> {code}
> 1 tests failed.
> Error Message:
> shard2 is not consistent.  Got 62 from and
got 24 from
> Stack Trace:
> java.lang.AssertionError: shard2 is not consistent.  Got 62 from
and got 24 from
>         at __randomizedtesting.SeedInfo.seed([F4B371D421E391CD:7555FFCC56BCF1F1]:0)
>         at
>         at
>         at
>         at
>         at org.apache.solr.BaseDistributedSearchTestCase.testDistribSearch(
> {code}
> Cause of inconsistency is:
> {code}
> Caused by: org.apache.lucene.index.CorruptIndexException: file mismatch, expected segment
id=yhq3vokoe1den2av9jbd3yp8, got=yhq3vokoe1den2av9jbd3yp7 (resource=BufferedChecksumIndexInput(MMapIndexInput(path="/mnt/ssd/jenkins/workspace/Lucene-Solr-5.x-Linux/solr/build/solr-core/test/J0/temp/")))
>    [junit4]   2> 		at org.apache.lucene.codecs.CodecUtil.checkSegmentHeader(
>    [junit4]   2> 		at org.apache.lucene.codecs.lucene50.Lucene50LiveDocsFormat.readLiveDocs(
>    [junit4]   2> 		at org.apache.lucene.codecs.asserting.AssertingLiveDocsFormat.readLiveDocs(
>    [junit4]   2> 		at org.apache.lucene.index.SegmentReader.<init>(
> {code}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message