-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Support real-time gets on hollow shards #122012
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
Changes from 25 commits
db73b39
0bced20
44fed83
3237dfa
47b5083
f207d15
75431f7
40301f2
ff0c191
634cbf4
e8b47d2
195f5fb
0ca0c78
87240c5
25e5e9d
ed8c902
07ab4b7
ecf8aba
4806d11
1c03540
b965926
5d85f39
847bf5c
4bdcafb
01b81bb
8d4ab8e
d29028c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
|
|
||
| import org.apache.logging.log4j.LogManager; | ||
| import org.apache.logging.log4j.Logger; | ||
| import org.apache.lucene.store.AlreadyClosedException; | ||
| import org.elasticsearch.ElasticsearchException; | ||
| import org.elasticsearch.ExceptionsHelper; | ||
| import org.elasticsearch.action.ActionListener; | ||
|
|
@@ -154,7 +155,9 @@ protected Executor getExecutor(MultiGetShardRequest request, ShardId shardId) { | |
| final ClusterState clusterState = clusterService.state(); | ||
| if (clusterState.metadata().index(shardId.getIndex()).isSystem()) { | ||
| return threadPool.executor(executorSelector.executorForGet(shardId.getIndexName())); | ||
| } else if (indicesService.indexServiceSafe(shardId.getIndex()).getIndexSettings().isSearchThrottled()) { | ||
| } | ||
| var indexService = indicesService.indexService(shardId.getIndex()); | ||
|
||
| if (indexService != null && indexService.getIndexSettings().isSearchThrottled()) { | ||
| return threadPool.executor(ThreadPool.Names.SEARCH_THROTTLED); | ||
| } else { | ||
| return super.getExecutor(request, shardId); | ||
|
|
@@ -211,7 +214,10 @@ private void shardMultiGetFromTranslog( | |
| final var retryingListener = listener.delegateResponse((l, e) -> { | ||
| final var cause = ExceptionsHelper.unwrapCause(e); | ||
| logger.debug("mget_from_translog[shard] failed", cause); | ||
| if (cause instanceof ShardNotFoundException || cause instanceof IndexNotFoundException) { | ||
| if (cause instanceof ShardNotFoundException | ||
| || cause instanceof IndexNotFoundException | ||
| || cause instanceof AlreadyClosedException) { | ||
kingherc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // TODO AlreadyClosedException the engine reset should be fixed by ES-10826 | ||
| logger.debug("retrying mget_from_translog[shard]"); | ||
| observer.waitForNextChange(new ClusterStateObserver.Listener() { | ||
| @Override | ||
|
|
@@ -226,7 +232,13 @@ public void onClusterServiceClose() { | |
|
|
||
| @Override | ||
| public void onTimeout(TimeValue timeout) { | ||
| l.onFailure(new ElasticsearchException("Timed out retrying mget_from_translog[shard]", cause)); | ||
| // TODO AlreadyClosedException the engine reset should be fixed by ES-10826 | ||
| if (cause instanceof AlreadyClosedException) { | ||
| // Do an additional retry just in case AlreadyClosedException didn't generate a cluster update | ||
kingherc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| tryShardMultiGetFromTranslog(request, indexShard, node, l); | ||
| } else { | ||
| l.onFailure(new ElasticsearchException("Timed out retrying mget_from_translog[shard]", cause)); | ||
| } | ||
| } | ||
| }); | ||
| } else { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.