workload: enable multi-region random schema workload#165751
Draft
shghasemi wants to merge 2 commits intocockroachdb:masterfrom
Draft
workload: enable multi-region random schema workload#165751shghasemi wants to merge 2 commits intocockroachdb:masterfrom
shghasemi wants to merge 2 commits intocockroachdb:masterfrom
Conversation
Contributor
|
Merging to
|
Member
5e49c95 to
b31cd03
Compare
Previously, `ALTER DATABASE ... PRIMARY REGION` only refreshed table zone configurations when placement was restricted or super regions were involved. This was based on the assumption that REGIONAL BY TABLE tables in the primary region never have explicit zone configs and can always inherit from the database. However, `ALTER DATABASE ... SURVIVE REGION FAILURE` writes explicit zone configs on all tables (including RBT) because region failure survival requires a tighter replica distribution. Additionally, users can explicitly modify a table zone config. When the primary region is changed, those explicit table zone configs retain stale voter_constraints and lease_preferences pointing to the old primary region. Fix this by calling `refreshZoneConfigsForTables` when switching the primary region on `SURVIVE REGION FAILURE`. For tables without explicit zone configs, the refresh is a no-op. For tables with stale explicit configs (from a prior survival goal change), it updates them to reflect the new primary region. Informs: cockroachdb#149491 Informs: cockroachdb#83831 Release note (bug fix): Fixed a bug where `ALTER DATABASE ... PRIMARY REGION` could leave stale zone configurations on tables, causing voter constraints and lease preferences to reference the old primary region.
b31cd03 to
2c478ff
Compare
Previously, TestWorkload only ran against a single-region database, because alterDatabasePrimaryRegion was disabled. This change fixes several workload-related issues that cause test flakes in a multi-region setup. 1. The error screening query for concurrent schema changes is extended to detect declarative schema changer state involving primary index swaps (which includes regional-by-row transitions). 2. The COMMENT ON TYPE operation now filters out the crdb_internal_region enum to avoid errors. informs: cockroachdb#149491 Release note: None
2c478ff to
53a5b6f
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is stacked on another PR.
Previously, TestWorkload only ran against a single-region database,
because alterDatabasePrimaryRegion was disabled. This change fixes
several workload-related issues that cause test flakes in a
multi-region setup.
extended to detect declarative schema changer state involving primary
index swaps (which includes regional-by-row transitions).
enum to avoid errors.
informs: #149491
Release note: None