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

sql: v20.1.4: assertion failed: parentID does not exist #53351

Closed
cockroach-teamcity opened this issue Aug 24, 2020 · 2 comments
Closed

sql: v20.1.4: assertion failed: parentID does not exist #53351

cockroach-teamcity opened this issue Aug 24, 2020 · 2 comments
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

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

Panic message:

*errors.errorString
*safedetails.withSafeDetails: parentID %d does not exist (1)
structured.go:1582: *withstack.withStack (2)
*assert.withAssertionFailure
(check the extra data payloads)

Stacktrace (expand for inline code snippets):

if !res.Exists() {
return errors.AssertionFailedf("parentID %d does not exist", errors.Safe(desc.ParentID))
}
in pkg/sql/sqlbase.(*TableDescriptor).validateCrossReferences
}
return desc.validateCrossReferences(ctx, txn)
}
in pkg/sql/sqlbase.(*TableDescriptor).Validate
if err := table.Validate(ctx, txn); err != nil {
return err
in pkg/sql.getDescriptorByID
desc := &sqlbase.TableDescriptor{}
err = getDescriptorByID(ctx, txn, descID, desc)
if err != nil {
in pkg/sql.UncachedPhysicalAccessor.GetObjectDesc

cockroach/pkg/sql/table.go

Lines 236 to 238 in 12049d3

phyAccessor := UncachedPhysicalAccessor{}
obj, err := phyAccessor.GetObjectDesc(ctx, txn, tc.settings, tn, flags)
if obj == nil {
in pkg/sql.(*TableCollection).getMutableTableDescriptor
if flags.RequireMutable {
table, err := a.tc.getMutableTableDescriptor(ctx, txn, name, flags)
if table == nil {
in pkg/sql.(*CachedPhysicalAccessor).GetObjectDesc
// Fallthrough.
return l.SchemaAccessor.GetObjectDesc(ctx, txn, settings, name, flags)
}
in pkg/sql.(*LogicalSchemaAccessor).GetObjectDesc
lookupFlags.CommonLookupFlags = p.CommonLookupFlags(false /* required */)
objDesc, err := sc.GetObjectDesc(ctx, p.txn, p.ExecCfg().Settings, &p.tableName, lookupFlags)
return objDesc != nil, objDesc, err
in pkg/sql.(*planner).LookupObject
for i, tbName := range tbNames {
found, desc, err := p.LookupObject(
ctx,
in pkg/sql.(*planner).DropDatabase
case *tree.DropDatabase:
plan, err = p.DropDatabase(ctx, n)
case *tree.DropIndex:
in pkg/sql.buildOpaque
}
obj, cols, err := info.buildFn(b.ctx, b.semaCtx, b.evalCtx, stmt)
if err != nil {
in pkg/sql/opt/optbuilder.(*Builder).tryBuildOpaque
// See if we have an opaque handler registered for this statement type.
if outScope := b.tryBuildOpaque(stmt, inScope); outScope != nil {
// The opaque handler may resolve objects; we don't care about caching
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
}()
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#L1356-L1358 in runtime.goexit

pkg/sql/sqlbase/structured.go in pkg/sql/sqlbase.(*TableDescriptor).validateCrossReferences at line 1582
pkg/sql/sqlbase/structured.go in pkg/sql/sqlbase.(*TableDescriptor).Validate at line 1569
pkg/sql/descriptor.go in pkg/sql.getDescriptorByID at line 262
pkg/sql/physical_schema_accessors.go in pkg/sql.UncachedPhysicalAccessor.GetObjectDesc at line 215
pkg/sql/table.go in pkg/sql.(*TableCollection).getMutableTableDescriptor at line 237
pkg/sql/physical_schema_accessors.go in pkg/sql.(*CachedPhysicalAccessor).GetObjectDesc at line 302
pkg/sql/logical_schema_accessors.go in pkg/sql.(*LogicalSchemaAccessor).GetObjectDesc at line 100
pkg/sql/resolver.go in pkg/sql.(*planner).LookupObject at line 300
pkg/sql/drop_database.go in pkg/sql.(*planner).DropDatabase at line 107
pkg/sql/opaque.go in pkg/sql.buildOpaque at line 83
pkg/sql/opt/optbuilder/opaque.go in pkg/sql/opt/optbuilder.(*Builder).tryBuildOpaque at line 70
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 326
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 1392
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 1321
pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn at line 479
pkg/sql/pgwire/conn.go in pkg/sql/pgwire.(*conn).processCommandsAsync.func1 at line 582
/usr/local/go/src/runtime/asm_amd64.s in runtime.goexit at line 1357
Tag Value
Cockroach Release v20.1.4
Cockroach SHA: 12049d3
Platform linux amd64
Distribution CCL
Environment v20.1.4
Command server
Go Version go1.13.9
# of CPUs 4
# of Goroutines 564
@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 Aug 24, 2020
@yuzefovich yuzefovich changed the title sentry: *errors.errorString *safedetails.withSafeDetails: parentID %d does not exist (1) structured.go:1582: *withstack.withStack (2) *assert.withAssertionFailure (check the extra data payloads) sql: v20.1.4: assertion failed: parentID does not exist Aug 24, 2020
@yuzefovich
Copy link
Member

Seems like a dup of #52132 which was closed for being likely a duplicate of #50997 which was fixed on master and backport is included in 20.1.4. cc @lucy-zhang

@thoszhang
Copy link
Contributor

Closing as a dupe.

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