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

colexec: incorrectly setting batch length before restoring the selection vector in CASE operator #67744

Closed
cockroach-teamcity opened this issue Jul 19, 2021 · 0 comments · Fixed by #67757
Assignees
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. T-sql-queries SQL Queries Team

Comments

@cockroach-teamcity
Copy link
Member

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

Panic message:

error.go:88: unexpected error from the vectorized engine: ×
--
*barriers.barrierError
*errutil.withPrefix: unexpected error from the vectorized engine (1)
error.go:88: *withstack.withStack (top exception)
*assert.withAssertionFailure
*colexecerror.notInternalError
(check the extra data payloads)

Stacktrace (expand for inline code snippets):

// unexpected.
retErr = errors.NewAssertionErrorWithWrappedErrf(err, "unexpected error from the vectorized engine")
}
in pkg/sql/colexecbase/colexecerror.CatchVectorizedRuntimeError.func1
/usr/local/go/src/runtime/panic.go#L678-L680 in runtime.gopanic
/usr/local/go/src/runtime/panic.go#L74-L76 in runtime.goPanicIndex
for j := 1; j <= n; j++ {
if b.offsets[j] > prev {
prev = b.offsets[j]
in pkg/col/coldata.(*Bytes).UpdateOffsetsToBeNonDecreasing
for _, bytesVecIdx := range m.bytesVecIdxs {
m.b[bytesVecIdx].Bytes().UpdateOffsetsToBeNonDecreasing(maxIdx + 1)
}
in pkg/col/coldata.(*MemBatch).SetLength
// Restore the original state of the buffered batch.
c.buffer.batch.SetLength(origLen)
c.buffer.batch.SetSelection(origHasSel)
in pkg/sql/colexec.(*caseOp).Next
func (e *BatchSchemaSubsetEnforcer) Next(ctx context.Context) coldata.Batch {
b := e.input.Next(ctx)
if b.Length() == 0 {
in pkg/sql/colexec.(*BatchSchemaSubsetEnforcer).Next
func (b *bufferOp) advance(ctx context.Context) {
b.batch = b.input.Next(ctx)
b.rewind()
in pkg/sql/colexec.(*bufferOp).advance
func (c *caseOp) Next(ctx context.Context) coldata.Batch {
c.buffer.advance(ctx)
origLen := c.buffer.batch.Length()
in pkg/sql/colexec.(*caseOp).Next
func (d *simpleProjectOp) Next(ctx context.Context) coldata.Batch {
batch := d.input.Next(ctx)
if batch.Length() == 0 {
in pkg/sql/colexec.(*simpleProjectOp).Next
}
op.bufferingState.pendingBatch, op.bufferingState.unprocessedIdx = op.input.Next(ctx), 0
n := op.bufferingState.pendingBatch.Length()
in pkg/sql/colexec.(*hashAggregator).Next
func (r *HashRouter) processNextBatch(ctx context.Context) bool {
b := r.input.Next(ctx)
n := b.Length()
in pkg/sql/colexec.(*HashRouter).processNextBatch
processNextBatch := func() {
done = r.processNextBatch(ctx)
}
in pkg/sql/colexec.(*HashRouter).Run.func1.1
}()
operation()
return retErr
in pkg/sql/colexecbase/colexecerror.CatchVectorizedRuntimeError
if err := colexecerror.CatchVectorizedRuntimeError(processNextBatch); err != nil {
r.cancelOutputs(ctx, err)
in pkg/sql/colexec.(*HashRouter).Run.func1
}()
operation()
return retErr
in pkg/sql/colexecbase/colexecerror.CatchVectorizedRuntimeError
// well for more fine-grained control of error propagation.
if err := colexecerror.CatchVectorizedRuntimeError(func() {
r.input.Init()
in pkg/sql/colexec.(*HashRouter).Run
runRouter := func(ctx context.Context, _ context.CancelFunc) {
router.Run(logtags.AddTag(ctx, "hashRouterID", strings.Join(streamIDs, ",")))
}
in pkg/sql/colflow.(*vectorizedFlowCreator).setupRouter.func1
go func() {
run(ctx, flowCtxCancel)
if wg != nil {
in pkg/sql/colflow.(*vectorizedFlowCreatorHelper).accumulateAsyncComponent.func1.1
/usr/local/go/src/runtime/asm_amd64.s#L1356-L1358 in runtime.goexit

pkg/sql/colexecbase/colexecerror/error.go in pkg/sql/colexecbase/colexecerror.CatchVectorizedRuntimeError.func1 at line 88
/usr/local/go/src/runtime/panic.go in runtime.gopanic at line 679
/usr/local/go/src/runtime/panic.go in runtime.goPanicIndex at line 75
pkg/col/coldata/bytes.go in pkg/col/coldata.(*Bytes).UpdateOffsetsToBeNonDecreasing at line 80
pkg/col/coldata/batch.go in pkg/col/coldata.(*MemBatch).SetLength at line 264
pkg/sql/colexec/case.go in pkg/sql/colexec.(*caseOp).Next at line 255
pkg/sql/colexec/operator.go in pkg/sql/colexec.(*BatchSchemaSubsetEnforcer).Next at line 458
pkg/sql/colexec/buffer.go in pkg/sql/colexec.(*bufferOp).advance at line 62
pkg/sql/colexec/case.go in pkg/sql/colexec.(*caseOp).Next at line 113
pkg/sql/colexec/simple_project.go in pkg/sql/colexec.(*simpleProjectOp).Next at line 124
pkg/sql/colexec/hash_aggregator.go in pkg/sql/colexec.(*hashAggregator).Next at line 222
pkg/sql/colexec/routers.go in pkg/sql/colexec.(*HashRouter).processNextBatch at line 724
pkg/sql/colexec/routers.go in pkg/sql/colexec.(*HashRouter).Run.func1.1 at line 659
pkg/sql/colexecbase/colexecerror/error.go in pkg/sql/colexecbase/colexecerror.CatchVectorizedRuntimeError at line 91
pkg/sql/colexec/routers.go in pkg/sql/colexec.(*HashRouter).Run.func1 at line 697
pkg/sql/colexecbase/colexecerror/error.go in pkg/sql/colexecbase/colexecerror.CatchVectorizedRuntimeError at line 91
pkg/sql/colexec/routers.go in pkg/sql/colexec.(*HashRouter).Run at line 655
pkg/sql/colflow/vectorized_flow.go in pkg/sql/colflow.(*vectorizedFlowCreator).setupRouter.func1 at line 659
pkg/sql/colflow/vectorized_flow.go in pkg/sql/colflow.(*vectorizedFlowCreatorHelper).accumulateAsyncComponent.func1.1 at line 1200
/usr/local/go/src/runtime/asm_amd64.s in runtime.goexit at line 1357
Tag Value
Cockroach Release v20.2.12
Cockroach SHA: 402d4f6
Platform linux amd64
Distribution CCL
Environment v20.2.12
Command server
Go Version ``
# of CPUs
# of Goroutines
@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 Jul 19, 2021
@yuzefovich yuzefovich changed the title sentry: error.go:88: unexpected error from the vectorized engine: × -- *barriers.barrierError *errutil.withPrefix: unexpected error from the vectorized engine (1) error.go:88: *withstack.withStack (top exception) *assert.withAssertionFailure *colexecerror.notInternalError (check the extra data payloads) colexec: incorrectly setting batch length before restoring the selection vector Jul 19, 2021
@yuzefovich yuzefovich self-assigned this Jul 19, 2021
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Jul 19, 2021
@yuzefovich yuzefovich changed the title colexec: incorrectly setting batch length before restoring the selection vector colexec: incorrectly setting batch length before restoring the selection vector in CASE operator Jul 19, 2021
@craig craig bot closed this as completed in 5da96b4 Jul 19, 2021
@mgartner mgartner moved this to Done in SQL Queries Jul 24, 2023
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. T-sql-queries SQL Queries Team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants