Databases
Bug Report
MySQL deadlock on concurrent INSERT ... ON DUPLICATE KEY UPDATE batches
Stock updates from supplier feeds started failing with Deadlock found when trying to get lock during peak hours. Concurrent upsert batches touched the same unique keys in different orders under InnoDB next-key locking. Sorting, smaller batches and a retry fixed it.