-
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
sentry: panic during window function planning due to OOB when adding render expressions #35179
Comments
@yuzefovich could you take a look at this and see if you can make heads or tails of it? |
It is not related to the bug I fixed earlier (#33340), and unfortunately I cannot replicate it locally by writing a similar query to the one that caused the panic. My guess is that the problem is somewhere around here https://github.com/cockroachdb/cockroach/blob/release-2.1/pkg/sql/distsql_physical_planner.go#L3104 where we're adjusting indices of the columns to put the results of window functions computations in due to |
36598: sql: Unify the SQL type system r=andy-kimball a=andy-kimball This PR unifies the three different SQL type systems in CRDB: `sqlbase.ColumnType` - protobuf representation of table column types `coltypes.T` - in-memory representation of table column types `types.T` - computation types The type systems are quite similar, but also subtly different. This causes bugs on a regular basis throughout the codebase. Each type system supports a different subset of the PG type functionality. For example, `sqlbase.ColumnType` stores column widths. `types.T` does not store widths, but it can store a Postgres OID value, which `sqlbase.ColumnType` is unable to do. In addition, even for supported functionality, the API's are often tricky and error-prone. For example, `types.T` values can sometimes be compared using `==`, but other times `Equivalent` must be called, and it is up to the user to know when to use which. As another example, support for OID values require wrapping `types.T` instances in a special `TOIDWrapper` type. Our developers are expected to know when it needs to be done, but typically they either don't understand when it's needed, or else forget to do it. It also breaks `==` comparison semantics, leading to subtle bugs that only manifest in edge cases with unusual OID values. Another big problem that comes up repeatedly are lossy conversions. Throughout the codebase, there are frequent conversions to/from the various type systems. Many conversions discard important type information, which often leads to incompatibilities with Postgres, as well as providing a breeding ground for bugs. This PR unifies the three type systems into just one. The unified type is called `types.T` (in new `sql/types` package). It uses a protobuf-generated struct that is backwards-compatible with `sqlbase.ColumnType` so that it can be embedded in place of `ColumnType` in larger protobuf messages (like `sqlbase.ColumnDescriptor`). The API is locked down so that it's difficult to ignorantly or accidentally create invalid types. The unified type supports everything that the three previous type systems did, and is more compatible with PG as a result (with more work, even more type compatibility is possible). Resolves #32639 36681: distsqlplan: reset MergeOrdering if windower is planned r=yuzefovich a=yuzefovich Windower doesn't guarantee maintaining the order, so merge ordering of the plan should be set to empty. Fixes: #35179. Release note: None 36962: storage/engine: fix handling of 0-length varstrings in RocksDBBatchReader r=tbg a=petermattis Previously, 0-length varstrings inadvertently cuased the reader to truncate the batch repr which would usually result in a call to `Next` complaining about the batch containing an unexpected number of entries. So far, it looks like the only effect of this would be "invalid batch" errors while using `cockroach debug` commands. It is possible there is a more serious effect, though. See #36937 Release note (bug fix): Fixed a bug in write batch decoding that could cause "invalid batch" errors while using `cockroach debug` commands to analyze data. Co-authored-by: Andrew Kimball <[email protected]> Co-authored-by: Yahor Yuzefovich <[email protected]> Co-authored-by: Peter Mattis <[email protected]>
This issue was autofiled by Sentry. It represents a crash or reported error on a live cluster with telemetry enabled.
Sentry link: https://sentry.io/organizations/cockroach-labs/issues/907105840/?project=164528&referrer=webhooks_plugin
Panic message:
Stacktrace (expand for inline code snippets):
cockroach/pkg/sql/conn_executor.go
Lines 386 to 388 in 1634c6b
/usr/local/go/src/runtime/asm_amd64.s#L572-L574 in runtime.call32
/usr/local/go/src/runtime/panic.go#L501-L503 in runtime.gopanic
/usr/local/go/src/runtime/panic.go#L27-L29 in runtime.panicindex
cockroach/pkg/sql/distsqlplan/physical_plan.go
Lines 516 to 518 in 1634c6b
cockroach/pkg/sql/distsql_plan_window.go
Lines 329 to 331 in 1634c6b
cockroach/pkg/sql/distsql_physical_planner.go
Lines 3224 to 3226 in 1634c6b
cockroach/pkg/sql/distsql_physical_planner.go
Lines 2357 to 2359 in 1634c6b
cockroach/pkg/sql/distsql_physical_planner.go
Lines 2298 to 2300 in 1634c6b
cockroach/pkg/sql/distsql_physical_planner.go
Lines 2316 to 2318 in 1634c6b
cockroach/pkg/sql/distsql_running.go
Lines 751 to 753 in 1634c6b
cockroach/pkg/sql/conn_executor_exec.go
Lines 981 to 983 in 1634c6b
cockroach/pkg/sql/conn_executor_exec.go
Lines 823 to 825 in 1634c6b
cockroach/pkg/sql/conn_executor_exec.go
Lines 401 to 403 in 1634c6b
cockroach/pkg/sql/conn_executor_exec.go
Lines 95 to 97 in 1634c6b
cockroach/pkg/sql/conn_executor.go
Lines 1174 to 1176 in 1634c6b
cockroach/pkg/sql/conn_executor.go
Lines 388 to 390 in 1634c6b
cockroach/pkg/sql/pgwire/conn.go
Lines 312 to 314 in 1634c6b
v2.1.5
go1.10.7
The text was updated successfully, but these errors were encountered: