-
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
roachtest/sqlsmith: internal error: building declarative schema change targets for CREATE FUNCTION #105259
Comments
A simpler repro:
And, this is also a problem for Views, for example, this would fail with the same error:
|
Looks like this happens when we try to serialize UDT reference into IDs, and it failed to find the type annotations for some reason, and looks like only happens on type casting on query. A even simpler repro:
|
So the problem is that we do TypeCheck on a subquery during the serialization and the TypeCheck of the subquery only assert on the type annotation. But...looks like we never resolve the type of the subquery during this serialization path...(because it's outside of optbuilder?) |
@chengxiong-ruan I'm pretty sure I already resolved this issue for UDFs: #105465 fixes #104242 Do we need something similar for views? |
@rafiss I think this is a different issue than you fix :(. the annotation is a different thing than the annotation in your fix I think, I believe I was able to repro the error with your fix on master... |
ah yeah you're right. the new thing in this issue is the subquery. |
This reproduces all the way back to v21.2, but not on v21.1. @chengxiong-ruan are you working on a fix, or would you like me to look into it? |
I think I have a solution. Should have a PR up soon. |
@mgartner no I don't have a proper solution on the schema changer side. Thanks for working on this. It seems tricky to me. |
Prior to this commit, the optimizer serialized the `CREATE VIEW` query AST after performing static analysis of the view query. Now, the AST is plumbed to the planNode responsible for executing this DDL statement. This is more consistent with how other DML statements are planned, like `CREATE FUNCTION`. This change will: 1. Allow us to address cockroachdb#105259 in a future commit more easily. 2. Allow for greater flexibility within the execution logic. 3. Reduce redundant computation, like re-parsing and type-checking the AST. Release note: None
This commit fixes a bug that was caused when attempting to re-type-check a view's query that contains a subquery. This type-checking occurred outside of optbuilder. However, the logic for type-checking subqueries is only implemented within optbuilder, so it failed. This commit fixes the issue by avoid the duplicate type-checking altogether. It should not be necessary, but it serviced two important functions: 1. Serializing user-defined types as their descriptor IDs. This is now accomplished by formatting the view query's AST with the `FmtSerializable` option. 2. Checking for cross-database type references. This is now done with a new function that traverses the view query's AST without performing type-checking. In the future, this should happen while optbuilder performs static analysis, and I've left a TODO that mentions this. This commit does not address a similar bug that affects UDFs. It will be fixed in a future commit. Informs cockroachdb#105259 Release note (bug fix): A bug has been fixed that caused internal errors when using user-defined types in views that have subqueries. This bug was present since version v21.2.
This commit fixes a bug that was caused when attempting to re-type-check a view's query that contains a subquery. This type-checking occurred outside of optbuilder. However, the logic for type-checking subqueries is only implemented within optbuilder, so it failed. This commit fixes the issue by avoid the duplicate type-checking altogether. It should not be necessary, but it serviced two important functions: 1. Serializing user-defined types as their descriptor IDs. This is now accomplished by formatting the view query's AST with the `FmtSerializable` option. 2. Checking for cross-database type references. This is now done with a new function that traverses the view query's AST without performing type-checking. In the future, this should happen while optbuilder performs static analysis, and I've left a TODO that mentions this. This commit does not address a similar bug that affects UDFs. It will be fixed in a future commit. Informs cockroachdb#105259 Release note (bug fix): A bug has been fixed that caused internal errors when using user-defined types in views that have subqueries. This bug was present since version v21.2.
This commit fixes a bug that was caused when attempting to re-type-check a view's query that contains a subquery. This type-checking occurred outside of optbuilder. However, the logic for type-checking subqueries is only implemented within optbuilder, so it failed. Fixes cockroachdb#105259 Release note (bug fix): A bug has been fixed that caused internal errors when using user-defined types in views and user-defined functions that have subqueries. This bug was present when using views since version v21.2. It was present when using user-defined functions since v23.1.
106824: Revert "roachprod: provide workaround for long-running AWS clusters" r=herkolategan a=renatolabs This reverts commit e6cf25d. The oldest `aws` cluster at the time of this commit is ~17d old, long after the hostname validation was introduced. Since we now have an easy way to update roachprod (`roachprod update`), it should be straightforward for anyone to be running updated versions of roachprod that include hostname validation. Epic: none Release note: None 106868: sql: do not type-check subqueries outside of optbuilder r=mgartner a=mgartner This commit fixes a bug that was caused when attempting to re-type-check a view's query that contains a subquery. This type-checking occurred outside of optbuilder. However, the logic for type-checking subqueries is only implemented within optbuilder, so it failed. Fixes #105259 Release note (bug fix): A bug has been fixed that caused internal errors when using user-defined types in views and user-defined functions that have subqueries. This bug was present when using views since version v21.2. It was present when using user-defined functions since v23.1. 106871: ts: correctly set Columnar flag on memory context r=yuzefovich a=yuzefovich This flag is used to determine the size of the slab, and it wasn't set properly since 2018. The impact is that for non-rollup we'll be able to retrieve more samples in a single operation because the columnar slab size is smaller (in a test I observed 4.5kb vs 14.5kv for the row format slab). Epic: None Release note: None 106881: bench, collector: remove usages of base.TODOTestTenantDisabled r=yuzefovich a=yuzefovich We have four variants of running cockroach in benchmarks, two of them create tenants on their own, so now they are marked as explicitly controlling tenants. Eventually, we'll want to transition `benchmarkCockroach` and `benchmarkMultinodeCockroach` to use tenants too, and that work is tracked by #83461. This commit also removes a single usage of the TODO value in `util/tracing/collector` where the test itself creates tenants. Addresses: #76378. Epic: CRDB-18499 Release note: None 106898: serverccl: mark TestAdminAPIDataDistributionPartitioning as problematic r=yuzefovich a=knz Informs #76378. Epic: CRDB-18499. Followup issue: #106897. Release note: None 106921: github-pull-request-make: stress if test was unskipped via `skip` pkg r=rail a=rickystewart Also remove unnecessary retries that were added because `yarn install` was flaky (we don't do `yarn install` as part of the build any more). Epic: none Release note: None Closes: #106914 Co-authored-by: Renato Costa <renato@cockroachlabs.com> Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com> Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com> Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net> Co-authored-by: Ricky Stewart <ricky@cockroachlabs.com>
This commit fixes a bug that was caused when attempting to re-type-check a view's query that contains a subquery. This type-checking occurred outside of optbuilder. However, the logic for type-checking subqueries is only implemented within optbuilder, so it failed. Fixes cockroachdb#105259 Release note (bug fix): A bug has been fixed that caused internal errors when using user-defined types in views that have subqueries. This bug was present when using views since version v21.2.
This commit fixes a bug that was caused when attempting to re-type-check a view's query that contains a subquery. This type-checking occurred outside of optbuilder. However, the logic for type-checking subqueries is only implemented within optbuilder, so it failed. Fixes cockroachdb#105259 Release note (bug fix): A bug has been fixed that caused internal errors when using user-defined types in views and user-defined functions that have subqueries. This bug was present when using views since version v21.2. It was present when using user-defined functions since v23.1.
roachtest.sqlsmith/setup=rand-tables/setting=no-mutations failed with artifacts on master @ 1eb628e8c8a7eb1cbf9bfa2bd6c31982c25cbba0:
Parameters:
ROACHTEST_arch=amd64
,ROACHTEST_cloud=gce
,ROACHTEST_cpu=4
,ROACHTEST_encrypted=false
,ROACHTEST_ssd=0
Help
See: roachtest README
See: How To Investigate (internal)
This test on roachdash | Improve this report!
Jira issue: CRDB-28946
The text was updated successfully, but these errors were encountered: