-
Aditya A authored
PROBLEM ------- The root cause of the problem was that delete marked rows can acquire a external read lock at the stage where partial rollback is not complete In partial rollback when we try to convert implicit lock to explicit we get a assert saying that already it is locked by a external read lock. 1. For Secondary Index: During rollback, we can remove delete marked key (that is ok to purge) even if the transaction hasn't modified it. In such case it is not right to convert to explicit lock since the transaction is not holding implicit lock on the key. 2. For Cluster Index: If INSERT has modified an existing delete marked key, then during rollback there are 2 steps. A. Rollback the update replacing with previous key (delete mark) B. Remove the delete mark on the row if it is ok to purged The implicit lock is released at step A. Currently we were creating the explicit lock in step-B which keeps a window when the key is not locked allowing other transaction to lock the row. We must convert implicit to explicit lock before step-A. FIX --- We are fixing the problem with these three steps 1) When reverting back the change done in cluster record we were leaving the protection of the implicit lock when we did a commit in the function row_undo_mod_clust() which enabled other connection to acquire a lock on the row. So we try to do a implicit to explicit conversion before the commit. 2) For secondary index records we don't allow the implicit to explicit conversion if the record is delete marked. 3) Regression caused by IODKU patch (# Bug #29718243 MYQL SERVER CRASHING) is fixed by not allowing temporary tables to do implicit to explicit conversions since temporary tables are per session. #rb 22659 22909 Reviewed by : Debarun Banerjee <debarun.banerjee@oracle.com> (cherry picked from commit 0b49d345b65faade7d20a0cf4c7f2104abe61107)
Aditya A authoredPROBLEM ------- The root cause of the problem was that delete marked rows can acquire a external read lock at the stage where partial rollback is not complete In partial rollback when we try to convert implicit lock to explicit we get a assert saying that already it is locked by a external read lock. 1. For Secondary Index: During rollback, we can remove delete marked key (that is ok to purge) even if the transaction hasn't modified it. In such case it is not right to convert to explicit lock since the transaction is not holding implicit lock on the key. 2. For Cluster Index: If INSERT has modified an existing delete marked key, then during rollback there are 2 steps. A. Rollback the update replacing with previous key (delete mark) B. Remove the delete mark on the row if it is ok to purged The implicit lock is released at step A. Currently we were creating the explicit lock in step-B which keeps a window when the key is not locked allowing other transaction to lock the row. We must convert implicit to explicit lock before step-A. FIX --- We are fixing the problem with these three steps 1) When reverting back the change done in cluster record we were leaving the protection of the implicit lock when we did a commit in the function row_undo_mod_clust() which enabled other connection to acquire a lock on the row. So we try to do a implicit to explicit conversion before the commit. 2) For secondary index records we don't allow the implicit to explicit conversion if the record is delete marked. 3) Regression caused by IODKU patch (# Bug #29718243 MYQL SERVER CRASHING) is fixed by not allowing temporary tables to do implicit to explicit conversions since temporary tables are per session. #rb 22659 22909 Reviewed by : Debarun Banerjee <debarun.banerjee@oracle.com> (cherry picked from commit 0b49d345b65faade7d20a0cf4c7f2104abe61107)
Loading