forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changefeedccl: add
balanced_full
distribution strategy
This change adds support for `changefeed.default_range_distribution_strategy='balanced_full'`. `balanced_full` distributes ranges evenly across all healthy nodes. The implementation first gets a plan from sql and rebalances it. Rebalancing is better than balancing / assigning ranges directly because the final plan will leverage some optimizations from distsql. For example, distsql tends to assign local ranges to nodes. If a node has many local ranges and is assigned more ranges compared to other nodes, then we reassign some of those ranges during rebalancing. The node still gets to keep as many local ranges as possible. This change also adds the setting `changefeed.range_distribution_threshold` which controls when distribution strategies will take effect. It defines the minimum number of ranges which a changefeed must watch to trigger distribution strategies. This setting avoids rebalancing a small changefeed across many nodes. The default value is 1024. This change also retires the `changefeed.balance_range_distribution.sensitivity` setting. This setting existed to reduce the amount of work to perform during rebalancing (ie. only rebalance a partition to within 5% of the ideal number of ranges per partition). This optimization is not necessary at this moment because rebalancing is relatively cheap and only happens at the start of a changefeed. Also, mechanism would sometimes cause bad distributions. Consider a scenario where we 25 ranges are rebalanced over 5 nodes. With some sensitivity, 6 ranges would be allowed per node. This can result in the imbalanced distribution: 1, 6, 6, 6, 6. Removing sensitivity results in the ideal distribution: 5, 5, 5, 5, 5 (or close to the ideal distribution when ranges cannot be divided evenly). Informs: cockroachdb#113898 Epic: None Release note (enterprise change): This change adds a new value `balanced_full` for the setting `changefeed.default_range_distribution_strategy`. Setting this value will make changefeeds attempt to balance work evenly over at many nodes as possible (while obeying locality restrictions). This is different than `balanced_simple` which does not always leverage all possible nodes. This change also adds the setting `changefeed.range_distribution_threshold` which controls when distribution strategies (ie. changing `changefeed.default_range_distribution_strategy`) will take effect. It defines the minimum number of ranges which a changefeed must watch to trigger distribution strategies.
- Loading branch information
1 parent
29b5fce
commit 9de25bc
Showing
6 changed files
with
209 additions
and
43 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
Oops, something went wrong.