We continue to process all the unique secondary indexes and place the necessary gap locks. If a duplicate error is encountered, we do not stop processing. ON DUPLICATE UPDATE statement is executed, first, the record would be inserted into the clustered index followed by the secondary indexes. "This bug fix was just extending the gap locks for duplicates as a solution to this problem, which was not a foolproof solution. This change is the commit introduced in 5.7.26 Msb_5_7_26/use test -e "REPLACE INTO test SET id=NULL, a='foobar', b = 1, d = 'boobar' " Įxplain why 5.7.26+ detects more far more deadlocks and if that's a regression bug, fix it. Msb_5_7_26/use test -e "REPLACE INTO test SET id=NULL, a='foobar', b = 2, d = 'boobar' " $ for i in do msb_5_7_26/use test -e "REPLACE INTO test SET id=NULL, a='foobar', b = 1, d = 'boobar' " done &ĮRROR 1213 (40001) at line 1: Deadlock found when trying to get lock try restarting transaction Then run concurrent REPLACE loops against both. 26.ĬREATE TABLE test (id int unsigned NOT NULL AUTO_INCREMENT, a varchar(20), b int, c timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, d varchar(10), PRIMARY KEY (id), UNIQUE KEY uk1 (a,b,d)) ENGINE=InnoDB Set up simple sandbox instances with all defaults (I used dbdeployer), using MySQL Community 5.7.25 and. During partial rollback of a tuple, another session could update it. ON DUPLICATE KEY UPDATE operation generated a deadlock. "InnoDB: Two sessions concurrently executing an INSERT. I wonder if that change in 5.7.26 could be possibly related: More deadlocks are observed after minor version upgrade from 5.7.25 to 5.7.26 or higher.įor a simple test case with REPLACE statements, I am getting around 20x more deadlock messages after upgrade.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |