• Vlad Lesin's avatar
    MDEV-34466 XA prepare don't release unmodified records for some cases · cdde97db
    Vlad Lesin authored
    There is no need to exclude exclusive non-gap locks from the procedure
    of locks releasing on XA PREPARE execution in
    lock_release_on_prepare_try() after commit
    17e59ed3 (MDEV-33454), because
    lock_rec_unlock_unmodified() should check if the record was modified
    with the XA, and release the lock if it was not.
    
    lock_release_on_prepare_try(): don't skip X-locks, let
    lock_rec_unlock_unmodified() to process them.
    
    lock_sec_rec_some_has_impl(): add template parameter for not acquiring
    trx_t::mutex for the case if a caller already holds the mutex, don't
    crash if lock's bitmap is clean.
    
    row_vers_impl_x_locked(), row_vers_impl_x_locked_low(): add new argument
    to skip trx_t::mutex acquiring.
    
    rw_trx_hash_t::validate_element(): don't acquire trx_t::mutex if the
    current thread already holds it.
    
    Thanks to Andrei Elkin for finding the bug.
    Reviewed by Marko Mäkelä, Debarun Banerjee.
    cdde97db
row0vers.cc 26.8 KB