Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-21.1: sql: Don't clear zone configs on indexes during a RBR transition #65833

Merged
merged 1 commit into from
May 31, 2021

Conversation

ajstorm
Copy link
Collaborator

@ajstorm ajstorm commented May 28, 2021

Backport 1/1 commits from #63665.

/cc @cockroachdb/release


Previously we were wiping out the zone configs for all indexes when
transitioning from REGIONAL BY ROW to either GLOBAL or REGIONAL BY
TABLE. This was problematic because there could have been zone configs
which were setup by the user and didn't have any multi-region zone
config fields set. This fix ensures that we don't wipe out the zone
configs for indexes, provided that they contain at least one field set
that isn't governed by the multi-region syntax.

Release note (sql change): Fixes a bug where transitioning from locality
REGIONAL BY ROW to GLOBAL or REGIONAL BY TABLE could mistakenly remove a
zone configuration on an index which has no multi-region fields set.

Resolves: #63614.

Previously we were wiping out the zone configs for all indexes when
transitioning from REGIONAL BY ROW to either GLOBAL or REGIONAL BY
TABLE. This was problematic because there could have been zone configs
which were setup by the user and didn't have any multi-region zone
config fields set. This fix ensures that we don't wipe out the zone
configs for indexes, provided that they contain at least one field set
that isn't governed by the multi-region syntax.

This commit also makes a minor change to ClearFieldsOfAllSubzones to use
a NewZoneConfig instead of an empty ZoneConfig. Doing so ensures that
ClearFieldsOfAllSubzones doesn't clear the inherited fields of the zone
config.

Release note (sql change): Fixes a bug where transitioning from locality
REGIONAL BY ROW to GLOBAL or REGIONAL BY TABLE could mistakenly remove a
zone configuration on an index which has no multi-region fields set.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@ajstorm ajstorm requested review from otan and arulajmani May 28, 2021 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants