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-20.2: sql: allow for pre-19.2 foreign keys in table validation #57083

Merged
merged 2 commits into from
Nov 24, 2020

Conversation

ajwerner
Copy link
Contributor

Backport 2/2 commits from #57066.

/cc @cockroachdb/release


sql: allow for pre-19.2 foreign keys in table validation

We introduced a bug in v20.2 where we failed to upgrade referenced
descriptors' FK representations from pre-19.2 descriptors when
validating cross-references for tables, leading to validation failures
that would make the table unusable. This PR gets rid of the validation
errors by having Validate() account for pre-19.2-style foreign keys on
referenced table descriptors.

Fixes #57032.

Release note (bug fix): Fixes a bug where tables and metadata were
unavailable due to spurious missing fk back reference validation
errors.


catalogkv: add testing of descriptor unwrapping and validation

This commit adds a framework to test that descriptors validate properly.
It also adds testdata and a bash script to generate that test data.

This test is to exercise a problematic path whereby tables constructed
in v19.1 would fail to validate in v20.2.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

thoszhang and others added 2 commits November 24, 2020 17:14
We introduced a bug in v20.2 where we failed to upgrade referenced
descriptors' FK representations from pre-19.2 descriptors when
validating cross-references for tables, leading to validation failures
that would make the table unusable. This PR gets rid of the validation
errors by having `Validate()` account for pre-19.2-style foreign keys on
referenced table descriptors.

Release note (bug fix): Fixes a bug where tables and metadata were
unavailable due to spurious `missing fk back reference` validation
errors.
This commit adds a framework to test that descriptors validate properly.
It also adds testdata and a bash script to generate that test data.

This test is to exercise a problematic path whereby tables constructed
in v19.1 would fail to validate in v20.2.

Release note: None
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