MariaDB InnoDB Deadlock Diagnosis: Reading Error 1213/1205 Traces
Identify the offending queries in MariaDB deadlock traces, fix missing indexes or long transactions, and know when to escalate.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Identify the offending queries in MariaDB deadlock traces, fix missing indexes or long transactions, and know when to escalate.
ActiveRecord::Base.retry_on is documented to automatically retry on database errors such as ActiveRecord::Deadlocked. The retry is implemented by re-executing the entire transaction block from the start rather than resuming mid-statement. Because the block is re-run, non-idempotent operations inside the block can execute multiple times. This includes counter
Deadlock retries in a Moodle plugin I am writing a Moodle 4.5 plugin whose scheduled task performs several related writes inside $DB->start_delegated_transaction() . Under concurrent load, MySQL can abort the transaction with a dml_write_exception carrying SQLSTATE 40001 (deadlock). As far as I can tell, Moodle's DML layer throws this exception but does n