Exception message : 40001

14 views
Skip to first unread message

Qbyte Consulting

unread,
Jan 18, 2021, 8:44:15 PMJan 18
to CockroachDB user group
Hi,

We have been trying to resolve this issue by reducing the number of database calls required for this transaction, and using select for update, now we have 2 calls and would like to reduce it to a single big SQL block.

The root of the problem is that numerous db clients are attempting to update the same rows at the same time to increment a counter column. However, we understood that using select for update should order the transactions. We also do calls to kafka after starting the transaction which add latency.

Any help much appreciated.

John

Exception message : 40001: restart transaction: TransactionRetryWithProtoRefreshError: TransactionAbortedError(ABORT_REASON_ABORT_SPAN): "sql txn" meta={id=b4bfd98e key=/Table/98/5/624582547018547201 pri=0.00550365 epo=0 ts=1610861196.560901215,1 min=1610861193.890266262,0 seq=12} lock=true stat=ABORTED rts=1610861194.963549468,2 wto=false max=1610861193.890266262,0
StackTrace :    at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
  at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
  at Npgsql.NpgsqlConnector.ExecuteInternalCommand(Byte[] data, Boolean async)
  at Npgsql.NpgsqlTransaction.Commit(Boolean async)
  at Npgsql.NpgsqlTransaction.Commit()

knz

unread,
Jan 19, 2021, 11:18:01 AMJan 19
to CockroachDB user group

Hi John,

this mailing list is closed since 2016. See the deprecation notice:


***** DEPRECATION NOTICE : AUGUST 12, 2016 *****


Looking for conversations about CockroachDB? You can find us over at the CockroachDB Forum. There you can find answers, ask questions, and help out fellow CockroachDB users.


Cheers,

The Cockroach Labs team


*****************************

Reply all
Reply to author
Forward
0 new messages