cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.21k stars 3.82k forks source link

Sentry: statistics_builder.go:5146: could not find computed column expression for column × in table {{× {× × false false}}} (1) assertion failure Wraps: (2) attached stack trace -- stack trace: ... #136464

Closed cockroach-sentry closed 18 hours ago

cockroach-sentry commented 1 day ago

This issue was auto filed by Sentry. It represents a crash or reported error on a live cluster with telemetry enabled.

Sentry Link: https://cockroach-labs.sentry.io/issues/6104983408/?referrer=webhooks_plugin

Panic Message:

statistics_builder.go:5146: could not find computed column expression for column × in table {{× {× × false false}}}
(1) assertion failure
Wraps: (2) attached stack trace
  -- stack trace:
  | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*statisticsBuilder).factorOutVirtualCols.func1
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/memo/statistics_builder.go:5146
  | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*statisticsBuilder).factorOutVirtualCols.ColSet.ForEach.func3
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/colset.go:78
  | github.com/cockroachdb/cockroach/pkg/util/intsets.Fast.ForEach
  |     github.com/cockroachdb/cockroach/pkg/util/intsets/fast.go:154
  | github.com/cockroachdb/cockroach/pkg/sql/opt.ColSet.ForEach
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/colset.go:78
  | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*statisticsBuilder).factorOutVirtualCols
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/memo/statistics_builder.go:5138
  | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*statisticsBuilder).applyFiltersItem
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/memo/statistics_builder.go:3374
  | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*statisticsBuilder).applyFilters
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/memo/statistics_builder.go:3332
  | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*statisticsBuilder).filterRelExpr
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/memo/statistics_builder.go:3281
  | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*statisticsBuilder).buildSelect
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/memo/statistics_builder.go:1083
  | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*logicalPropsBuilder).buildSelectProps
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/memo/logical_props_builder.go:302
  | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*Memo).MemoizeSelect
  |     github.com/cockroachdb/cockroach/bazel-out/k8-opt/bin/pkg/sql/opt/memo/expr.og.go:21008
  | github.com/cockroachdb/cockroach/pkg/sql/opt/norm.(*Factory).ConstructSelect
  |     github.com/cockroachdb/cockroach/bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go:1560
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildPartialIndexPredicate
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/partial_index.go:171
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).addPartialIndexPredicatesForTable
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/partial_index.go:99
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildScan
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:767
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildDataSource
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:159
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildDataSource
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:89
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1409
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildFromTables
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1386
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildFrom
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1316
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectClause
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1232
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1164
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1116
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).processWiths
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:111
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelect
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1115
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmt
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:355
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRootWithScope
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:294
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:275
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).Build
  |     github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:254
  | github.com/cockroachdb/cockroach/pkg/sql.(*optPlanningCtx).buildReusableMemo
  |     github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:465
  | github.com/cockroachdb/cockroach/pkg/sql.(*planner).prepareUsingOptimizer
  |     github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:166
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).populatePrepared
  |     github.com/cockroachdb/cockroach/pkg/sql/conn_executor_prepare.go:339
