Skip to content
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: select_funcs.go:320: in-between filters didn't yield a constraint -- *errutil.leafError: in-between filters didn't yield a constraint (1) select_funcs.go:320: *withstack.withStack (top exception) *ass... #81014

Closed
cockroach-teamcity opened this issue May 4, 2022 · 1 comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report.

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented May 4, 2022

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/3249578698/?referrer=webhooks_plugin

Panic message:

select_funcs.go:320: in-between filters didn't yield a constraint
--
*errutil.leafError: in-between filters didn't yield a constraint (1)
select_funcs.go:320: *withstack.withStack (top exception)
*assert.withAssertionFailure
(check the extra data payloads)

Stacktrace (expand for inline code snippets):

if !ok {
panic(errors.AssertionFailedf("in-between filters didn't yield a constraint"))
}
in pkg/sql/opt/xform.(*CustomFuncs).GenerateConstrainedScans.func1
f(index, filters, indexCols, isCovering, constProj)
in pkg/sql/opt/xform.(*scanIndexIter).ForEachStartingAfter
func (it *scanIndexIter) ForEach(f enumerateIndexFunc) {
it.ForEachStartingAfter(cat.PrimaryIndex-1, f)
}
in pkg/sql/opt/xform.(*scanIndexIter).ForEach
iter.Init(c.e.evalCtx, c.e.f, c.e.mem, &c.im, scanPrivate, explicitFilters, rejectInvertedIndexes)
iter.ForEach(func(index cat.Index, filters memo.FiltersExpr, indexCols opt.ColSet, isCovering bool, constProj memo.ProjectionsExpr) {
// We only consider the partition values when a particular index can otherwise
in pkg/sql/opt/xform.(*CustomFuncs).GenerateConstrainedScans
https://github.com/cockroachdb/cockroach/blob/c7cfac57476f06e3154b2fc38e77982a8bbc64c2/pkg/sql/opt/xform/explorer.og.go#L182-L184 in pkg/sql/opt/xform.(*explorer).exploreSelect
https://github.com/cockroachdb/cockroach/blob/c7cfac57476f06e3154b2fc38e77982a8bbc64c2/pkg/sql/opt/xform/explorer.og.go#L19-L21 in pkg/sql/opt/xform.(*explorer).exploreGroupMember
if memberExplored := e.exploreGroupMember(state, member, i); memberExplored {
// No more rules can ever match this expression, so skip it in
in pkg/sql/opt/xform.(*explorer).exploreGroup
// other expressions in this group.
if o.shouldExplore(required) && !o.explorer.exploreGroup(grp).fullyExplored {
fullyOptimized = false
in pkg/sql/opt/xform.(*Optimizer).optimizeGroup
case memo.RelExpr:
state := o.optimizeGroup(t, required)
return state.cost, state.fullyOptimized
in pkg/sql/opt/xform.(*Optimizer).optimizeExpr
// Optimize the child with respect to those properties.
childCost, childOptimized := o.optimizeExpr(member.Child(i), childRequired)
in pkg/sql/opt/xform.(*Optimizer).optimizeGroupMember
// Optimize the group member with respect to the required properties.
memberOptimized := o.optimizeGroupMember(state, member, required)
in pkg/sql/opt/xform.(*Optimizer).optimizeGroup
// enforcer properties.
innerState := o.optimizeGroup(member, memberProps)
fullyOptimized = innerState.fullyOptimized
in pkg/sql/opt/xform.(*Optimizer).optimizeEnforcer
memberProps := BuildChildPhysicalProps(o.mem, enforcer, 0, required)
fullyOptimized = o.optimizeEnforcer(state, enforcer, required, member, memberProps)
in pkg/sql/opt/xform.(*Optimizer).enforceProps
// of requiring one of the merge join children to be sorted.
fullyOptimized = o.enforceProps(state, member, required)
in pkg/sql/opt/xform.(*Optimizer).optimizeGroupMember
// Optimize the group member with respect to the required properties.
memberOptimized := o.optimizeGroupMember(state, member, required)
in pkg/sql/opt/xform.(*Optimizer).optimizeGroup
rootProps := o.mem.RootProps()
o.optimizeGroup(root, rootProps)
in pkg/sql/opt/xform.(*Optimizer).Optimize
if _, isCanned := opc.p.stmt.AST.(*tree.CannedOptPlan); !isCanned {
if _, err := opc.optimizer.Optimize(); err != nil {
return nil, err
in pkg/sql.(*optPlanningCtx).buildExecMemo
execMemo, err := opc.buildExecMemo(ctx)
if err != nil {
in pkg/sql.(*planner).makeOptimizerPlan
func (ex *connExecutor) makeExecPlan(ctx context.Context, planner *planner) error {
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
if err := ex.dispatchToExecutionEngine(ctx, p, res); err != nil {
stmtThresholdSpan.Finish()
in pkg/sql.(*connExecutor).execStmtInOpenState
} else {
ev, payload, err = ex.execStmtInOpenState(ctx, parserStmt, prepared, pinfo, res)
}
in pkg/sql.(*connExecutor).execStmt
ev, payload, err = ex.execStmt(ctx, tcmd.Statement, nil /* prepared */, nil /* pinfo */, stmtRes)
return err
in pkg/sql.(*connExecutor).execCmd.func1
return err
}()
// Note: we write to ex.statsCollector.PhaseTimes, instead of ex.phaseTimes,
in pkg/sql.(*connExecutor).execCmd
var err error
if err = ex.execCmd(ex.Ctx()); err != nil {
if errors.IsAny(err, io.EOF, errDrainingComplete) {
in pkg/sql.(*connExecutor).run
}()
return h.ex.run(ctx, s.pool, reserved, cancel)
}
in pkg/sql.(*Server).ServeConn
reservedOwned = false // We're about to pass ownership away.
retErr = sqlServer.ServeConn(ctx, connHandler, reserved, cancelConn)
}()
in pkg/sql/pgwire.(*conn).processCommandsAsync.func1
/usr/local/go/src/runtime/asm_amd64.s#L1370-L1372 in runtime.goexit

pkg/sql/opt/xform/select_funcs.go in pkg/sql/opt/xform.(*CustomFuncs).GenerateConstrainedScans.func1 at line 320
pkg/sql/opt/xform/scan_index_iter.go in pkg/sql/opt/xform.(*scanIndexIter).ForEachStartingAfter at line 298
pkg/sql/opt/xform/scan_index_iter.go in pkg/sql/opt/xform.(*scanIndexIter).ForEach at line 209
pkg/sql/opt/xform/select_funcs.go in pkg/sql/opt/xform.(*CustomFuncs).GenerateConstrainedScans at line 230
pkg/sql/opt/xform/explorer.og.go in pkg/sql/opt/xform.(*explorer).exploreSelect at line 183
pkg/sql/opt/xform/explorer.og.go in pkg/sql/opt/xform.(*explorer).exploreGroupMember at line 20
pkg/sql/opt/xform/explorer.go in pkg/sql/opt/xform.(*explorer).exploreGroup at line 182
pkg/sql/opt/xform/optimizer.go in pkg/sql/opt/xform.(*Optimizer).optimizeGroup at line 468
pkg/sql/opt/xform/optimizer.go in pkg/sql/opt/xform.(*Optimizer).optimizeExpr at line 255
pkg/sql/opt/xform/optimizer.go in pkg/sql/opt/xform.(*Optimizer).optimizeGroupMember at line 510
pkg/sql/opt/xform/optimizer.go in pkg/sql/opt/xform.(*Optimizer).optimizeGroup at line 455
pkg/sql/opt/xform/optimizer.go in pkg/sql/opt/xform.(*Optimizer).optimizeEnforcer at line 620
pkg/sql/opt/xform/optimizer.go in pkg/sql/opt/xform.(*Optimizer).enforceProps at line 586
pkg/sql/opt/xform/optimizer.go in pkg/sql/opt/xform.(*Optimizer).optimizeGroupMember at line 495
pkg/sql/opt/xform/optimizer.go in pkg/sql/opt/xform.(*Optimizer).optimizeGroup at line 455
pkg/sql/opt/xform/optimizer.go in pkg/sql/opt/xform.(*Optimizer).Optimize at line 225
pkg/sql/plan_opt.go in pkg/sql.(*optPlanningCtx).buildExecMemo at line 525
pkg/sql/plan_opt.go in pkg/sql.(*planner).makeOptimizerPlan at line 194
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).makeExecPlan at line 1260
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).dispatchToExecutionEngine at line 972
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmtInOpenState at line 709
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt at line 129
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd.func1 at line 1705
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd at line 1707
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 1629
pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn at line 668
pkg/sql/pgwire/conn.go in pkg/sql/pgwire.(*conn).processCommandsAsync.func1 at line 648
/usr/local/go/src/runtime/asm_amd64.s in runtime.goexit at line 1371
Tag Value
Cockroach Release v21.2.6
Cockroach SHA: c7cfac5
Platform darwin amd64
Distribution CCL
Environment v21.2.6
Command demo
Go Version ``
# of CPUs
# of Goroutines

Jira issue: CRDB-15397

@cockroach-teamcity cockroach-teamcity added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report. labels May 4, 2022
@rytaft
Copy link
Collaborator

rytaft commented May 6, 2022

Dup of #80820

@rytaft rytaft closed this as completed May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report.
Projects
None yet
Development

No branches or pull requests

3 participants