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: type_desc.go:701: building declarative schema change targets for DROP DATABASE: type × (223): referencing × 256 was dropped without dependency unlinking (1) attached stack trace -- stack t... #114163

Closed
cockroach-sentry opened this issue Nov 9, 2023 · 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-sentry
Copy link
Collaborator

cockroach-sentry commented Nov 9, 2023

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

Panic Message:

type_desc.go:701: building declarative schema change targets for DROP DATABASE: type × (223): referencing × 256 was dropped without dependency unlinking
(1) attached stack trace
  -- stack trace:
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scerrors.EventLogger.HandlePanicAndLogError
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scerrors/errors.go:81
  | runtime.gopanic
  | 	GOROOT/src/runtime/panic.go:884
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scdeps.(*buildDeps).MustReadDescriptor
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scdeps/build_deps.go:250
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild.(*builderState).readDescriptor
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/builder_state.go:1022
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild.(*builderState).ensureDescriptor
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/builder_state.go:930
  | github.com/cockroachdb/cockroach/pkg/sql/catalog.DescriptorIDSet.ForEach.func1
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descriptor_id_set.go:52
  | github.com/cockroachdb/cockroach/pkg/util.FastIntSet.ForEach
  | 	github.com/cockroachdb/cockroach/pkg/util/pkg/util/fast_int_set.go:216
  | github.com/cockroachdb/cockroach/pkg/sql/catalog.DescriptorIDSet.ForEach
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descriptor_id_set.go:52
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild.(*builderState).BackReferences
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/builder_state.go:578
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt.undroppedBackrefs
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/helpers.go:233
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt.DropDatabase
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_database.go:57
  | reflect.Value.call
  | 	GOROOT/src/reflect/value.go:584
  | reflect.Value.Call
  | 	GOROOT/src/reflect/value.go:368
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt.Process
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go:169
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild.Build
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/build.go:61
  | github.com/cockroachdb/cockroach/pkg/sql.(*planner).SchemaChange
  | 	github.com/cockroachdb/cockroach/pkg/sql/schema_change_plan_node.go:81
  | github.com/cockroachdb/cockroach/pkg/sql.buildOpaque
  | 	github.com/cockroachdb/cockroach/pkg/sql/opaque.go:56
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).tryBuildOpaque
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/opaque.go:70
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmt
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:421
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:256
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).Build
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:230
  | github.com/cockroachdb/cockroach/pkg/sql.(*optPlanningCtx).buildExecMemo
  | 	github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:561
  | github.com/cockroachdb/cockroach/pkg/sql.(*planner).makeOptimizerPlan
  | 	github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:232
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).makeExecPlan
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1475
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).dispatchToExecutionEngine
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1086
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmtInOpenState
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:694
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt.func1
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:131
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execWithProfiling
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:2440
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:130
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd.func1
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:2129
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:2133
Wraps: (2) building declarative schema change targets for DROP DATABASE
Wraps: (3) keys: [sql.schema.validation_errors.read.backward_references.type]
Wraps: (4) keys: [sql.schema.validation_errors.read.backward_references.type]
Wraps: (5) attached stack trace
  -- stack trace:
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).decorate
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:253
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).Report
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:177
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/typedesc.(*immutable).ValidateBackReferences
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/typedesc/type_desc.go:701
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.Validate.func3
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:105
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).validateDescriptorsAtLevel
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:193
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.Validate
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:100
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).Validate
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/validate.go:36
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).finalizeDescriptors
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:566
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.getDescriptorsByID
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:203
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).getDescriptorByID
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:88
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).GetImmutableDescriptorByID
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:77
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.makeImmutableTypeLookupFunc.func1
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/hydrate.go:151
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/hydrateddesc.MakeTypeLookupFuncForHydration.func1
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/hydrateddesc/hydrate.go:74
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/typedesc.TypeLookupFunc.GetTypeDescriptor
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/typedesc/type_desc.go:797
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/typedesc.EnsureTypeIsHydrated
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/typedesc/type_desc.go:840
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/typedesc.HydrateTypesInTableDescriptor
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/typedesc/type_desc.go:854
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/hydrateddesc.Hydrate
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/hydrateddesc/hydrate.go:53
  | github.com/cockroachdb/cockroach/pkg/sql/cata...
Stacktrace (expand for inline code snippets):

var err error
if err = ex.execCmd(); err != nil {
// Both of these errors are normal ways for the connExecutor to exit.

return err
}()
// Note: we write to ex.statsCollector.PhaseTimes, instead of ex.phaseTimes,

canAutoCommit := ex.implicitTxn() && (tcmd.LastInBatch || !implicitTxnForBatch)
ev, payload, err = ex.execStmt(
ctx, tcmd.Statement, nil /* prepared */, nil /* pinfo */, stmtRes, canAutoCommit,

case stateOpen:
err = ex.execWithProfiling(ctx, ast, prepared, func(ctx context.Context) error {
ev, payload, err = ex.execStmtInOpenState(ctx, parserStmt, prepared, pinfo, res, canAutoCommit)

} else {
err = op(ctx)
}

err = ex.execWithProfiling(ctx, ast, prepared, func(ctx context.Context) error {
ev, payload, err = ex.execStmtInOpenState(ctx, parserStmt, prepared, pinfo, res, canAutoCommit)
return err

if err := ex.dispatchToExecutionEngine(stmtCtx, p, res); err != nil {
stmtThresholdSpan.Finish()

// 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

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)

execMemo, err := opc.buildExecMemo(ctx)
if err != nil {

bld := optbuilder.New(ctx, &p.semaCtx, p.EvalContext(), &opc.catalog, f, opc.p.stmt.AST)
if err := bld.Build(); err != nil {
return nil, err

// and physical properties.
outScope := b.buildStmtAtRoot(b.stmt, nil /* desiredTypes */)

b.ctes = nil
outScope = b.buildStmt(stmt, desiredTypes, inScope)
// Build With operators for any CTEs hoisted to the top level.

// 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

}
obj, err := info.buildFn(b.ctx, b.semaCtx, b.evalCtx, stmt)
if err != nil {

var err error
plan, err = p.SchemaChange(ctx, stmt)
if err != nil {

)
state, err := scbuild.Build(ctx, deps, scs.state, stmt)
if scerrors.HasNotImplemented(err) &&

}
scbuildstmt.Process(b, an.GetStatement())
an.ValidateAnnotations()


GOROOT/src/reflect/value.go#L367-L369
GOROOT/src/reflect/value.go#L583-L585
dbBackrefs := undroppedBackrefs(b, db.DatabaseID)
publicSchemaBackrefs := undroppedBackrefs(b, publicSchemaID)
if dbBackrefs.IsEmpty() && publicSchemaBackrefs.IsEmpty() {

func undroppedBackrefs(b BuildCtx, id catid.DescID) ElementResultSet {
return b.BackReferences(id).Filter(func(_ scpb.Status, target scpb.TargetStatus, e scpb.Element) bool {
return target != scpb.ToAbsent && screl.ContainsDescID(e, id)

c.backrefs.ForEach(ids.Add)
c.backrefs.ForEach(b.ensureDescriptor)
for i := range b.output {

func (d DescriptorIDSet) ForEach(f func(id descpb.ID)) {
d.set.ForEach(func(i int) { f(descpb.ID(i)) })
}

https://github.com/cockroachdb/cockroach/blob/af6752b2faf39115fd322e9db76421e71b76507d/pkg/util/pkg/util/fast_int_set.go#L215-L217
func (d DescriptorIDSet) ForEach(f func(id descpb.ID)) {
d.set.ForEach(func(i int) { f(descpb.ID(i)) })
}

c := &cachedDesc{
desc: b.readDescriptor(id),
privileges: make(map[privilege.Kind]error),

}
return b.cr.MustReadDescriptor(b.ctx, id)
}

if err != nil {
panic(err)
}

GOROOT/src/runtime/panic.go#L883-L885
case errors.HasAssertionFailure(*err):
*err = errors.Wrapf(*err, "%s", el.msg)
fallthrough

GOROOT/src/reflect/value.go#L367-L369
GOROOT/src/reflect/value.go#L583-L585
dbBackrefs := undroppedBackrefs(b, db.DatabaseID)
publicSchemaBackrefs := undroppedBackrefs(b, publicSchemaID)
if dbBackrefs.IsEmpty() && publicSchemaBackrefs.IsEmpty() {

func undroppedBackrefs(b BuildCtx, id catid.DescID) ElementResultSet {
return b.BackReferences(id).Filter(func(_ scpb.Status, target scpb.TargetStatus, e scpb.Element) bool {
return target != scpb.ToAbsent && screl.ContainsDescID(e, id)

c.backrefs.ForEach(ids.Add)
c.backrefs.ForEach(b.ensureDescriptor)
for i := range b.output {

func (d DescriptorIDSet) ForEach(f func(id descpb.ID)) {
d.set.ForEach(func(i int) { f(descpb.ID(i)) })
}

https://github.com/cockroachdb/cockroach/blob/af6752b2faf39115fd322e9db76421e71b76507d/pkg/util/pkg/util/fast_int_set.go#L215-L217
func (d DescriptorIDSet) ForEach(f func(id descpb.ID)) {
d.set.ForEach(func(i int) { f(descpb.ID(i)) })
}

c := &cachedDesc{
desc: b.readDescriptor(id),
privileges: make(map[privilege.Kind]error),

}
return b.cr.MustReadDescriptor(b.ctx, id)
}

}
desc, err := d.descsCollection.GetImmutableDescriptorByID(ctx, d.txn, id, flags)
if err != nil {

flags.RequireMutable = false
return tc.getDescriptorByID(ctx, txn, flags, id)
}

var arr [1]catalog.Descriptor
if err := getDescriptorsByID(
ctx, tc, txn, flags, arr[:], ids...,

// Hydration is skipped if "SkipHydration" flag is true.
if err := tc.hydrateDescriptors(ctx, txn, flags, descs); err != nil {
return err

desc = desc.NewBuilder().BuildImmutable()
if err := hydrateddesc.Hydrate(ctx, desc, typeFn); err != nil {
return err

case catalog.TableDescriptor:
return typedesc.HydrateTypesInTableDescriptor(ctx, t.TableDesc(), typeLookupFunc)
case catalog.SchemaDescriptor:

for i := range desc.Columns {
if err := EnsureTypeIsHydrated(ctx, desc.Columns[i].Type, res); err != nil {
return err

}
elemTypName, elemTypDesc, err := res.GetTypeDescriptor(ctx, id)
if err != nil {

) (tree.TypeName, catalog.TypeDescriptor, error) {
return t(ctx, id)
}

if typDesc == nil {
typDesc, err = lookupFn(ctx, id, false /* skipHydration */)
if err != nil {

immutableLookupFunc := func(ctx context.Context, id descpb.ID, skipHydration bool) (catalog.Descriptor, error) {
return tc.GetImmutableDescriptorByID(ctx, txn, id, tree.CommonLookupFlags{
Required: true,

flags.RequireMutable = false
return tc.getDescriptorByID(ctx, txn, flags, id)
}

var arr [1]catalog.Descriptor
if err := getDescriptorsByID(
ctx, tc, txn, flags, arr[:], ids...,

// At this point, all descriptors are in the slice, finalize and hydrate them.
if err := tc.finalizeDescriptors(ctx, txn, flags, descs, vls); err != nil {
return err

if len(toValidate) > 0 {
if err := tc.Validate(ctx, txn, catalog.ValidationReadTelemetry, requiredLevel, toValidate...); err != nil {
return err

version := tc.settings.Version.ActiveVersion(ctx)
return validate.Validate(
ctx,

// Descriptor backward-reference checks.
if !vea.validateDescriptorsAtLevel(
catalog.ValidationLevelBackReferences,

vea.currentDescriptor = desc
validationFn(desc)
}

if !desc.Dropped() {
desc.ValidateBackReferences(&vea, vdg)
}

if depDesc.Dropped() {
vea.Report(errors.AssertionFailedf(
"referencing %s %d was dropped without dependency unlinking", depDesc.DescriptorType(), id))

}
vea.errors = append(vea.errors, vea.decorate(err))
}

case catalog.Type:
err = errors.Wrapf(err, string(catalog.Type)+" %q (%d)", name, id)
case catalog.Function:

}
scbuildstmt.Process(b, an.GetStatement())
an.ValidateAnnotations()


GOROOT/src/reflect/value.go#L367-L369
GOROOT/src/reflect/value.go#L583-L585
dbBackrefs := undroppedBackrefs(b, db.DatabaseID)
publicSchemaBackrefs := undroppedBackrefs(b, publicSchemaID)
if dbBackrefs.IsEmpty() && publicSchemaBackrefs.IsEmpty() {

func undroppedBackrefs(b BuildCtx, id catid.DescID) ElementResultSet {
return b.BackReferences(id).Filter(func(_ scpb.Status, target scpb.TargetStatus, e scpb.Element) bool {
return target != scpb.ToAbsent && screl.ContainsDescID(e, id)

c.backrefs.ForEach(ids.Add)
c.backrefs.ForEach(b.ensureDescriptor)
for i := range b.output {

func (d DescriptorIDSet) ForEach(f func(id descpb.ID)) {
d.set.ForEach(func(i int) { f(descpb.ID(i)) })
}

https://github.com/cockroachdb/cockroach/blob/af6752b2faf39115fd322e9db76421e71b76507d/pkg/util/pkg/util/fast_int_set.go#L215-L217
func (d DescriptorIDSet) ForEach(f func(id descpb.ID)) {
d.set.ForEach(func(i int) { f(descpb.ID(i)) })
}

c := &cachedDesc{
desc: b.readDescriptor(id),
privileges: make(map[privilege.Kind]error),

}
return b.cr.MustReadDescriptor(b.ctx, id)
}

}
desc, err := d.descsCollection.GetImmutableDescriptorByID(ctx, d.txn, id, flags)
if err != nil {

flags.RequireMutable = false
return tc.getDescriptorByID(ctx, txn, flags, id)
}

var arr [1]catalog.Descriptor
if err := getDescriptorsByID(
ctx, tc, txn, flags, arr[:], ids...,

// Hydration is skipped if "SkipHydration" flag is true.
if err := tc.hydrateDescriptors(ctx, txn, flags, descs); err != nil {
return err

desc = desc.NewBuilder().BuildImmutable()
if err := hydrateddesc.Hydrate(ctx, desc, typeFn); err != nil {
return err

case catalog.TableDescriptor:
return typedesc.HydrateTypesInTableDescriptor(ctx, t.TableDesc(), typeLookupFunc)
case catalog.SchemaDescriptor:

for i := range desc.Columns {
if err := EnsureTypeIsHydrated(ctx, desc.Columns[i].Type, res); err != nil {
return err

}
elemTypName, elemTypDesc, err := res.GetTypeDescriptor(ctx, id)
if err != nil {

) (tree.TypeName, catalog.TypeDescriptor, error) {
return t(ctx, id)
}

if typDesc == nil {
typDesc, err = lookupFn(ctx, id, false /* skipHydration */)
if err != nil {

immutableLookupFunc := func(ctx context.Context, id descpb.ID, skipHydration bool) (catalog.Descriptor, error) {
return tc.GetImmutableDescriptorByID(ctx, txn, id, tree.CommonLookupFlags{
Required: true,

flags.RequireMutable = false
return tc.getDescriptorByID(ctx, txn, flags, id)
}

var arr [1]catalog.Descriptor
if err := getDescriptorsByID(
ctx, tc, txn, flags, arr[:], ids...,

// At this point, all descriptors are in the slice, finalize and hydrate them.
if err := tc.finalizeDescriptors(ctx, txn, flags, descs, vls); err != nil {
return err

if len(toValidate) > 0 {
if err := tc.Validate(ctx, txn, catalog.ValidationReadTelemetry, requiredLevel, toValidate...); err != nil {
return err

version := tc.settings.Version.ActiveVersion(ctx)
return validate.Validate(
ctx,

// Descriptor backward-reference checks.
if !vea.validateDescriptorsAtLevel(
catalog.ValidationLevelBackReferences,

vea.currentDescriptor = desc
validationFn(desc)
}

if !desc.Dropped() {
desc.ValidateBackReferences(&vea, vdg)
}

if depDesc.Dropped() {
vea.Report(errors.AssertionFailedf(
"referencing %s %d was dropped without dependency unlinking", depDesc.DescriptorType(), id))

pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 2054
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd at line 2133
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd.func1 at line 2129
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt at line 130
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execWithProfiling at line 2440
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt.func1 at line 131
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmtInOpenState at line 694
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).dispatchToExecutionEngine at line 1086
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).makeExecPlan at line 1475
pkg/sql/plan_opt.go in pkg/sql.(*planner).makeOptimizerPlan at line 232
pkg/sql/plan_opt.go in pkg/sql.(*optPlanningCtx).buildExecMemo at line 561
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).Build at line 230
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot at line 256
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 421
pkg/sql/opt/optbuilder/opaque.go in pkg/sql/opt/optbuilder.(*Builder).tryBuildOpaque at line 70
pkg/sql/opaque.go in pkg/sql.buildOpaque at line 56
pkg/sql/schema_change_plan_node.go in pkg/sql.(*planner).SchemaChange at line 81
pkg/sql/schemachanger/scbuild/build.go in pkg/sql/schemachanger/scbuild.Build at line 61
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.Process at line 169
GOROOT/src/reflect/value.go in reflect.Value.Call at line 368
GOROOT/src/reflect/value.go in reflect.Value.call at line 584
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_database.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.DropDatabase at line 57
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/helpers.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.undroppedBackrefs at line 233
pkg/sql/schemachanger/scbuild/builder_state.go in pkg/sql/schemachanger/scbuild.(*builderState).BackReferences at line 578
pkg/sql/catalog/descriptor_id_set.go in pkg/sql/catalog.DescriptorIDSet.ForEach at line 52
pkg/util/pkg/util/fast_int_set.go in pkg/util.FastIntSet.ForEach at line 216
pkg/sql/catalog/descriptor_id_set.go in pkg/sql/catalog.DescriptorIDSet.ForEach.func1 at line 52
pkg/sql/schemachanger/scbuild/builder_state.go in pkg/sql/schemachanger/scbuild.(*builderState).ensureDescriptor at line 930
pkg/sql/schemachanger/scbuild/builder_state.go in pkg/sql/schemachanger/scbuild.(*builderState).readDescriptor at line 1022
pkg/sql/schemachanger/scdeps/build_deps.go in pkg/sql/schemachanger/scdeps.(*buildDeps).MustReadDescriptor at line 250
GOROOT/src/runtime/panic.go in runtime.gopanic at line 884
pkg/sql/schemachanger/scerrors/errors.go in pkg/sql/schemachanger/scerrors.EventLogger.HandlePanicAndLogError at line 81
GOROOT/src/reflect/value.go in reflect.Value.Call at line 368
GOROOT/src/reflect/value.go in reflect.Value.call at line 584
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_database.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.DropDatabase at line 57
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/helpers.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.undroppedBackrefs at line 233
pkg/sql/schemachanger/scbuild/builder_state.go in pkg/sql/schemachanger/scbuild.(*builderState).BackReferences at line 578
pkg/sql/catalog/descriptor_id_set.go in pkg/sql/catalog.DescriptorIDSet.ForEach at line 52
pkg/util/pkg/util/fast_int_set.go in pkg/util.FastIntSet.ForEach at line 216
pkg/sql/catalog/descriptor_id_set.go in pkg/sql/catalog.DescriptorIDSet.ForEach.func1 at line 52
pkg/sql/schemachanger/scbuild/builder_state.go in pkg/sql/schemachanger/scbuild.(*builderState).ensureDescriptor at line 930
pkg/sql/schemachanger/scbuild/builder_state.go in pkg/sql/schemachanger/scbuild.(*builderState).readDescriptor at line 1022
pkg/sql/schemachanger/scdeps/build_deps.go in pkg/sql/schemachanger/scdeps.(*buildDeps).MustReadDescriptor at line 248
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).GetImmutableDescriptorByID at line 77
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).getDescriptorByID at line 88
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.getDescriptorsByID at line 207
pkg/sql/catalog/descs/hydrate.go in pkg/sql/catalog/descs.(*Collection).hydrateDescriptors at line 102
pkg/sql/catalog/hydrateddesc/hydrate.go in pkg/sql/catalog/hydrateddesc.Hydrate at line 53
pkg/sql/catalog/typedesc/type_desc.go in pkg/sql/catalog/typedesc.HydrateTypesInTableDescriptor at line 854
pkg/sql/catalog/typedesc/type_desc.go in pkg/sql/catalog/typedesc.EnsureTypeIsHydrated at line 840
pkg/sql/catalog/typedesc/type_desc.go in pkg/sql/catalog/typedesc.TypeLookupFunc.GetTypeDescriptor at line 797
pkg/sql/catalog/hydrateddesc/hydrate.go in pkg/sql/catalog/hydrateddesc.MakeTypeLookupFuncForHydration.func1 at line 74
pkg/sql/catalog/descs/hydrate.go in pkg/sql/catalog/descs.makeImmutableTypeLookupFunc.func1 at line 151
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).GetImmutableDescriptorByID at line 77
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).getDescriptorByID at line 88
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.getDescriptorsByID at line 203
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).finalizeDescriptors at line 566
pkg/sql/catalog/descs/validate.go in pkg/sql/catalog/descs.(*Collection).Validate at line 36
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.Validate at line 100
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).validateDescriptorsAtLevel at line 193
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.Validate.func3 at line 105
pkg/sql/catalog/typedesc/type_desc.go in pkg/sql/catalog/typedesc.(*immutable).ValidateBackReferences at line 701
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).Report at line 177
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).decorate at line 253
pkg/sql/schemachanger/scbuild/build.go in pkg/sql/schemachanger/scbuild.Build at line 61
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.Process at line 169
GOROOT/src/reflect/value.go in reflect.Value.Call at line 368
GOROOT/src/reflect/value.go in reflect.Value.call at line 584
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_database.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.DropDatabase at line 57
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/helpers.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.undroppedBackrefs at line 233
pkg/sql/schemachanger/scbuild/builder_state.go in pkg/sql/schemachanger/scbuild.(*builderState).BackReferences at line 578
pkg/sql/catalog/descriptor_id_set.go in pkg/sql/catalog.DescriptorIDSet.ForEach at line 52
pkg/util/pkg/util/fast_int_set.go in pkg/util.FastIntSet.ForEach at line 216
pkg/sql/catalog/descriptor_id_set.go in pkg/sql/catalog.DescriptorIDSet.ForEach.func1 at line 52
pkg/sql/schemachanger/scbuild/builder_state.go in pkg/sql/schemachanger/scbuild.(*builderState).ensureDescriptor at line 930
pkg/sql/schemachanger/scbuild/builder_state.go in pkg/sql/schemachanger/scbuild.(*builderState).readDescriptor at line 1022
pkg/sql/schemachanger/scdeps/build_deps.go in pkg/sql/schemachanger/scdeps.(*buildDeps).MustReadDescriptor at line 248
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).GetImmutableDescriptorByID at line 77
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).getDescriptorByID at line 88
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.getDescriptorsByID at line 207
pkg/sql/catalog/descs/hydrate.go in pkg/sql/catalog/descs.(*Collection).hydrateDescriptors at line 102
pkg/sql/catalog/hydrateddesc/hydrate.go in pkg/sql/catalog/hydrateddesc.Hydrate at line 53
pkg/sql/catalog/typedesc/type_desc.go in pkg/sql/catalog/typedesc.HydrateTypesInTableDescriptor at line 854
pkg/sql/catalog/typedesc/type_desc.go in pkg/sql/catalog/typedesc.EnsureTypeIsHydrated at line 840
pkg/sql/catalog/typedesc/type_desc.go in pkg/sql/catalog/typedesc.TypeLookupFunc.GetTypeDescriptor at line 797
pkg/sql/catalog/hydrateddesc/hydrate.go in pkg/sql/catalog/hydrateddesc.MakeTypeLookupFuncForHydration.func1 at line 74
pkg/sql/catalog/descs/hydrate.go in pkg/sql/catalog/descs.makeImmutableTypeLookupFunc.func1 at line 151
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).GetImmutableDescriptorByID at line 77
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).getDescriptorByID at line 88
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.getDescriptorsByID at line 203
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).finalizeDescriptors at line 566
pkg/sql/catalog/descs/validate.go in pkg/sql/catalog/descs.(*Collection).Validate at line 36
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.Validate at line 100
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).validateDescriptorsAtLevel at line 193
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.Validate.func3 at line 105
pkg/sql/catalog/typedesc/type_desc.go in pkg/sql/catalog/typedesc.(*immutable).ValidateBackReferences at line 701

Tags

Tag Value
Command server
Environment v22.2.14
Go Version go1.19.6
Platform linux amd64
Distribution CCL
Cockroach Release v22.2.14
Cockroach SHA af6752b
# of CPUs 8
# of Goroutines 564

Jira issue: CRDB-33374

@cockroach-sentry cockroach-sentry added O-sentry Originated from an in-the-wild panic report. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. labels Nov 9, 2023
@yuzefovich
Copy link
Member

dup of #91645

@exalate-issue-sync exalate-issue-sync bot changed the title Sentry: type_desc.go:701: building declarative schema change targets for DROP DATABASE: type × (223): referencing × 256 was dropped without dependency unlinking (1) attached stack trace -- stack t... Sentry: type_desc.go:701: building declarative schema change targets for DROP DATABASE: type × (223): referencing × 256 was dropped without dependency unlinking (1) attached stack trace -- stack t... Nov 12, 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.
Projects
None yet
Development

No branches or pull requests

2 participants