Skip to content

Always return false from refreshNeeded on ReadOnlyEngine #35837

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

Merged
merged 4 commits into from
Nov 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ private void fillSegmentInfo(SegmentReader segmentReader, boolean verbose, boole
*/
public abstract List<Segment> segments(boolean verbose);

public final boolean refreshNeeded() {
public boolean refreshNeeded() {
if (store.tryIncRef()) {
/*
we need to inc the store here since we acquire a searcher and that might keep a file open on the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,4 +419,9 @@ public void initializeMaxSeqNoOfUpdatesOrDeletes() {
protected void processReaders(IndexReader reader, IndexReader previousReader) {
searcherFactory.processReaders(reader, previousReader);
}

@Override
public boolean refreshNeeded() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,7 @@ public void executeFetchPhase(InternalScrollSearchRequest request, SearchTask ta
long afterQueryTime = System.nanoTime();
operationListener.onQueryPhase(context, afterQueryTime - time);
QueryFetchSearchResult fetchSearchResult = executeFetchPhase(context, operationListener, afterQueryTime);
return new ScrollQueryFetchSearchResult(fetchSearchResult,
context.shardTarget());
return new ScrollQueryFetchSearchResult(fetchSearchResult, context.shardTarget());
} catch (Exception e) {
logger.trace("Fetch phase failed", e);
processFailure(context, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,11 @@ public Searcher acquireSearcher(String source, SearcherScope scope) throws Engin
assert false : "this is a read-only engine";
case "doc_stats":
assert false : "doc_stats are overwritten";
case "refresh_needed":
assert false : "refresh_needed is always false";
case "segments":
case "segments_stats":
case "completion_stats":
case "refresh_needed":
case "can_match": // special case for can_match phase - we use the cached point values reader
maybeOpenReader = false;
break;
Expand Down