Wraps: (3) could not find computed column expression for column × in table {{× {× × false false}}}
Error types: (1) *assert.withAssertionFailure (2) *withstack.withStack (3) *errutil.leafError
-- report composition:
*errutil.leafError: could not find computed column expression for column × in table {{× {× × false false}}}
statistics_builder.go:5146: *withstack.withStack (top exception)
*assert.withAssertionFailure
Stacktrace (expand for inline code snippets): [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/conn_executor_prepare.go#L338-L340](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/conn_executor_prepare.go#L338-L340) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/plan_opt.go#L165-L167](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/plan_opt.go#L165-L167) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/plan_opt.go#L464-L466](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/plan_opt.go#L464-L466) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/builder.go#L253-L255](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/builder.go#L253-L255) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/builder.go#L274-L276](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/builder.go#L274-L276) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/builder.go#L293-L295](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/builder.go#L293-L295) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/builder.go#L354-L356](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/builder.go#L354-L356) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1114-L1116](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1114-L1116) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/with.go#L110-L112](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/with.go#L110-L112) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1115-L1117](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1115-L1117) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1163-L1165](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1163-L1165) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1231-L1233](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1231-L1233) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1315-L1317](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1315-L1317) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1385-L1387](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1385-L1387) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1408-L1410](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L1408-L1410) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L88-L90](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L88-L90) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L158-L160](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L158-L160) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L766-L768](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/select.go#L766-L768) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/partial_index.go#L98-L100](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/partial_index.go#L98-L100) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/partial_index.go#L170-L172](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/optbuilder/partial_index.go#L170-L172) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go#L1559-L1561](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go#L1559-L1561) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/bazel-out/k8-opt/bin/pkg/sql/opt/memo/expr.og.go#L21007-L21009](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/bazel-out/k8-opt/bin/pkg/sql/opt/memo/expr.og.go#L21007-L21009) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/logical_props_builder.go#L301-L303](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/logical_props_builder.go#L301-L303) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L1082-L1084](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L1082-L1084) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L3280-L3282](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L3280-L3282) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L3331-L3333](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L3331-L3333) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L3373-L3375](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L3373-L3375) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L5137-L5139](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L5137-L5139) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/colset.go#L77-L79](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/colset.go#L77-L79) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/util/intsets/fast.go#L153-L155](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/util/intsets/fast.go#L153-L155) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/colset.go#L77-L79](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/colset.go#L77-L79) [https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L5145-L5147](https://github.com/cockroachdb/cockroach/blob/3613a619e327fb412ac62036ce2c7060c25e48db/pkg/sql/opt/memo/statistics_builder.go#L5145-L5147)
pkg/sql/conn_executor_prepare.go in pkg/sql.(*connExecutor).populatePrepared at line 339
pkg/sql/plan_opt.go in pkg/sql.(*planner).prepareUsingOptimizer at line 166
pkg/sql/plan_opt.go in pkg/sql.(*optPlanningCtx).buildReusableMemo at line 465
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).Build at line 254
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot at line 275
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRootWithScope at line 294
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 355
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect at line 1115
pkg/sql/opt/optbuilder/with.go in pkg/sql/opt/optbuilder.(*Builder).processWiths at line 111
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1 at line 1116
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens at line 1164
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectClause at line 1232
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFrom at line 1316
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTables at line 1386
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep at line 1409
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 89
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 159
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildScan at line 767
pkg/sql/opt/optbuilder/partial_index.go in pkg/sql/opt/optbuilder.(*Builder).addPartialIndexPredicatesForTable at line 99
pkg/sql/opt/optbuilder/partial_index.go in pkg/sql/opt/optbuilder.(*Builder).buildPartialIndexPredicate at line 171
bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go in pkg/sql/opt/norm.(*Factory).ConstructSelect at line 1560
bazel-out/k8-opt/bin/pkg/sql/opt/memo/expr.og.go in pkg/sql/opt/memo.(*Memo).MemoizeSelect at line 21008
pkg/sql/opt/memo/logical_props_builder.go in pkg/sql/opt/memo.(*logicalPropsBuilder).buildSelectProps at line 302
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).buildSelect at line 1083
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).filterRelExpr at line 3281
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).applyFilters at line 3332
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).applyFiltersItem at line 3374
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).factorOutVirtualCols at line 5138
pkg/sql/opt/colset.go in pkg/sql/opt.ColSet.ForEach at line 78
pkg/util/intsets/fast.go in pkg/util/intsets.Fast.ForEach at line 154
pkg/sql/opt/colset.go in pkg/sql/opt/memo.(*statisticsBuilder).factorOutVirtualCols.ColSet.ForEach.func3 at line 78
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).factorOutVirtualCols.func1 at line 5146

Tags

Tag Value
Command server
Environment v24.1.7
Go Version go1.22.5 X:nocoverageredesign
Platform linux arm64
Distribution CCL
Cockroach Release v24.1.7
Cockroach SHA 3613a619e327fb412ac62036ce2c7060c25e48db
# of CPUs 16
# of Goroutines 3409

Jira issue: CRDB-45082

blathers-crl[bot] commented 1 day ago

CC'ing via the CODEOWNERS-based sentry heuristic:

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

yuzefovich commented 18 hours ago

dup of #129405