Bug #52020 InnoDB can still deadlock on just INSERT...ON DUPLICATE KEY
Submitted: 12 Mar 2010 21:49 Modified: 4 Jan 2012 21:39
Reporter: Harrison Fisk Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.0, 5.1.46 OS:Any
Assigned to: Marko Mäkelä CPU Architecture:Any

File: Maximum allowed size is 3MB.

If the data you need to attach is more than 3MB, you should create a compressed archive of the data and a README file that describes the data with a filename that includes the bug number (recommended filename: mysql-bug-data-52020.zip) and upload one to sftp.oracle.com. A free Oracle Web (SSO) account (the one you use to login bugs.mysql.com) and a client that supports SFTP are required in order to access the SFTP server.

To upload the file to sftp.oracle.com:

  1. Open an SFTP client and connect to sftp.oracle.com. Specify port 2021 and remote directory /support/incoming/.
  2. Log in with your newly created Oracle Web account (email address) and password.
  3. Upload the archive to /support/incoming.
  4. Once you have uploaded the file, add a comment to this bug to notify us about it.
Example: sftp -oPort=2021 -oUser=email sftp.oracle.com:/support/incoming

Usage Notes: This directory is unlistable, which means that once you have uploaded your file, you will not be able to see it. A file cannot be uploaded more than once with the same filename. The filename must be changed before attempting to upload the file again. The filename should always start with mysql-bug- prefix. Files are retained on the SFTP server for 7 days and then permanently removed.

[13 Mar 2010 15:25] Valeriy Kravchuk
Multithreaded test case (no luck in repeating though)

Attachment: bug52020.c (text/x-csrc), 6.11 KiB.

[17 Mar 2010 17:51] Sinisa Milivojevic
test script that also failed repeating the bug

Attachment: sinisa.test (application/octet-stream, text), 1.42 KiB.

[17 Mar 2010 18:03] Sinisa Milivojevic
New version with four threads ....

Attachment: sinisa4.test (application/octet-stream, text), 1.94 KiB.

[21 Apr 2010 7:56] Shane Bester
think i repeated it now.. please , check if it looks correct.

Attachment: bug52020_5.4.3_deadlock_repeated.txt (text/plain), 2.52 KiB.

[21 Apr 2010 9:35] Shane Bester
think I repeated with 5.1.45 and insert .. on duplicate key update, see attached.

Attachment: bug52020_5.1.45_deadlock_repeated.txt (text/plain), 3.13 KiB.

[21 Apr 2010 15:01] Shane Bester
testcase to cause the above deadlock. often manually inspect 'show innodb status'  (it shows other deadlocks mostly :()

Attachment: bug52020_sbester.c (text/plain), 6.27 KiB.

[22 Dec 2017 8:22] Nitin Sachdeva
INSERT ON DUPLICATE UPDATE deadlock issuw with next-key lock

Attachment: INSert_UPDATE_DEADLOCK.txt (text/plain), 2.47 KiB.