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: leased_descriptors.go:169: log.Fatal: bad descriptor for T=1733576401.789523000,60102, expiration=1733570407.144156475,0 (1) attached stack trace -- stack trace: | github.com/cockroachdb/c... #136961

Closed
cockroach-sentry opened this issue Dec 7, 2024 · 2 comments · Fixed by #136978
Labels
branch-release-23.2 Used to mark GA and release blockers, technical advisories, and bugs for 23.2 branch-release-24.1 Used to mark GA and release blockers, technical advisories, and bugs for 24.1 branch-release-24.2 Used to mark GA and release blockers, technical advisories, and bugs for 24.2 branch-release-24.3 Used to mark GA and release blockers, technical advisories, and bugs for 24.3 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-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-blathers-triaged blathers was able to find an owner

Comments

@cockroach-sentry
Copy link
Collaborator

cockroach-sentry commented Dec 7, 2024

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

Panic Message:

leased_descriptors.go:169: log.Fatal: bad descriptor for T=1733576401.789523000,60102, expiration=1733570407.144156475,0
(1) attached stack trace
  -- stack trace:
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*leasedDescriptors).getResult
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/leased_descriptors.go:169
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*leasedDescriptors).getByName
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/leased_descriptors.go:108
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).getNonVirtualDescriptorID.func6
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:580
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).getNonVirtualDescriptorID
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:620
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.getDescriptorByName
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:398
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.ByNameGetter.Table
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/getters.go:301
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.PrefixAndTable
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/helpers.go:138
  | github.com/cockroachdb/cockroach/pkg/sql.(*schemaResolver).LookupObject
  | 	github.com/cockroachdb/cockroach/pkg/sql/schema_resolver.go:174
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/resolver.ResolveExisting
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/resolver/resolver.go:368
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/resolver.ResolveExistingObject
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/resolver/resolver.go:184
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/resolver.ResolveExistingTableObject
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/resolver/resolver.go:108
  | github.com/cockroachdb/cockroach/pkg/sql.(*optCatalog).ResolveDataSource
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt_catalog.go:260
  | github.com/cockroachdb/cockroach/pkg/sql/opt.(*Metadata).CheckDependencies
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/metadata.go:393
  | github.com/cockroachdb/cockroach/pkg/sql/opt/memo.(*Memo).IsStale
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/memo/memo.go:457
  | github.com/cockroachdb/cockroach/pkg/sql.(*optPlanningCtx).buildExecMemo
  | 	github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:832
  | github.com/cockroachdb/cockroach/pkg/sql.(*planner).makeOptimizerPlan
  | 	github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:251
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).makeExecPlan
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:2291
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).dispatchToExecutionEngine
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1841
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmtInOpenState
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1174
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt.func1
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:146
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execWithProfiling
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:3429
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:145
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd.func1
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:2316
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:2321
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).run
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:2238
  | github.com/cockroachdb/cockroach/pkg/sql.(*InternalExecutor).runWithEx.func2
  | 	github.com/cockroachdb/cockroach/pkg/sql/internal.go:254
  | github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2
  | 	github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:485
  | runtime.goexit
  | 	src/runtime/asm_amd64.s:1695
Wraps: (2) log.Fatal: bad descriptor for T=1733576401.789523000,60102, expiration=1733570407.144156475,0
Error types: (1) *withstack.withStack (2) *errutil.leafError
-- report composition:
*errutil.leafError: log.Fatal: bad descriptor for T=1733576401.789523000,60102, expiration=1733570407.144156475,0
leased_descriptors.go:169: *withstack.withStack (top exception)
Stacktrace (expand for inline code snippets):

src/runtime/asm_amd64.s#L1694-L1696

sp.UpdateGoroutineIDToCurrent()
f(ctx)
}()

}
if err := ex.run(
ctx,

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,

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

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

} else {
err = op(ctx)
}

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

} else {
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)
defer planner.curPlan.close(ctx)

if err := planner.makeOptimizerPlan(ctx); err != nil {
log.VEventf(ctx, 1, "optimizer plan failed: %v", err)

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

if ok {
if isStale, err := cachedData.Memo.IsStale(ctx, p.EvalContext(), opc.catalog); err != nil {
return nil, err

// access the object.
if depsUpToDate, err := m.Metadata().CheckDependencies(ctx, evalCtx, catalog); err != nil {
return true, err

tableName := name.ToTableName()
toCheck, _, err = optCatalog.ResolveDataSource(ctx, cat.Flags{}, &tableName)
if err != nil || !dataSource.Equals(toCheck) {

}
prefix, desc, err := resolver.ResolveExistingTableObject(ctx, oc.planner, &oc.tn, lflags)
if err != nil {

un := tn.ToUnresolvedObjectName()
desc, prefix, err := ResolveExistingObject(ctx, sc, un, lookupFlags)
if err != nil || desc == nil {

) (res catalog.Descriptor, _ catalog.ResolvedObjectPrefix, err error) {
found, prefix, obj, err := ResolveExisting(ctx, un, sc, lookupFlags, sc.CurrentDatabase(), sc.CurrentSearchPath())
if err != nil {

// No luck so far. Compatibility with CockroachDB v1.1: try D.public.T instead.
found, prefix, result, err = r.LookupObject(ctx, lookupFlags, u.Schema(), catconstants.PublicSchemaName, u.Object())
if found && err == nil {

case tree.TableObject:
prefix, desc, err = descs.PrefixAndTable(ctx, g, &tn)
case tree.TypeObject:

}
tbl, err := g.Table(ctx, p.Database, p.Schema, name.Object())
return p, tbl, err

) (catalog.TableDescriptor, error) {
desc, err := getDescriptorByName(
ctx, g.KV(), g.Descriptors(), db, sc, name, g.flags, catalog.Table,

}
id, err := tc.getNonVirtualDescriptorID(ctx, txn, db, sc, name, flags)
if err != nil || id == descpb.InvalidID {

} {
isDone, id, err := fn()
if err != nil {

}
ld, shouldReadFromStore, err := tc.leased.getByName(
ctx, tc.deadlineHolder(txn), parentID, parentSchemaID, name,

const setTxnDeadline = true
return ld.getResult(ctx, txn, setTxnDeadline, ldesc, err)
}

if expiration.LessEq(txn.ReadTimestamp()) {
log.Fatalf(ctx, "bad descriptor for T=%s, expiration=%s", readTimestamp, expiration)
}

src/runtime/asm_amd64.s in runtime.goexit at line 1695
pkg/util/stop/stopper.go in pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2 at line 485
pkg/sql/internal.go in pkg/sql.(*InternalExecutor).runWithEx.func2 at line 254
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 2238
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd at line 2321
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd.func1 at line 2316
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt at line 145
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execWithProfiling at line 3429
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt.func1 at line 146
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmtInOpenState at line 1174
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).dispatchToExecutionEngine at line 1841
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).makeExecPlan at line 2291
pkg/sql/plan_opt.go in pkg/sql.(*planner).makeOptimizerPlan at line 251
pkg/sql/plan_opt.go in pkg/sql.(*optPlanningCtx).buildExecMemo at line 832
pkg/sql/opt/memo/memo.go in pkg/sql/opt/memo.(*Memo).IsStale at line 457
pkg/sql/opt/metadata.go in pkg/sql/opt.(*Metadata).CheckDependencies at line 393
pkg/sql/opt_catalog.go in pkg/sql.(*optCatalog).ResolveDataSource at line 260
pkg/sql/catalog/resolver/resolver.go in pkg/sql/catalog/resolver.ResolveExistingTableObject at line 108
pkg/sql/catalog/resolver/resolver.go in pkg/sql/catalog/resolver.ResolveExistingObject at line 184
pkg/sql/catalog/resolver/resolver.go in pkg/sql/catalog/resolver.ResolveExisting at line 368
pkg/sql/schema_resolver.go in pkg/sql.(*schemaResolver).LookupObject at line 174
pkg/sql/catalog/descs/helpers.go in pkg/sql/catalog/descs.PrefixAndTable at line 138
pkg/sql/catalog/descs/getters.go in pkg/sql/catalog/descs.ByNameGetter.Table at line 301
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.getDescriptorByName at line 398
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).getNonVirtualDescriptorID at line 620
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).getNonVirtualDescriptorID.func6 at line 580
pkg/sql/catalog/descs/leased_descriptors.go in pkg/sql/catalog/descs.(*leasedDescriptors).getByName at line 108
pkg/sql/catalog/descs/leased_descriptors.go in pkg/sql/catalog/descs.(*leasedDescriptors).getResult at line 169

Tags

Tag Value
Command start-single-node
Environment v24.2.2
Go Version go1.22.5 X:nocoverageredesign
Platform darwin amd64
Distribution CCL
Cockroach Release v24.2.2
Cockroach SHA 8fb18e7
# of CPUs 12
# of Goroutines 465

Jira issue: CRDB-45319

@cockroach-sentry cockroach-sentry added branch-release-24.2 Used to mark GA and release blockers, technical advisories, and bugs for 24.2 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 Dec 7, 2024
Copy link

blathers-crl bot commented Dec 7, 2024

CC'ing via the CODEOWNERS-based sentry heuristic:

  • @cockroachdb/sql-foundations

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl blathers-crl bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-blathers-triaged blathers was able to find an owner labels Dec 7, 2024
@craig craig bot closed this as completed in 7f75f3e Dec 9, 2024
@craig craig bot closed this as completed in #136978 Dec 9, 2024
Copy link

blathers-crl bot commented Dec 9, 2024

Based on the specified backports for linked PR #136978, I applied the following new label(s) to this issue: branch-release-23.2, branch-release-24.1, branch-release-24.3. Please adjust the labels as needed to match the branches actually affected by this issue, including adding any known older branches.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl blathers-crl bot added branch-release-24.1 Used to mark GA and release blockers, technical advisories, and bugs for 24.1 branch-release-23.2 Used to mark GA and release blockers, technical advisories, and bugs for 23.2 branch-release-24.3 Used to mark GA and release blockers, technical advisories, and bugs for 24.3 labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-release-23.2 Used to mark GA and release blockers, technical advisories, and bugs for 23.2 branch-release-24.1 Used to mark GA and release blockers, technical advisories, and bugs for 24.1 branch-release-24.2 Used to mark GA and release blockers, technical advisories, and bugs for 24.2 branch-release-24.3 Used to mark GA and release blockers, technical advisories, and bugs for 24.3 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-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-blathers-triaged blathers was able to find an owner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant