-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch fixes a bug in replica sorting. When it think that a particular request can be served through follower reads, the DistSender sorts the replicas by latency, falling back to locality attributes. It also has a special provision for ordering the local replica(s) first, but that provision was buggy: the `Less` function was only correctly comparing a local replica with a non-local one when the local replica was on the left side of the compairison. This patch fixes the bug by extracting the prioritization of local replicas out of the main sort, giving them a dedicate phase for clarity. Release note (bug fix): A certain percentage of cases in which a node could have served a follower read were not handled correctly, resulting in the node routing the request to another nearby node for no reason. This has been fixed.
- Loading branch information
1 parent
bc58328
commit acdda53
Showing
3 changed files
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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