Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1957

MySQL 8.0: 1213 Deadlock not logged (no replies)

$
0
0
Hi,

I'm struggling to understand a deadlock I'm getting on my program and hoping someone can give me some pointers, please?

I have a suite of CI test running on my application, with tests running in parallel, 6 at a time. I've started to get tests failing for deadlock conditions (clearly I need to include code to retry the failures), but I'm not understanding why it's deadlocking. It only happen when the tests are run rapidly on my CI machine - I can't reproduce it on my dev machine.

When it fails, it's alway on an INSERT (wrapped in a transaction) into one particular table. That table only ever has INSERT or SELECT (either on the table alone or in a JOIN, but never INSERT ... FOR SHARE or INSERT ... FOR UPDATE]) and my code never UPDATEs or DELETEs anything in that table (or anywhere else). How could either those SELECT or INSERT statements be generating a row lock which could lead to a deadlock? Can you get a deadlock on an index update, perhaps? I assume you can't get an autogenerated ID clash even if you inserted two row at exactly the same time?

Despite the 1213 Deadlock error status, there's no deadlock reported in SHOW ENGINE INNODB STATUS and nothing in the error log when I switch on innodb_print_all_deadlocks. What are the situations that would cause a 1213 error to be returned but not logged, please?

Thank you for any thoughts and suggestions you have.
Paul

Viewing all articles
Browse latest Browse all 1957

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>