-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Adds a consistent shard index to ShardSearchRequest #65706
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
Conversation
This change ensures that the shard index that is used to tiebreak documents with identical sort remains consistent between two requests that target the same shards. The index is now always computed from the natural order of the shards in the search request. This change also adds the consistent shard index to the ShardSearchRequest. That allows the slice builder to use this information to build more balanced slice query. Relates elastic#56828
Pinging @elastic/es-search (Team:Search) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jimczi Thanks Jim, this LGTM. Nice to get rid of irrelevant indexRoutings
and preference
fields in ShardSearchRequest
.
} | ||
} | ||
|
||
int shardIndex = request.shardIndex() != -1 ? request.shardIndex() : request.shardId().id(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess a case when shardIdex() = -1
(when a coordinating node is v < 8.0) and there is a preference
or indexRouting
present in scroll slice is a very rare case, and we can disregard it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's my reasoning too.
This change ensures that the shard index that is used to tiebreak documents with identical sort remains consistent between two requests that target the same shards. The index is now always computed from the natural order of the shards in the search request. This change also adds the consistent shard index to the ShardSearchRequest. That allows the slice builder to use this information to build more balanced slice query. Relates #56828
This change ensures that the shard index that is used to tiebreak documents with identical sort
remains consistent between two requests that target the same shards. The index is now always computed from the
natural order of the shards in the search request.
This change also adds the consistent shard index to the ShardSearchRequest. That allows the slice builder
to use this information to build more balanced slice query.
Relates #56828