Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fall back to reading SegmentInfos from Store if reading from commit fails #11403

Merged
merged 1 commit into from May 28, 2015

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented May 28, 2015

In the event that reading from the latest commit fails, we should fall
back to reading from the Store using the traditional
Directory.listAll()

Related to #11361

@dakrone
Copy link
Member Author

dakrone commented May 28, 2015

IndexSearcher searcher = sm.acquire();
try {
IndexCommit latestCommit = ((DirectoryReader) searcher.getIndexReader()).getIndexCommit();
return Lucene.readSegmentInfos(latestCommit);
} catch (IOException e) {
// Fall back to reading from the store if reading from the commit fails
return store.readLastCommittedSegmentsInfo();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you wrap this in try/catch and add the original exception as suppressed if readLastCommittedSegmentsInfo fails?

@s1monw
Copy link
Contributor

s1monw commented May 28, 2015

left one comment otherwise LGTM

fails

In the event that reading from the latest commit fails, we should fall
back to reading from the `Store` using the traditional
`Directory.listAll()`

Related to elastic#11361
@dakrone dakrone merged commit 790baed into elastic:master May 28, 2015
@kevinkluge kevinkluge removed the review label May 28, 2015
@dakrone dakrone deleted the si-reading-fallback branch June 1, 2015 22:35
@clintongormley clintongormley added >enhancement :Distributed/Store Issues around managing unopened Lucene indices. If it touches Store.java, this is a likely label. labels Jun 8, 2015
@clintongormley clintongormley added :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. and removed :Distributed/Store Issues around managing unopened Lucene indices. If it touches Store.java, this is a likely label. labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Engine Anything around managing Lucene and the Translog in an open shard. >enhancement v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants