mariadb/storage/innobase/row
Marko Mäkelä 318096074e Bug#17302896 DOUBLE PURGE ON ROLLBACK OF UPDATING A DELETE-MARKED RECORD
There was a race condition in the rollback of TRX_UNDO_UPD_DEL_REC.

Once row_undo_mod_clust() has rolled back the changes by the rolling-back
transaction, it attempts to purge the delete-marked record, if possible, in a
separate mini-transaction.

However, row_undo_mod_remove_clust_low() fails to check if the DB_TRX_ID of
the record that it found after repositioning the cursor, is still the same.
If it is not, it means that the record was purged and another record was
inserted in its place.

So, the rollback would have performed an incorrect purge, breaking the
locking rules and causing corruption.

The problem was found by creating a table that contains a unique
secondary index and a primary key, and two threads running REPLACE
with only one value for the unique column, so that the uniqueness
constraint would be violated all the time, leading to statement
rollback.

This bug exists in all InnoDB versions (I checked MySQL 3.23.53).
It has become easier to repeat in 5.5 and 5.6 thanks to scalability
improvements and a dedicated purge thread.

rb#3085 approved by Jimmy Yang
2013-08-15 15:23:23 +03:00
..
row0ins.c Bug#59354 : Bug #12659252 : ASSERT !OTHER_LOCK AT LOCK_REC_ADD_TO_QUEUE DURING A DELETE OPERATION 2012-11-28 17:05:23 +09:00
row0mysql.c Bug #17076737 DUPLICATE CONSTRAINTS DISPLAYED WHEN NAME INCLUDES "_IBFK_" 2013-07-25 14:53:23 +05:30
row0purge.c Bug#12963823 CRASH IN PURGE THREAD UNDER UNUSUAL CIRCUMSTANCES 2011-09-22 13:35:02 +03:00
row0row.c Revert most of revno 3560.9.1 (Bug#12704861) 2011-10-26 11:44:28 +03:00
row0sel.c - BUG#1608883: KILLING A QUERY INSIDE INNODB CAUSES IT TO EVENTUALLY CRASH 2013-01-14 10:49:51 +05:30
row0uins.c Applied innodb-5.1 snapshots ss799 and ss854 2006-09-21 01:39:09 -06:00
row0umod.c Bug#17302896 DOUBLE PURGE ON ROLLBACK OF UPDATING A DELETE-MARKED RECORD 2013-08-15 15:23:23 +03:00
row0undo.c Bug #13249921 ASSERT !BPAGE->FILE_PAGE_WAS_FREED, USUALLY IN 2012-09-28 16:02:58 +05:30
row0upd.c Add instrumentation for Bug#13721257 RACE CONDITION IN UPDATES OR INSERTS 2012-02-16 12:24:11 +02:00
row0vers.c Re-enable the debug assertions for Bug#12650861. 2011-06-16 11:51:04 +03:00