-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
115166: changefeedccl: add changefeed range distribution strategies r=jayshrivastava a=jayshrivastava ### changefeedccl: add changefeed range distribution strategies This commit introduces several changes. It makes `replicaoracle.BinPackingChoice` the explicit default for changefeeds. Previously, we would use `physicalplan.DefaultReplicaChooser`, which would point to the bin packing oracle. This change is better since it gives the changefeed package more control over its dependencies. A new cluster setting `changefeed.default_range_distribution_strategy` is added to specify how changefeeds should distribute work. In the default case, `none`, we defer to distsql to select nodes and distribute work among them. This is the same behavior as running a changefeed today. In the other case, `balanced_simple`, we still let distsql choose nodes for us, but we attempt to evently distribute ranges over them. This case is exactly the same as setting `changefeed.balance_range_distribution.enable = true`, but it is allowed to be used outside of initial scans (`changefeed.balance_range_distribution.enable` was only allowed with `initial_scan=only`. This change also deprecates `changefeed.balance_range_distribution.enable` in favor of `changefeed.default_range_distribution_strategy` because the latter can be expanded in the future to add more functionality. This change also moves changefeed distribution tests to a dedicated file: `changefeed_dist_test.go`. This file contains a tester which can be used to start a cluster with a given topology and range distribution. Changefeed tests can use the tester to perform various load balancing strategies. Right now, the new tests assert how ranges are distributed after planning changefeeds, which implicitly tests code outside of the changefeedccl package (ie. `dsp.PartitionSpans()`). However, this is important since changefeeds rely on the behavior of this black box to perform well. In the future, cdc will implement more distribution strategies and likely implement its own partitioning logic. Tests for these strategies can be added in this file. Over time, cdc can move away from distsql planning. Informs: #113898 Epic: None Release note (enterprise change): `changefeed.balance_range_distribution.enable` is now deprecated. Users should use a new cluster setting `changefeed.default_range_distribution_strategy` instead. `changefeed.default_range_distribution_strategy='balanced_simple'` has the same effect as setting `changefeed.balance_range_distribution.enable=true`. It does not require `initial_scan='only'`, which was required by the old setting. ### roachtest/cdc: metamorphically determine range distribution strategy This change adds a new metamorphic flag in cdc roachtests which choses a distribution strategy randomly. Release note: None Co-authored-by: Jayant Shrivastava <jayants@cockroachlabs.com>
- Loading branch information
Showing
11 changed files
with
562 additions
and
120 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
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.