Details
-
Bug Report
-
Resolution: Unresolved
-
L3 - Default
-
None
-
7.14.0
-
None
Description
// Given
Two process instances in the execution table
// When
The same operation is applied on each of the instances so that the row in the execution table is deleted (maybe it can be reproduced with updates as well). Example: Job execution that finishes the process instance.
// Then
A concurrency error is reported by CockroachDB that leads to a CrdbTransactionRetryException in the process engine
// Expected
No concurrency error is reported since the data is not related and the transactions are in any case serializable.
Understanding:
CockroachDB needs to ensure that the foreign key constraint is not violated after the DELETE. It does that by performing a hash join on the foreign key index with a full scan after the delete was performed (see query plans in linked CRDB forum post).
Potentially related CockroachDB issue: https://github.com/cockroachdb/cockroach/issues/51648 (resolved in CRDB 20.1.5)
Forum post: https://forum.cockroachlabs.com/t/understanding-a-transactionretryerror-with-a-foreign-key/3895