-
Notifications
You must be signed in to change notification settings - Fork 4.1k
catalog/descs: v21.2.4: deadline below read timestamp is nonsensical #76727
Description
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/3023554730/?referrer=webhooks_plugin
Panic message:
txn.go:773: deadline below read timestamp is nonsensical; txn has would have no chance to commit. Deadline: 1645098134.258021630,0. Read timestamp: 1645099099.305391838,0 Previous Deadline: .
--
*errutil.leafError: deadline below read timestamp is nonsensical; txn has would have no chance to commit. Deadline: 1645098134.258021630,0. Read timestamp: 1645099099.305391838,0 Previous Deadline: . (1)
txn.go:773: *withstack.withStack (top exception)
*assert.withAssertionFailure
(check the extra data payloads)
Stacktrace (expand for inline code snippets):
Lines 772 to 774 in 0c8df44
| if deadline.Less(readTimestamp) { | |
| return errors.AssertionFailedf("deadline below read timestamp is nonsensical; "+ | |
| "txn has would have no chance to commit. Deadline: %s. Read timestamp: %s Previous Deadline: %s.", |
cockroach/pkg/sql/catalog/descs/leased_descriptors.go
Lines 216 to 218 in 0c8df44
| if !deadline.IsEmpty() { | |
| return txn.UpdateDeadline(ctx, deadline) | |
| } |
cockroach/pkg/sql/catalog/descs/leased_descriptors.go
Lines 182 to 184 in 0c8df44
| if setDeadline { | |
| if err := ld.maybeUpdateDeadline(ctx, txn, nil); err != nil { | |
| return nil, false, err |
cockroach/pkg/sql/catalog/descs/leased_descriptors.go
Lines 111 to 113 in 0c8df44
| const setTxnDeadline = true | |
| return ld.getResult(ctx, txn, setTxnDeadline, ldesc, err) | |
| } |
cockroach/pkg/sql/catalog/descs/descriptor.go
Lines 199 to 201 in 0c8df44
| var shouldReadFromStore bool | |
| desc, shouldReadFromStore, err = tc.leased.getByName(ctx, tc.deadlineHolder(txn), parentID, parentSchemaID, name) | |
| if err != nil { |
cockroach/pkg/sql/catalog/descs/object.go
Lines 167 to 169 in 0c8df44
| prefix.Schema = sc | |
| found, obj, err := tc.getByName( | |
| ctx, txn, db, sc, objectName, flags.AvoidCached, flags.RequireMutable, |
cockroach/pkg/sql/catalog/descs/object.go
Lines 60 to 62 in 0c8df44
| }() | |
| prefix, desc, err = tc.getObjectByNameIgnoringRequiredAndType( | |
| ctx, txn, catalogName, schemaName, objectName, flags, |
cockroach/pkg/sql/catalog/descs/object.go
Lines 35 to 37 in 0c8df44
| ) (prefix catalog.ResolvedObjectPrefix, desc catalog.Descriptor, err error) { | |
| return tc.getObjectByName(ctx, txn, db, schema, object, flags) | |
| } |
Lines 189 to 191 in 0c8df44
| prefix, objMeta, err = sc.GetObjectDesc(ctx, p.txn, dbName, scName, obName, flags) | |
| return objMeta != nil, prefix, objMeta, err |
cockroach/pkg/sql/catalog/resolver/resolver.go
Lines 394 to 396 in 0c8df44
| if isVirtualSchema || curDb != "" { | |
| if found, prefix, result, err = r.LookupObject( | |
| ctx, lookupFlags, curDb, u.Schema(), u.Object(), |
cockroach/pkg/sql/catalog/resolver/resolver.go
Lines 183 to 185 in 0c8df44
| ) (res catalog.Descriptor, _ catalog.ResolvedObjectPrefix, err error) { | |
| found, prefix, obj, err := ResolveExisting(ctx, un, sc, lookupFlags, sc.CurrentDatabase(), sc.CurrentSearchPath()) | |
| if err != nil { |
cockroach/pkg/sql/catalog/resolver/resolver.go
Lines 120 to 122 in 0c8df44
| un := tn.ToUnresolvedObjectName() | |
| desc, prefix, err := ResolveExistingObject(ctx, sc, un, lookupFlags) | |
| if err != nil || desc == nil { |
cockroach/pkg/sql/opt_catalog.go
Lines 205 to 207 in 0c8df44
| lflags := tree.ObjectLookupFlagsWithRequiredTableKind(tree.ResolveAnyTableKind) | |
| prefix, desc, err := resolver.ResolveExistingTableObject(ctx, oc.planner, &oc.tn, lflags) | |
| if err != nil { |
cockroach/pkg/sql/opt/optbuilder/util.go
Lines 603 to 605 in 0c8df44
| } | |
| ds, resName, err := b.catalog.ResolveDataSource(b.ctx, flags, tn) | |
| if err != nil { |
cockroach/pkg/sql/opt/optbuilder/util.go
Lines 568 to 570 in 0c8df44
| ) (cat.Table, tree.TableName) { | |
| ds, _, resName := b.resolveDataSource(tn, priv) | |
| tab, ok := ds.(cat.Table) |
cockroach/pkg/sql/opt/optbuilder/util.go
Lines 528 to 530 in 0c8df44
| case *tree.TableName: | |
| tab, alias = b.resolveTable(t, priv) | |
| depName = opt.DepByName(t) |
cockroach/pkg/sql/opt/optbuilder/insert.go
Lines 183 to 185 in 0c8df44
| // Find which table we're working on, check the permissions. | |
| tab, depName, alias, refColumns := b.resolveTableForMutation(ins.Table, privilege.INSERT) | |
cockroach/pkg/sql/opt/optbuilder/builder.go
Lines 292 to 294 in 0c8df44
| return b.processWiths(stmt.With, inScope, func(inScope *scope) *scope { | |
| return b.buildInsert(stmt, inScope) | |
| }) |
cockroach/pkg/sql/opt/optbuilder/with.go
Lines 110 to 112 in 0c8df44
| inScope.atRoot = false | |
| outScope := buildStmt(inScope) | |
| outScope.expr = b.buildWiths(outScope.expr, correlatedCTEs) |
cockroach/pkg/sql/opt/optbuilder/builder.go
Lines 291 to 293 in 0c8df44
| case *tree.Insert: | |
| return b.processWiths(stmt.With, inScope, func(inScope *scope) *scope { | |
| return b.buildInsert(stmt, inScope) |
cockroach/pkg/sql/opt/optbuilder/builder.go
Lines 240 to 242 in 0c8df44
| b.ctes = nil | |
| outScope = b.buildStmt(stmt, desiredTypes, inScope) | |
| // Build With operators for any CTEs hoisted to the top level. |
cockroach/pkg/sql/opt/optbuilder/builder.go
Lines 214 to 216 in 0c8df44
| // and physical properties. | |
| outScope := b.buildStmtAtRoot(b.stmt, nil /* desiredTypes */) | |
Lines 379 to 381 in 0c8df44
| bld.KeepPlaceholders = true | |
| if err := bld.Build(); err != nil { | |
| return nil, err |
Lines 122 to 124 in 0c8df44
| memo, err := opc.buildReusableMemo(ctx) | |
| if err != nil { |
cockroach/pkg/sql/conn_executor_prepare.go
Lines 286 to 288 in 0c8df44
| // future. | |
| flags, err := p.prepareUsingOptimizer(ctx) | |
| if err != nil { |
cockroach/pkg/sql/conn_executor_prepare.go
Lines 219 to 221 in 0c8df44
| p.semaCtx.Annotations = tree.MakeAnnotations(stmt.NumAnnotations) | |
| flags, err = ex.populatePrepared(ctx, txn, placeholderHints, p) | |
| return err |
Lines 835 to 837 in 0c8df44
| err := txn.exec(ctx, func(ctx context.Context, txn *Txn) error { | |
| return retryable(ctx, txn) | |
| }) |
Lines 907 to 909 in 0c8df44
| } | |
| err = fn(ctx, txn) | |
Lines 834 to 836 in 0c8df44
| func runTxn(ctx context.Context, txn *Txn, retryable func(context.Context, *Txn) error) error { | |
| err := txn.exec(ctx, func(ctx context.Context, txn *Txn) error { | |
| return retryable(ctx, txn) |
Lines 816 to 818 in 0c8df44
| txn.SetDebugName("unnamed") | |
| return runTxn(ctx, txn, retryable) | |
| } |
cockroach/pkg/sql/conn_executor_prepare.go
Lines 231 to 233 in 0c8df44
| // than bubbling them up to the connExecutor state machine. | |
| if err := ex.server.cfg.DB.Txn(ctx, prepare); err != nil { | |
| return nil, err |
cockroach/pkg/sql/conn_executor_prepare.go
Lines 110 to 112 in 0c8df44
| // Prepare the query. This completes the typing of placeholders. | |
| prepared, err := ex.prepare(ctx, stmt, placeholderHints, rawTypeHints, origin) | |
| if err != nil { |
pkg/kv/txn.go in pkg/kv.(*Txn).UpdateDeadline at line 773
pkg/sql/catalog/descs/leased_descriptors.go in pkg/sql/catalog/descs.(*leasedDescriptors).maybeUpdateDeadline at line 217
pkg/sql/catalog/descs/leased_descriptors.go in pkg/sql/catalog/descs.(*leasedDescriptors).getResult at line 183
pkg/sql/catalog/descs/leased_descriptors.go in pkg/sql/catalog/descs.(*leasedDescriptors).getByName at line 112
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).getByName at line 200
pkg/sql/catalog/descs/object.go in pkg/sql/catalog/descs.(*Collection).getObjectByNameIgnoringRequiredAndType at line 168
pkg/sql/catalog/descs/object.go in pkg/sql/catalog/descs.(*Collection).getObjectByName at line 61
pkg/sql/catalog/descs/object.go in pkg/sql/catalog/descs.(*Collection).GetObjectDesc at line 36
pkg/sql/resolver.go in pkg/sql.(*planner).LookupObject at line 190
pkg/sql/catalog/resolver/resolver.go in pkg/sql/catalog/resolver.ResolveExisting at line 395
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.ResolveExistingTableObject at line 121
pkg/sql/opt_catalog.go in pkg/sql.(*optCatalog).ResolveDataSource at line 206
pkg/sql/opt/optbuilder/util.go in pkg/sql/opt/optbuilder.(*Builder).resolveDataSource at line 604
pkg/sql/opt/optbuilder/util.go in pkg/sql/opt/optbuilder.(*Builder).resolveTable at line 569
pkg/sql/opt/optbuilder/util.go in pkg/sql/opt/optbuilder.(*Builder).resolveTableForMutation at line 529
pkg/sql/opt/optbuilder/insert.go in pkg/sql/opt/optbuilder.(*Builder).buildInsert at line 184
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt.func2 at line 293
pkg/sql/opt/optbuilder/with.go in pkg/sql/opt/optbuilder.(*Builder).processWiths at line 111
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 292
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot at line 241
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).Build at line 215
pkg/sql/plan_opt.go in pkg/sql.(*optPlanningCtx).buildReusableMemo at line 380
pkg/sql/plan_opt.go in pkg/sql.(*planner).prepareUsingOptimizer at line 123
pkg/sql/conn_executor_prepare.go in pkg/sql.(*connExecutor).populatePrepared at line 287
pkg/sql/conn_executor_prepare.go in pkg/sql.(*connExecutor).prepare.func1 at line 220
pkg/kv/db.go in pkg/kv.runTxn.func1 at line 836
pkg/kv/txn.go in pkg/kv.(*Txn).exec at line 908
pkg/kv/db.go in pkg/kv.runTxn at line 835
pkg/kv/db.go in pkg/kv.(*DB).Txn at line 817
pkg/sql/conn_executor_prepare.go in pkg/sql.(*connExecutor).prepare at line 232
pkg/sql/conn_executor_prepare.go in pkg/sql.(*connExecutor).addPreparedStmt at line 111
| Tag | Value |
|---|---|
| Cockroach Release | v21.2.4 |
| Cockroach SHA: | 0c8df44 |
| Platform | linux amd64 |
| Distribution | CCL |
| Environment | development |
| Command | server |
| Go Version | `` |
| # of CPUs | |
| # of Goroutines |
Jira issue: CRDB-13324