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/1711322401/?referrer=webhooks_plugin
Panic message:
*errors.errorString
*safedetails.withSafeDetails: estimated row count must be non-zero (1)
statistics_builder.go:2301: *withstack.withStack (2)
*assert.withAssertionFailure
(check the extra data payloads)
Stacktrace (expand for inline code snippets):
|
if s.RowCount <= 0 && relProps.Cardinality.Max > 0 { |
|
panic(errors.AssertionFailedf("estimated row count must be non-zero")) |
|
} |
in pkg/sql/opt/memo.(*statisticsBuilder).finalizeFromCardinality
|
s.RowCount = inputStats.RowCount |
|
sb.finalizeFromCardinality(relProps) |
|
} |
in pkg/sql/opt/memo.(*statisticsBuilder).buildWithScan
|
if !b.disableStats { |
|
b.sb.buildWithScan(withScan, rel) |
|
} |
in pkg/sql/opt/memo.(*logicalPropsBuilder).buildWithScanProps
https://github.com/cockroachdb/cockroach/blob/c0f00d2a156295a1cb79ed960940c167cb03ccbc/pkg/sql/opt/memo/expr.og.go#L16550-L16552 in pkg/sql/opt/memo.(*Memo).MemoizeWithScan
https://github.com/cockroachdb/cockroach/blob/c0f00d2a156295a1cb79ed960940c167cb03ccbc/pkg/sql/opt/norm/factory.og.go#L8535-L8537 in pkg/sql/opt/norm.(*Factory).ConstructWithScan
|
|
|
outScope.expr = b.factory.ConstructWithScan(&memo.WithScanPrivate{ |
|
With: cte.id, |
in pkg/sql/opt/optbuilder.(*Builder).buildDataSource
|
|
|
outScope = b.buildDataSource(source.Expr, indexFlags, locking, inScope) |
|
|
in pkg/sql/opt/optbuilder.(*Builder).buildDataSource
|
) (outScope *scope) { |
|
outScope = b.buildDataSource(tables[0], nil /* indexFlags */, locking, inScope) |
|
|
in pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep
|
} |
|
tableScope := b.buildFromTablesRightDeep(tables, locking, inScope) |
|
|
in pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep
|
} |
|
return b.buildFromTablesRightDeep(tables, locking, inScope) |
|
} |
in pkg/sql/opt/optbuilder.(*Builder).buildFromTables
|
if len(from.Tables) > 0 { |
|
outScope = b.buildFromTables(from.Tables, locking, inScope) |
|
} else { |
in pkg/sql/opt/optbuilder.(*Builder).buildFrom
|
) (outScope *scope) { |
|
fromScope := b.buildFrom(sel.From, locking, inScope) |
|
b.processWindowDefs(sel, fromScope) |
in pkg/sql/opt/optbuilder.(*Builder).buildSelectClause
|
case *tree.SelectClause: |
|
outScope = b.buildSelectClause(t, orderBy, locking, desiredTypes, inScope) |
|
|
in pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens
|
return b.processWiths(with, inScope, func(inScope *scope) *scope { |
|
return b.buildSelectStmtWithoutParens( |
|
wrapped, orderBy, limit, locking, desiredTypes, inScope, |
in pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1
|
inScope.atRoot = false |
|
outScope := buildStmt(inScope) |
|
inScope.atRoot = prevAtRoot |
in pkg/sql/opt/optbuilder.(*Builder).processWiths
|
|
|
return b.processWiths(with, inScope, func(inScope *scope) *scope { |
|
return b.buildSelectStmtWithoutParens( |
in pkg/sql/opt/optbuilder.(*Builder).buildSelect
|
case *tree.Select: |
|
return b.buildSelect(stmt, noRowLocking, desiredTypes, inScope) |
|
|
in pkg/sql/opt/optbuilder.(*Builder).buildStmt
|
b.pushWithFrame() |
|
recursiveScope := b.buildStmt(recursive, initialTypes /* desiredTypes */, cteScope) |
|
b.popWithFrame(recursiveScope) |
in pkg/sql/opt/optbuilder.(*Builder).buildCTE
|
hasRecursive = hasRecursive || with.Recursive |
|
cteExpr, cteCols := b.buildCTE(cte, outScope, with.Recursive) |
|
|
in pkg/sql/opt/optbuilder.(*Builder).buildCTEs
|
) *scope { |
|
inScope = b.buildCTEs(with, inScope) |
|
prevAtRoot := inScope.atRoot |
in pkg/sql/opt/optbuilder.(*Builder).processWiths
|
|
|
return b.processWiths(with, inScope, func(inScope *scope) *scope { |
|
return b.buildSelectStmtWithoutParens( |
in pkg/sql/opt/optbuilder.(*Builder).buildSelect
|
case *tree.Select: |
|
return b.buildSelect(stmt, noRowLocking, desiredTypes, inScope) |
|
|
in pkg/sql/opt/optbuilder.(*Builder).buildStmt
|
|
|
return b.buildStmt(stmt, desiredTypes, inScope) |
|
} |
in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot
|
// and physical properties. |
|
outScope := b.buildStmtAtRoot(b.stmt, nil /* desiredTypes */, b.allocScope()) |
|
|
in pkg/sql/opt/optbuilder.(*Builder).Build
|
bld := optbuilder.New(ctx, &p.semaCtx, p.EvalContext(), &opc.catalog, f, opc.p.stmt.AST) |
|
if err := bld.Build(); err != nil { |
|
return nil, err |
in pkg/sql.(*optPlanningCtx).buildExecMemo
|
|
|
execMemo, err := opc.buildExecMemo(ctx) |
|
if err != nil { |
in pkg/sql.(*planner).makeOptimizerPlan
|
|
|
if err := planner.makeOptimizerPlan(ctx); err != nil { |
|
log.VEventf(ctx, 1, "optimizer plan failed: %v", err) |
in pkg/sql.(*connExecutor).makeExecPlan
|
// between here and there needs to happen even if there's an error. |
|
err := ex.makeExecPlan(ctx, planner) |
|
// We'll be closing the plan manually below after execution; this |
in pkg/sql.(*connExecutor).dispatchToExecutionEngine
|
p.autoCommit = os.ImplicitTxn.Get() && !ex.server.cfg.TestingKnobs.DisableAutoCommit |
|
if err := ex.dispatchToExecutionEngine(ctx, p, res); err != nil { |
|
return nil, nil, err |
in pkg/sql.(*connExecutor).execStmtInOpenState
|
} else { |
|
ev, payload, err = ex.execStmtInOpenState(ctx, stmt, res, pinfo) |
|
} |
in pkg/sql.(*connExecutor).execStmt
|
stmtCtx := withStatement(ctx, ex.curStmt) |
|
ev, payload, err = ex.execStmt(stmtCtx, curStmt, stmtRes, nil /* pinfo */) |
|
if err != nil { |
in pkg/sql.(*connExecutor).execCmd
|
var err error |
|
if err = ex.execCmd(ex.Ctx()); err != nil { |
|
if err == io.EOF || err == errDrainingComplete { |
in pkg/sql.(*connExecutor).run
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).finalizeFromCardinality at line 2301
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).buildWithScan at line 2136
pkg/sql/opt/memo/logical_props_builder.go in pkg/sql/opt/memo.(*logicalPropsBuilder).buildWithScanProps at line 800
pkg/sql/opt/memo/expr.og.go in pkg/sql/opt/memo.(*Memo).MemoizeWithScan at line 16551
pkg/sql/opt/norm/factory.og.go in pkg/sql/opt/norm.(*Factory).ConstructWithScan at line 8536
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 96
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 63
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep at line 1095
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep at line 1102
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTables at line 1072
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFrom at line 999
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectClause at line 921
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens at line 869
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1 at line 842
pkg/sql/opt/optbuilder/with.go in pkg/sql/opt/optbuilder.(*Builder).processWiths at line 29
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect at line 841
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 253
pkg/sql/opt/optbuilder/with.go in pkg/sql/opt/optbuilder.(*Builder).buildCTE at line 158
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildCTEs at line 681
pkg/sql/opt/optbuilder/with.go in pkg/sql/opt/optbuilder.(*Builder).processWiths at line 26
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect at line 841
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 253
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot at line 217
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).Build at line 188
pkg/sql/plan_opt.go in pkg/sql.(*optPlanningCtx).buildExecMemo at line 433
pkg/sql/plan_opt.go in pkg/sql.(*planner).makeOptimizerPlan at line 169
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).makeExecPlan at line 801
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).dispatchToExecutionEngine at line 691
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmtInOpenState at line 481
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt at line 96
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd at line 1368
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 1297
| Tag |
Value |
| Cockroach Release |
v20.1.0-rc.2 |
| Cockroach SHA: |
c0f00d2 |
| Platform |
linux amd64 |
| Distribution |
CCL |
| Environment |
v20.1.0-rc.2 |
| Command |
server |
| Go Version |
go1.13.9 |
| # of CPUs |
8 |
| # of Goroutines |
197 |
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/1711322401/?referrer=webhooks_plugin
Panic message:
Stacktrace (expand for inline code snippets):
cockroach/pkg/sql/opt/memo/statistics_builder.go
Lines 2300 to 2302 in c0f00d2
cockroach/pkg/sql/opt/memo/statistics_builder.go
Lines 2135 to 2137 in c0f00d2
cockroach/pkg/sql/opt/memo/logical_props_builder.go
Lines 799 to 801 in c0f00d2
https://github.com/cockroachdb/cockroach/blob/c0f00d2a156295a1cb79ed960940c167cb03ccbc/pkg/sql/opt/memo/expr.og.go#L16550-L16552 in pkg/sql/opt/memo.(*Memo).MemoizeWithScan
https://github.com/cockroachdb/cockroach/blob/c0f00d2a156295a1cb79ed960940c167cb03ccbc/pkg/sql/opt/norm/factory.og.go#L8535-L8537 in pkg/sql/opt/norm.(*Factory).ConstructWithScan
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 95 to 97 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 62 to 64 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 1094 to 1096 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 1101 to 1103 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 1071 to 1073 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 998 to 1000 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 920 to 922 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 868 to 870 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 841 to 843 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/with.go
Lines 28 to 30 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 840 to 842 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/builder.go
Lines 252 to 254 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/with.go
Lines 157 to 159 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 680 to 682 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/with.go
Lines 25 to 27 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/select.go
Lines 840 to 842 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/builder.go
Lines 252 to 254 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/builder.go
Lines 216 to 218 in c0f00d2
cockroach/pkg/sql/opt/optbuilder/builder.go
Lines 187 to 189 in c0f00d2
cockroach/pkg/sql/plan_opt.go
Lines 432 to 434 in c0f00d2
cockroach/pkg/sql/plan_opt.go
Lines 168 to 170 in c0f00d2
cockroach/pkg/sql/conn_executor_exec.go
Lines 800 to 802 in c0f00d2
cockroach/pkg/sql/conn_executor_exec.go
Lines 690 to 692 in c0f00d2
cockroach/pkg/sql/conn_executor_exec.go
Lines 480 to 482 in c0f00d2
cockroach/pkg/sql/conn_executor_exec.go
Lines 95 to 97 in c0f00d2
cockroach/pkg/sql/conn_executor.go
Lines 1367 to 1369 in c0f00d2
cockroach/pkg/sql/conn_executor.go
Lines 1296 to 1298 in c0f00d2
v20.1.0-rc.2go1.13.9