# Expected Diagnosis: downstream-sink-transaction-failure

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

## Expected conclusion

The failure occurred in the downstream MySQL database, where concurrent TiCDC workers executed REPLACE statements that interacted through a secondary unique index and deadlocked. It was not an upstream TiDB transaction-engine bug. Removing the downstream unique constraint where acceptable or setting worker-count=1 avoids the conflicting execution pattern.

## Required evidence chain

- Use the TiCDC error and SQL payload to show that Error 1213 comes from downstream MySQL.
- Identify concurrent REPLACE operations plus a secondary unique index as the deadlock pattern.
- Avoid blaming the upstream TiDB transaction engine.
- Recommend worker-count=1 or removing the downstream unique constraint after correctness review.
