-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
sql: column family span generation bugfix #40898
sql: column family span generation bugfix #40898
Conversation
PR cockroachdb#38301 inadvertently introduced a bug that unfortunately wasn't caught by any tests - in the process of improving the tight span generation for tables with column families, it accidentally started throwing away all but the spans for the final constraint passed in from the optimizer. This small omission has serious consequences: queries that have a disjunction of spans to examine (like `SELECT * FROM t WHERE key IN (values...)`) will return incorrect results if the table being queried has multiple column families (in certain cases) - it'll look like rows are missing. This will be problematic for mutations as well. Note that this bug was never present in a non-alpha release. Release note (bug fix): restore correct result generation for queries with index disjunctions on tables with multiple column families. Release justification: critical bugfix, low risk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very surprising this didn't fail any tests.. I guess most things don't use column families. Maybe we should run certain tests (eg bigtest) in a mode where we default to a col fam per column.
Based on what I changed when writing that first pr this looks like the correct change. Sorry for introducing this... |
No problem! There were no tests to catch the issue. @RaduBerinde I agree that such an idea is good. Hopefully random table generation and checking could also catch this, as our random table generator does create diverse column family setups. @mjibson, I would love to brainstorm with you about how to get smithcmp to get coverage of this class of issue. bors r+ |
40898: sql: column family span generation bugfix r=jordanlewis a=jordanlewis PR #38301 inadvertently introduced a bug that unfortunately wasn't caught by any tests - in the process of improving the tight span generation for tables with column families, it accidentally started throwing away all but the spans for the final constraint passed in from the optimizer. This small omission has serious consequences: queries that have a disjunction of spans to examine (like `SELECT * FROM t WHERE key IN (values...)`) will return incorrect results if the table being queried has multiple column families (in certain cases) - it'll look like rows are missing. This will be problematic for mutations as well. Note that this bug was never present in a non-alpha release. Fixes #40890. Release note (bug fix): restore correct result generation for queries with index disjunctions on tables with multiple column families. Release justification: critical bugfix, low risk Co-authored-by: Jordan Lewis <jordanthelewis@gmail.com>
Build succeeded |
PR #38301 inadvertently introduced a bug that unfortunately wasn't
caught by any tests - in the process of improving the tight span
generation for tables with column families, it accidentally started
throwing away all but the spans for the final constraint passed in from
the optimizer.
This small omission has serious consequences: queries that have a
disjunction of spans to examine (like
SELECT * FROM t WHERE key IN (values...)
) will return incorrectresults if the table being queried has multiple column families (in
certain cases) - it'll look like rows are missing. This will be
problematic for mutations as well.
Note that this bug was never present in a non-alpha release.
Fixes #40890.
Release note (bug fix): restore correct result generation for queries
with index disjunctions on tables with multiple column families.
Release justification: critical bugfix, low risk