Skip to content

Commit b8d601f

Browse files
committed
#4212 Fix shards stuck in opening state
1 parent 5f2b4fa commit b8d601f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

stroom-index/stroom-index-lucene553/src/main/java/stroom/index/lucene553/IndexShardSearcher.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import stroom.util.io.FileUtil;
2424
import stroom.util.io.PathCreator;
2525

26+
import org.apache.lucene553.index.CorruptIndexException;
2627
import org.apache.lucene553.index.IndexWriter;
2728
import org.apache.lucene553.search.IndexSearcher;
2829
import org.apache.lucene553.search.SearcherFactory;
@@ -111,8 +112,12 @@ class IndexShardSearcher {
111112
searcherManager.release(indexSearcher);
112113
}
113114
}
115+
} catch (final CorruptIndexException e) {
116+
throw new SearchException("Corrupt index shard (id=" + indexShard.getId() + "). " + e.getMessage(),
117+
e);
114118
} catch (final IOException e) {
115-
throw new SearchException(e.getMessage(), e);
119+
throw new SearchException("Error reading index shard (id=" + indexShard.getId() + "). " + e.getMessage(),
120+
e);
116121
}
117122

118123
this.directory = directory;

stroom-index/stroom-index-lucene980/src/main/java/stroom/index/lucene980/IndexShardSearcher.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import stroom.util.io.FileUtil;
2424
import stroom.util.io.PathCreator;
2525

26+
import org.apache.lucene980.index.CorruptIndexException;
2627
import org.apache.lucene980.index.IndexWriter;
2728
import org.apache.lucene980.search.IndexSearcher;
2829
import org.apache.lucene980.search.SearcherFactory;
@@ -111,8 +112,12 @@ class IndexShardSearcher {
111112
searcherManager.release(indexSearcher);
112113
}
113114
}
115+
} catch (final CorruptIndexException e) {
116+
throw new SearchException("Corrupt index shard (id=" + indexShard.getId() + "). " + e.getMessage(),
117+
e);
114118
} catch (final IOException e) {
115-
throw new SearchException(e.getMessage(), e);
119+
throw new SearchException("Error reading index shard (id=" + indexShard.getId() + "). " + e.getMessage(),
120+
e);
116121
}
117122

118123
this.directory = directory;

0 commit comments

Comments
 (0)