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: backport zone config validation changes #63834

Conversation

otan
Copy link
Contributor

@otan otan commented Apr 19, 2021

Backport:

Please see individual PRs for details.

/cc @cockroachdb/release


This is needed for @arulajmani's GA blocker -- #63462. They must be backported together as otherwise there is some very ugly merge conflicts to resolve.

ajstorm and others added 6 commits April 19, 2021 18:40
In the past there were cases where a table locality change (even one
where override was specified) would not clear all of the multi-region
zone configuration fields for all zone configurations. The simplest
example is if you had a zone configuration manually specified by the
user on an index and you were ALTERing the table locality to REGIONAL BY
TABLE or GLOBAL. Since neither of these transitions look at the index
zone configuration, it would remain untouched, and future locality
changes would still require the override.

This commit change the behavior such that if override is specified, all
multi-region fields of the zone configuration will be cleared and a
future table locality change will not require override.

Release note: None
Previously we were returning an inaccurate error message when a user
modified zone config was present on a multi-region table. This was due
to the fact that we'd key off of num_replicas being set in a placeholder
zone config and think that that was the difference between the two zone
configs. In actuality, the difference was in the subzones.

This commit allows for the reporting of the true difference, the
presence of the index in the subzones.

Release note: None
Involves peeping into the mutations and excluding the new indexes being
created -- these will not have the correct zone configs set on them.

Release note (bug fix): Fix a bug where
crdb_internal.validate_multi_region_zone_configs() fails during a
REGIONAL BY ROW locality transition.
Transitioning regions can result in transient state which is hard to
reason about and validate during a concurrent operation with REGIONAL BY
ROW changes.

To alleviate this, we relax the validation by removing the transitioning
regions from the validation path.

Steps:
* Change RegionConfig to optionally include transitioning regions.
* Make SynthesizeRegionConfig include transitioning regions.
* Change the validation interface to surface transitioning regions.
  Remove this from regional by row zone config validation.

Release note: None
Use the option method instead to decide to read from the cache.

Release note: None
@otan otan requested review from arulajmani, ajstorm, a team and adityamaru and removed request for a team April 19, 2021 08:54
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@ajstorm ajstorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @adityamaru and @arulajmani)

@ajstorm ajstorm merged commit 6beff0d into cockroachdb:release-21.1 Apr 19, 2021
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