Route stateless get requests to isPromotable shard#93612
Merged
Tim-Brooks merged 3 commits intoelastic:mainfrom Feb 9, 2023
Merged
Route stateless get requests to isPromotable shard#93612Tim-Brooks merged 3 commits intoelastic:mainfrom
Tim-Brooks merged 3 commits intoelastic:mainfrom
Conversation
In stateless it is possible that search shards do not have new enough data to serve search requests. This commit works around this issue by routing those requests to promotable shards.
Collaborator
|
Pinging @elastic/es-distributed (Team:Distributed) |
idegtiarenko
reviewed
Feb 9, 2023
| request.request().routing(), | ||
| request.request().preference() | ||
| ); | ||
| // If it is stateless, only route isPromotableToPrimary shards |
Contributor
There was a problem hiding this comment.
I do not think this comment is necessary
idegtiarenko
reviewed
Feb 9, 2023
| return new PlainShardIterator( | ||
| shards.shardId(), | ||
| shards.getShardRoutings().stream().filter(ShardRouting::isPromotableToPrimary).collect(Collectors.toList()) | ||
| ); |
Contributor
There was a problem hiding this comment.
Should this be inside of getShards to avoid duplication?
Also is this a temporary solution?
Contributor
Author
There was a problem hiding this comment.
This is temporary and I added a comment to this point. I did not move it in getShards as I felt like that surface level change was larger. And is relied on by other actions (explain and term vectors). However, I created an issue for those two transport actions, which would allow a more extensive refactoring in getShards if it makes sense.
This was referenced Feb 9, 2023
pxsalehi
added a commit
that referenced
this pull request
Feb 28, 2023
In #93612 we introduce a workaround for real-time get/mget for stateless. However there is a null-check missing there.
pxsalehi
added a commit
to pxsalehi/elasticsearch
that referenced
this pull request
Feb 28, 2023
In elastic#93612 we introduce a workaround for real-time get/mget for stateless. However there is a null-check missing there.
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 28, 2023
dnhatn
added a commit
that referenced
this pull request
Mar 20, 2023
Like GET requests, we should also route term vectors requests to promotable copies in stateless. Relates #93612
dnhatn
added a commit
to dnhatn/elasticsearch
that referenced
this pull request
Mar 20, 2023
Like GET requests, we should also route term vectors requests to promotable copies in stateless. Relates elastic#93612
elasticsearchmachine
pushed a commit
that referenced
this pull request
Mar 20, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In stateless it is possible that search shards do not have new enough data to serve search requests. This commit works around this issue by routing those requests to promotable shards.