-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: prevent gateway from always being picked
Previously, the instance resoler would always assign the partition span to the gateway if the gateway was in the set of eligible instances and we did not find an eligible instance with a better locality match. In large clusters during backup/cdc running with execution locality, this could cause the gateway to get the lions share of work thereby causing it to OOM or severely throttle performance. This change make span partitioning a little more stateful. Concretely, we now track how many partition spans have been assigned to each node in the `planCtx` that is used throughout the planning of a single statement. This distribution is then used to limit the number of partition spans we default to the gateway. Currently, by default we allow the gateway to have: `2 * average number of partition spans across the other instances` If the gateway does not satisfy this heuristic we randomly pick one of the other eligible instances. Note, if there are no eligible instances except for the gateway, or the gateway has received no spans yet, we will pick the gateway. Fixes: #114079 Release note (bug fix): fixes a bug where large jobs running with execution locality could result in the gateway being assigned most of the work causing performance degradation and cluster instability
- Loading branch information
1 parent
64dacab
commit 51fd26f
Showing
3 changed files
with
494 additions
and
36 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
Oops, something went wrong.