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: txn_coord_sender.go:1058: cannot set fixed timestamp, txn "sql txn" meta={id=7afcaaf3 key=/Min pri=0.00000391 epo=0 ts=1674692850.180401352,0 min=1674692850.180401352,0 seq=0} lock=false stat=PENDING ... #95892

Closed
cockroach-teamcity opened this issue Jan 26, 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-teamcity
Copy link
Member

cockroach-teamcity commented Jan 26, 2023

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

Panic message:

txn_coord_sender.go:1058: cannot set fixed timestamp, txn "sql txn" meta={id=7afcaaf3 key=/Min pri=0.00000391 epo=0 ts=1674692850.180401352,0 min=1674692850.180401352,0 seq=0} lock=false stat=PENDING rts=1674692850.180401352,0 wto=false gul=1674692850.680401352,0 already performed reads
(1) tags: [n6,client=10.102.2.131:33172,user=root]
Wraps: (2) assertion failure
Wraps: (3) attached stack trace
-- stack trace:
| github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord.(*TxnCoordSender).SetFixedTimestamp
| github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord/txn_coord_sender.go:1058
| github.com/cockroachdb/cockroach/pkg/kv.(*Txn).SetFixedTimestamp
| github.com/cockroachdb/cockroach/pkg/kv/txn.go:1446
| github.com/cockroachdb/cockroach/pkg/sql.(*txnState).setHistoricalTimestamp
| github.com/cockroachdb/cockroach/pkg/sql/txn_state.go:310
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).handleAOST
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:768
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmtInOpenState
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:611
| 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:2428
| 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:1933
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1937
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).run
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1859
| github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:832
| github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).processCommandsAsync.func1
| github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:728
| runtime.goexit
| GOROOT/src/runtime/asm_amd64.s:1594
Wraps: (4) cannot set fixed timestamp, txn "sql txn" meta={id=7afcaaf3 key=/Min pri=0.00000391 epo=0 ts=1674692850.180401352,0 min=1674692850.180401352,0 seq=0} lock=false stat=PENDING rts=1674692850.180401352,0 wto=false gul=1674692850.680401352,0 already performed reads
Error types: (1) *contexttags.withContext (2) *assert.withAssertionFailure (3) *withstack.withStack (4) *errutil.leafError
-- report composition:
*errutil.leafError: cannot set fixed timestamp, txn "sql txn" meta={id=7afcaaf3 key=/Min pri=0.00000391 epo=0 ts=1674692850.180401352,0 min=1674692850.180401352,0 seq=0} lock=false stat=PENDING rts=1674692850.180401352,0 wto=false gul=1674692850.680401352,0 already performed reads
txn_coord_sender.go:1058: *withstack.withStack (top exception)
*assert.withAssertionFailure
*contexttags.withContext: n6

Stacktrace (expand for inline code snippets):

if tc.hasPerformedReadsLocked() {
return errors.WithContextTags(errors.AssertionFailedf(
"cannot set fixed timestamp, txn %s already performed reads", tc.mu.txn), ctx)
in pkg/kv/kvclient/kvcoord.(*TxnCoordSender).SetFixedTimestamp

cockroach/pkg/kv/txn.go

Lines 1445 to 1447 in 81a114c

defer txn.mu.Unlock()
return txn.mu.sender.SetFixedTimestamp(ctx, ts)
}
in pkg/kv.(*Txn).SetFixedTimestamp
if err := ts.mu.txn.SetFixedTimestamp(ctx, historicalTimestamp); err != nil {
return err
in pkg/sql.(*txnState).setHistoricalTimestamp
p.extendedEvalCtx.SetTxnTimestamp(asOf.Timestamp.GoTime())
if err := ex.state.setHistoricalTimestamp(ctx, asOf.Timestamp); err != nil {
return err
in pkg/sql.(*connExecutor).handleAOST
if err := ex.handleAOST(ctx, ast); err != nil {
return makeErrEvent(err)
in pkg/sql.(*connExecutor).execStmtInOpenState
err = ex.execWithProfiling(ctx, ast, prepared, func(ctx context.Context) error {
ev, payload, err = ex.execStmtInOpenState(ctx, parserStmt, prepared, pinfo, res, canAutoCommit)
return err
in pkg/sql.(*connExecutor).execStmt.func1
} else {
err = op(ctx)
}
in pkg/sql.(*connExecutor).execWithProfiling
case stateOpen:
err = ex.execWithProfiling(ctx, ast, prepared, func(ctx context.Context) error {
ev, payload, err = ex.execStmtInOpenState(ctx, parserStmt, prepared, pinfo, res, canAutoCommit)
in pkg/sql.(*connExecutor).execStmt
canAutoCommit := ex.implicitTxn() && (tcmd.LastInBatch || !implicitTxnForBatch)
ev, payload, err = ex.execStmt(
ctx, tcmd.Statement, nil /* prepared */, nil /* pinfo */, stmtRes, canAutoCommit,
in pkg/sql.(*connExecutor).execCmd.func1
return err
}()
// Note: we write to ex.statsCollector.PhaseTimes, instead of ex.phaseTimes,
in pkg/sql.(*connExecutor).execCmd
var err error
if err = ex.execCmd(); err != nil {
if errors.IsAny(err, io.EOF, errDrainingComplete) {
in pkg/sql.(*connExecutor).run
}(ctx, h)
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
GOROOT/src/runtime/asm_amd64.s#L1593-L1595 in runtime.goexit

pkg/kv/kvclient/kvcoord/txn_coord_sender.go in pkg/kv/kvclient/kvcoord.(*TxnCoordSender).SetFixedTimestamp at line 1058
pkg/kv/txn.go in pkg/kv.(*Txn).SetFixedTimestamp at line 1446
pkg/sql/txn_state.go in pkg/sql.(*txnState).setHistoricalTimestamp at line 310
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).handleAOST at line 768
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmtInOpenState at line 611
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).execWithProfiling at line 2428
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt at line 130
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd.func1 at line 1933
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd at line 1937
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 1859
pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn at line 832
pkg/sql/pgwire/conn.go in pkg/sql/pgwire.(*conn).processCommandsAsync.func1 at line 728
GOROOT/src/runtime/asm_amd64.s in runtime.goexit at line 1594
Tag Value
Cockroach Release v22.2.3
Cockroach SHA: 81a114c
Platform linux amd64
Distribution CCL
Environment v22.2.3
Command server
Go Version ``
# of CPUs
# of Goroutines

Jira issue: CRDB-23796

@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 Jan 26, 2023
@yuzefovich
Copy link
Member

dup of #85066

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