Skip to content

release-22.1: sql: enforce nullability when evaluating expressions in index backfills#83551

Merged
ajwerner merged 1 commit intocockroachdb:release-22.1from
ajwerner:backport22.1-81679
Jul 7, 2022
Merged

release-22.1: sql: enforce nullability when evaluating expressions in index backfills#83551
ajwerner merged 1 commit intocockroachdb:release-22.1from
ajwerner:backport22.1-81679

Conversation

@ajwerner
Copy link
Copy Markdown
Contributor

@ajwerner ajwerner commented Jun 28, 2022

Backport 1/1 commits from #81679.

/cc @cockroachdb/release


Prior to this change, we never enforced nullability of values when performing
index backfills. Up until #76983, all column additions used the legacy schema
changer and its column backfill protocol. The column backfiller indeed checks
on nullability violations for columns here.

Release note (bug fix): Prior to this change, virtual computed columns which
were marked as NOT NULL could be added to new secondary index. After this
change, attempts to add such columns to a secondary index will result in an
error. Note that such invalid columns can still be added to tables. Work to
resolve that bug is tracked in #81675.

Release justification: Fixes a bug

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Jun 28, 2022

Thanks for opening a backport.

Please check the backport criteria before merging:

  • Patches should only be created for serious issues or test-only changes.
  • Patches should not break backwards-compatibility.
  • Patches should change as little code as possible.
  • Patches should not change on-disk formats or node communication protocols.
  • Patches should not add new functionality.
  • Patches must not add, edit, or otherwise modify cluster versions; or add version gates.
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
  • There is a high priority need for the functionality that cannot wait until the next release and is difficult to address in another way.
  • The new functionality is additive-only and only runs for clusters which have specifically “opted in” to it (e.g. by a cluster setting).
  • New code is protected by a conditional check that is trivial to verify and ensures that it only runs for opt-in clusters.
  • The PM and TL on the team that owns the changed code have signed off that the change obeys the above rules.

Add a brief release justification to the body of your PR to justify this backport.

Some other things to consider:

  • What did we do to ensure that a user that doesn’t know & care about this backport, has no idea that it happened?
  • Will this work in a cluster of mixed patch versions? Did we test that?
  • If a user upgrades a patch version, uses this feature, and then downgrades, what happens?

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@postamar
Copy link
Copy Markdown

There is a test failure, but I suppose that ultimately it's a welcome one?

@ajwerner ajwerner force-pushed the backport22.1-81679 branch from 2e27745 to 391dd10 Compare July 7, 2022 14:47
Prior to this change, we never enforced nullability of values when performing
index backfills. Up until cockroachdb#76983, all column additions used the legacy schema
changer and its column backfill protocol. The column backfiller indeed checks
on nullability violations for columns [here](https://github.com/cockroachdb/cockroach/blob/d5313438aaa61a71a5a66c5718963bbb0fd7268b/pkg/sql/backfill/backfill.go#L355-L357).

Release note (bug fix): Prior to this change, virtual computed columns which
were marked as NOT NULL could be added to new secondary index. After this
change, attempts to add such columns to a secondary index will result in an
error. Note that such invalid columns can still be added to tables. Work to
resolve that bug is tracked in cockroachdb#81675.
@ajwerner ajwerner force-pushed the backport22.1-81679 branch from 391dd10 to 6a1caa8 Compare July 7, 2022 19:46
@ajwerner ajwerner merged commit 9724e62 into cockroachdb:release-22.1 Jul 7, 2022
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