# Expected Diagnosis: transaction-failure-during-concurrent-upsert

The expected result should converge on the case-specific mechanism below while
keeping conclusions bounded by the collected evidence.

## Expected conclusion

The upsert redundantly updated the primary key, arming an ON UPDATE CASCADE path. A concurrent pessimistic write conflict triggered TiDB's internal retry, but the foreign-key cascade savepoint was not recreated or preserved, so rollback to the missing fk_sp failed and the whole transaction was rolled back. Avoid immutable primary-key updates and retry error 1105 at the application layer until the retry/savepoint fix is deployed.

## Required evidence chain

- Correlate the 1105 error with the nested write-conflict, pessimistic-retry, and missing foreign-key savepoint signals.
- Explain that the redundant primary-key update arms ON UPDATE CASCADE even when the value does not change.
- Identify the defect in preserving or recreating the cascade savepoint during TiDB's internal retry and state that the transaction is rolled back.
- Recommend removing immutable key columns from the upsert update branch and retrying 1105 at the application layer until fixed.
