forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
78044: sql: introduce multi-region zone config extension descriptor changes r=nvanbenschoten a=nvanbenschoten This PR introduces lightweight zone configuration extensions, which provide flexibility to [multi-region abstractions](https://www.cockroachlabs.com/docs/stable/multiregion-overview.html) and are loosely based on the design described in [this doc](https://docs.google.com/document/d/1EiAT1BUOTaXoJy3CMzrKiP73bMfOAFiPrOPne5dtadU/edit#). ```sql ALTER DATABASE db ALTER LOCALITY REGIONAL CONFIGURE ZONE USING ... ALTER DATABASE db ALTER LOCALITY REGIONAL IN "us-east1" CONFIGURE ZONE USING ... ALTER DATABASE db ALTER LOCALITY GLOBAL CONFIGURE ZONE USING ... ``` Zone config extensions represents per-locality zone configurations that influence the zone configurations derived for corresponding objects. A locality type's associated extension acts as a targeted set of rewrite rules for its associated objects' (database, table, partition) derived zone configurations. "Extending" a zone config means having the extension inherit any missing fields from the zone config while replacing any set fields. This uses the existing zone configuration inheritance rules. ### Rules (implemented in pkg/sql/region_util.go): ``` 1. database-level zone configs are extended first using the regional zone config extension and then with the regional_in[<primary_region>] zone config extension. In doing so, REGIONAL [ IN PRIMARY REGION ] tables can continue to inherit from the database level zone config. 2. table-level zone configs use the extension associated with their locality type. 2a. GLOBAL tables are extended with the global zone config extension. 2b. REGIONAL IN <region> tables are extended first using the regional zone config extension and then with the regional_in[<affinity_region>] zone config extension. 3. partition-level zone configs are extended first using the regional zone config extension and then with the regional_in[<partition_region>] zone config extension. ``` The PR contains only the descriptor changes and the logic to interpret zone config extensions during multi-region zone config synthesis. It does not contain the logic to set the extensions. As a result, it may be contained enough to fit into the v22.1.0 release, allowing the rest of the code to land in a later point release. cc. `@ajstorm` `@awoods187` Co-authored-by: Nathan VanBenschoten <[email protected]>
- Loading branch information
Showing
15 changed files
with
2,019 additions
and
731 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
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
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.