Bug #65111 | Innodb sometimes fails to update rows inserted by a concurrent transaction | ||
---|---|---|---|
Submitted: | 26 Apr 2012 9:31 | Modified: | 15 May 2012 18:33 |
Reporter: | Simon Martin | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB Plugin storage engine | Severity: | S2 (Serious) |
Version: | 5.6,5.5 | OS: | Linux |
Assigned to: | CPU Architecture: | Any | |
Tags: | innodb, regression, transaction |
[26 Apr 2012 9:31]
Simon Martin
[26 Apr 2012 16:39]
Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php You start transaction with option "WITH CONSISTENT SNAPSHOT". According to http://dev.mysql.com/doc/refman/5.5/en/commit.html: "The WITH CONSISTENT SNAPSHOT option starts a consistent read for storage engines that are capable of it. This applies only to InnoDB. The effect is the same as issuing a START TRANSACTION followed by a SELECT from any InnoDB table. " This means transaction 1 "read" all rows from the table when transaction started and to be able to satisfy REPEATABLE READ conditions it does not see row inserted in the another transaction.
[26 Apr 2012 16:46]
Simon Martin
If this is not a bug can you explain why the behaviour changes by adding or removing the indexes? Either the row should always be updated (as I believe) or the row should never be updated. The behaviour should be consistent regardless of the presence of these indexes, at the moment it is not.
[26 Apr 2012 16:58]
Sveta Smirnova
Thank you for the feedback. I agree with key usage inconsistency. Set as "Verified".
[26 Apr 2012 16:59]
Sveta Smirnova
In versions 5.0 and 5.1 results are same (first transaction sees row) regardless from secondary key usage.
[8 May 2012 16:58]
Sveta Smirnova
Bug not repeatable with 5.1 for me today, but repeatable with 5.5 and trunk
[15 May 2012 7:51]
Simon Martin
Sorry for the delay - I agree, can not reproduce in 5.1, removing it from the effected versions.
[27 Jun 2012 21:45]
John Russell
Added to changelog for 5.1.64, 5.5.25, 5.6.6: In a transaction using the REPEATABLE READ isolation level, an UPDATE or DELETE statement for an InnoDB table could sometimes overlook rows recently committed by other transactions. As explained in innodb-consistent-read, DML statements within a REPEATABLE READ transaction apply to rows committed by other transactions, even if a query could not see those rows.