-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: Internal Error when executing query #96288
Comments
Hello, I am Blathers. I am here to help you get the issue triaged. Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here. I have CC'd a few people who may be able to assist you:
If we have not gotten back to your issue within a few business days, you can try the following:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Hi @knz, please add branch-* labels to identify which branch(es) this release-blocker affects. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Bisected to: #87735 |
In PR cockroachdb#87735 we allowed extra cols that were constant constrained provide orderings but the remapOrdering code couldn't handle these extra columns and would panic. Fix it by allowing these extra columns to be remapped. Fixes: cockroachdb#96288
98092: sql/opt: fix "no output column" internal error r=cucaroach a=cucaroach In PR #87735 we allowed extra cols that were constant constrained provide orderings but the remapOrdering code couldn't handle these extra columns and would panic. Fix it by allowing these extra columns to be remapped. Fixes: #96288 Co-authored-by: Tommy Reilly <[email protected]>
In PR cockroachdb#87735 we allowed extra cols that were constant constrained provide orderings but the remapOrdering code couldn't handle these extra columns and would panic. Fix it by allowing these extra columns to be remapped. Fixes: cockroachdb#96288
Reopen to explore Drew's thoughts on #98092 |
@DrewKimball is there still something we need to do here? What was the motiviation for the GA-blocker label? It looks like this reproduces on v22.2. |
We should probably try and figure out why we're unable to tell that a column is constant/redundant in |
I was hoping to get to it later this week but focusing on getting copy in before branch cut ATM. |
Looking into this one. There's a filter While this probably points to some missing filter simplification logic, we can't guarantee that we'll prevent all cases like this, where transformations further down in the tree expose properties that can't be (or weren't) proven further up the tree. The ordering logic needs to be able to correctly handle these cases. |
It's possible to trigger the error even with the fix in #98092 with this case:
|
It is possible for some functional-dependency information to be visible to a child operator but invisible to its parent. This could previously cause panics when a child provided an ordering that could be proven to satisfy the required ordering with the child FDs, but not with the parent's FDs. This patch adds a step to the logic that builds provided orderings that ensures a provided ordering can be proven to respect the required ordering without needing additional FD information. This ensures that a parent never needs to know its child's FDs in order to prove that the provided ordering is correct. The extra step is a no-op in the common case when the provided ordering can already be proven to respect the required ordering. Informs cockroachdb#85393 Informs cockroachdb#87806 Fixes cockroachdb#96288 Release note (bug fix): Fixed a rare internal error in the optimizer that has existed since before version 22.1, which could occur while enforcing orderings between SQL operators.
This patch separates the responsibility of constructing the provided ordering for each operator and verifying its correctness, from that of remapping it to the set of output columns and simplifying it to reflect known functional dependencies. This decreases the complexity of provided ordering construction, and unifies the logic for ensuring provided orderings can be mapped back to their required ordering choices. Informs cockroachdb#96288 Release note: None
100533: workload: jitter the teardown of connections to prevent thundering herd r=sean- a=sean- This change upgrades workload's use of pgx from v4 to v5 in order to allow jittering the teardown of connections. This change sets a max connection age of 5min and jitters the teardown by 30s. Upgrading to pgx v5 also adds non-blocking pgxpool connection acquisition. workload: add flags to manage the age and lifecycle of connection pool Add flags to all workload types to specify: * the max connection age: `--max-conn-lifetime duration` * the max connection age jitter: `--max-conn-lifetime-jitter duration` * the max connection idle time: `--max-conn-idle-time duration` * the connection health check interval: `--conn-healthcheck-period duration` * the min number of connections in the pool: `--min-conns int` workload: add support for remaining pgx query modes Add support for pgx.QueryExecModeCacheDescribe and pgx.QueryExecModeDescribeExec. Previously, only three of the five query modes were available. workload: fix race condition when recording histogram data Release note (cli change): workload jitters teardown of connections to prevent thundering herd impacting P99 latency results. Release note (cli change): workload utility now has flags to tune the connection pool used for testing. See `--conn-healthcheck-period`, `--min-conns`, and the `--max-conn-*` flags for details. Release note (cli change): workload now supports every [PostgreSQL query mode](https://github.com/jackc/pgx/blob/fa5fbed497bc75acee05c1667a8760ce0d634cba/conn.go#L167-L182) available via the underlying pgx driver. 100776: opt: fix ordering-related optimizer panics r=DrewKimball a=DrewKimball It is possible for some functional-dependency information to be visible to a child operator but invisible to its parent. This could previously cause panics when a child provided an ordering that could be proven to satisfy the required ordering with the child FDs, but not with the parent's FDs. This patch adds a step to the logic that builds provided orderings that ensures a provided ordering can be proven to respect the required ordering without needing additional FD information. This ensures that a parent never needs to know its child's FDs in order to prove that the provided ordering is correct. The extra step is a no-op in the common case when the provided ordering can already be proven to respect the required ordering. Informs #85393 Informs #87806 Fixes #96288 Release note (bug fix): Fixed a rare internal error in the optimizer that has existed since before version 22.1, which could occur while enforcing orderings between SQL operators. 101076: autoconfig: prevent a data race in TestAutoConfig r=adityamaru a=knz Needed for #101069. The calls to Peek and Pop can run concurrently. Release note: None Epic: CRDB-23559 101078: roachtest: move copyfrom test suite to SQL Queries r=srosenberg a=nvanbenschoten See https://cockroachlabs.slack.com/archives/C0168LW5THS/p1679508254391039. Epic: None Release note: None Co-authored-by: Sean Chittenden <[email protected]> Co-authored-by: Drew Kimball <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Nathan VanBenschoten <[email protected]>
It is possible for some functional-dependency information to be visible to a child operator but invisible to its parent. This could previously cause panics when a child provided an ordering that could be proven to satisfy the required ordering with the child FDs, but not with the parent's FDs. This patch adds a step to the logic that builds provided orderings that ensures a provided ordering can be proven to respect the required ordering without needing additional FD information. This ensures that a parent never needs to know its child's FDs in order to prove that the provided ordering is correct. The extra step is a no-op in the common case when the provided ordering can already be proven to respect the required ordering. Informs #85393 Informs #87806 Fixes #96288 Release note (bug fix): Fixed a rare internal error in the optimizer that has existed since before version 22.1, which could occur while enforcing orderings between SQL operators.
It is possible for some functional-dependency information to be visible to a child operator but invisible to its parent. This could previously cause panics when a child provided an ordering that could be proven to satisfy the required ordering with the child FDs, but not with the parent's FDs. This patch adds a step to the logic that builds provided orderings that ensures a provided ordering can be proven to respect the required ordering without needing additional FD information. This ensures that a parent never needs to know its child's FDs in order to prove that the provided ordering is correct. The extra step is a no-op in the common case when the provided ordering can already be proven to respect the required ordering. Informs #85393 Informs #87806 Fixes #96288 Release note (bug fix): Fixed a rare internal error in the optimizer that has existed since before version 22.1, which could occur while enforcing orderings between SQL operators.
It is possible for some functional-dependency information to be visible to a child operator but invisible to its parent. This could previously cause panics when a child provided an ordering that could be proven to satisfy the required ordering with the child FDs, but not with the parent's FDs. This patch adds a step to the logic that builds provided orderings that ensures a provided ordering can be proven to respect the required ordering without needing additional FD information. This ensures that a parent never needs to know its child's FDs in order to prove that the provided ordering is correct. The extra step is a no-op in the common case when the provided ordering can already be proven to respect the required ordering. Informs cockroachdb#85393 Informs cockroachdb#87806 Fixes cockroachdb#96288 Release note (bug fix): Fixed a rare internal error in the optimizer that has existed since before version 22.1, which could occur while enforcing orderings between SQL operators.
It is possible for some functional-dependency information to be visible to a child operator but invisible to its parent. This could previously cause panics when a child provided an ordering that could be proven to satisfy the required ordering with the child FDs, but not with the parent's FDs. This patch adds a step to the logic that builds provided orderings that ensures a provided ordering can be proven to respect the required ordering without needing additional FD information. This ensures that a parent never needs to know its child's FDs in order to prove that the provided ordering is correct. The extra step is a no-op in the common case when the provided ordering can already be proven to respect the required ordering. Informs cockroachdb#85393 Informs cockroachdb#87806 Fixes cockroachdb#96288 Release note (bug fix): Fixed a rare internal error in the optimizer that has existed since before version 22.1, which could occur while enforcing orderings between SQL operators.
It is possible for some functional-dependency information to be visible to a child operator but invisible to its parent. This could previously cause panics when a child provided an ordering that could be proven to satisfy the required ordering with the child FDs, but not with the parent's FDs. This patch adds a step to the logic that builds provided orderings that ensures a provided ordering can be proven to respect the required ordering without needing additional FD information. This ensures that a parent never needs to know its child's FDs in order to prove that the provided ordering is correct. The extra step is a no-op in the common case when the provided ordering can already be proven to respect the required ordering. Informs #85393 Informs #87806 Fixes #96288 Release note (bug fix): Fixed a rare internal error in the optimizer that has existed since before version 22.1, which could occur while enforcing orderings between SQL operators.
Describe the problem
The latest version of the CockroachDB (version v22.2.3 and v23.1.0 alpha) shows
Internal Error
when executing the following query:To Reproduce
To Reproduce
Here is the detail steps to reproduce the bug.
make install
in the root repository folder../cockroach demo
, and then paste the PoC query to the cockroach cli environment.Internal Error
and log the stack information.Expected behavior
The
SELECT
statement should return empty result, indicating that no data in the table v0 is matching the given constraints.Additional data / screenshots
Here is the outputted stack trace from version: 778b6fb
Environment:
./cockroach demo
)Additional context
The bug can be reproduced by CockroachDB release version:
CockroachDB v23.1 Testing Releases
,v22.2.3
,v22.2.2
andv22.2.1
. However, the PoC does work find inv22.2.0
, The bug may be introduced in a commit between the time frame ofv22.2.2
andv22.2.1
.Jira issue: CRDB-24046
The text was updated successfully, but these errors were encountered: