Skip to content

opt: remove lax constant functional dependencies#43532

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
andy-kimball:funcdep
Dec 25, 2019
Merged

opt: remove lax constant functional dependencies#43532
craig[bot] merged 1 commit intocockroachdb:masterfrom
andy-kimball:funcdep

Conversation

@andy-kimball
Copy link
Copy Markdown
Contributor

@andy-kimball andy-kimball commented Dec 24, 2019

Before, the FuncDepSet allowed lax constant functional dependencies like:

()~~>(1,2)

These were columns that always had a constant value, or were NULL-valued.
However, this fails the definition for a lax dependency given in the
header comment in func_dep.go:

(A(r1) = A(r2)) IS True ==> B(r1) NULL= B(r2)

While we know of no bugs caused by this discrepancy, it's safer to just
remove support for lax constants. It turns out that none of our test
scenarios require them; when removed, all transformations still work just
as they did.

Release note: None

Before, the FuncDepSet allowed lax constant functional dependencies like:

  ()~~>(1,2)

These were columns that always had a constant value, or were NULL-valued.
However, this fails the definition for a lax dependency given in the
header comment in func_dep.go:

  (A(r1) = A(r2)) IS True ==> B(r1) NULL= B(r2)

While we know of know bugs caused by this discrepancy, it's safer to just
remove support for lax constants. It turns out that none of our test
scenarios require them; when removed, all transformations still work just
as they did.

Release note: None
@andy-kimball andy-kimball requested a review from a team as a code owner December 24, 2019 22:26
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm: Great that this wasn't very useful, I'm happy with the cleaner semantics :)

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @justinj, @RaduBerinde, and @rytaft)

@andy-kimball
Copy link
Copy Markdown
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Dec 25, 2019
43532: opt: remove lax constant functional dependencies r=andy-kimball a=andy-kimball

Before, the FuncDepSet allowed lax constant functional dependencies like:

  ()~~>(1,2)

These were columns that always had a constant value, or were NULL-valued.
However, this fails the definition for a lax dependency given in the
header comment in func_dep.go:

  (A(r1) = A(r2)) IS True ==> B(r1) NULL= B(r2)

While we know of no bugs caused by this discrepancy, it's safer to just
remove support for lax constants. It turns out that none of our test
scenarios require them; when removed, all transformations still work just
as they did.

Release note: None

Co-authored-by: Andrew Kimball <andyk@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 25, 2019

Build succeeded

@craig craig bot merged commit 9361500 into cockroachdb:master Dec 25, 2019
@andy-kimball andy-kimball deleted the funcdep branch December 26, 2019 17:40
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this pull request Jan 4, 2020
PR cockroachdb#43532 removed the concept of lax constant functional dependencies.
There is a left-over case when we downgrade a key: if we had a strong
empty key, the result is a lax empty key which is no longer a concept.

This change fixes this by removing the key altogether in this case.

Fixes cockroachdb#43532.

Release note (bug fix): fixes "expected constant FD to be strict"
internal error.
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this pull request Jan 6, 2020
PR cockroachdb#43532 removed the concept of lax constant functional dependencies.
There is a left-over case when we downgrade a key: if we had a strong
empty key, the result is a lax empty key which is no longer a concept.

This change fixes this by removing the key altogether in this case.

Fixes cockroachdb#43651.

Release note (bug fix): fixes "expected constant FD to be strict"
internal error.
craig bot pushed a commit that referenced this pull request Jan 6, 2020
43703: storage/batcheval/result: perform various cleanup on LocalResult struct r=nvanbenschoten a=nvanbenschoten

This PR contains a series of cleanups to the `result.LocalResult` struct. It leaves the structure in a good position to be extended to include information about newly written, updated, and removed intents, which are hooked into the `concurrency` package in future commits the same way that `UpdatedTxns` is currently hooked into the TxnWaitQueue.

The changes are broken into a series of incremental steps to make them easier to review in isolation.

43722: opt: fix assertion failure due to lax empty key r=RaduBerinde a=RaduBerinde

PR #43532 removed the concept of lax constant functional dependencies.
There is a left-over case when we downgrade a key: if we had a strong
empty key, the result is a lax empty key which is no longer a concept.

This change fixes this by removing the key altogether in this case.

Fixes #43651.

Release note (bug fix): fixes "expected constant FD to be strict"
internal error.

43734: pgwire: deflake TestAuthenticationAndHBARules r=knz a=knz

Fixes #43733.

This was my mistake to fix, I had forgotten that cluster settings
propagate asynchronously.

Release note: None

Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Co-authored-by: Radu Berinde <radu@cockroachlabs.com>
Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net>
Azhng pushed a commit to Azhng/cockroach that referenced this pull request Jan 8, 2020
PR cockroachdb#43532 removed the concept of lax constant functional dependencies.
There is a left-over case when we downgrade a key: if we had a strong
empty key, the result is a lax empty key which is no longer a concept.

This change fixes this by removing the key altogether in this case.

Fixes cockroachdb#43651.

Release note (bug fix): fixes "expected constant FD to be strict"
internal error.
@RaduBerinde
Copy link
Copy Markdown
Member

While we know of no bugs caused by this discrepancy

I found the other day that (before this PR) if we have a lax empty key and happen to call MakeNotNull(), it always turns it into a strict key (even if we pass an empty set, which should be a no-op).

RaduBerinde added a commit to RaduBerinde/cockroach that referenced this pull request Jan 31, 2020
PR cockroachdb#43532 removed the concept of lax constant functional dependencies.
There is a left-over case when we downgrade a key: if we had a strong
empty key, the result is a lax empty key which is no longer a concept.

This change fixes this by removing the key altogether in this case.

Fixes cockroachdb#43651.

Release note (bug fix): fixes "expected constant FD to be strict"
internal error.
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this pull request Jan 31, 2020
PR cockroachdb#43532 removed the concept of lax constant functional dependencies.
There is a left-over case when we downgrade a key: if we had a strong
empty key, the result is a lax empty key which is no longer a concept.

This change fixes this by removing the key altogether in this case.

Fixes cockroachdb#43651.

Release note (bug fix): fixes "expected constant FD to be strict"
internal error.
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this pull request Feb 3, 2020
PR cockroachdb#43532 removed the concept of lax constant functional dependencies.
There is a left-over case when we downgrade a key: if we had a strong
empty key, the result is a lax empty key which is no longer a concept.

This change fixes this by removing the key altogether in this case.

Fixes cockroachdb#43651.

Release note (bug fix): fixes "expected constant FD to be strict"
internal error.
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this pull request Feb 3, 2020
PR cockroachdb#43532 removed the concept of lax constant functional dependencies.
There is a left-over case when we downgrade a key: if we had a strong
empty key, the result is a lax empty key which is no longer a concept.

This change fixes this by removing the key altogether in this case.

Fixes cockroachdb#43651.

Release note (bug fix): fixes "expected constant FD to be strict"
internal error.
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