Error 1062: Duplicate entry for unique key

这个看程序应该是不会的,无论是 乐观模式还是悲观模式,都是先拿 tso 的,建议你看 tidb-server 的日志(或直接开 general)