• Kristian Nielsen's avatar
    MDEV-33798: ROW base optimistic deadlock with concurrent writes on same table · e365877b
    Kristian Nielsen authored
    One case is conflicting transactions T1 and T2 with different domain id, in
    optimistic parallel replication in non-GTID mode. Then T2 will
    wait_for_prior_commit on T1; and if T1 got a row lock wait on T2 it would
    hang, as different domains caused the deadlock kill to be skipped in
    thd_rpl_deadlock_check().
    
    More generally, if we have transactions T1 and T2 in one domain/master
    connection, and independent transactions U in another, then we can
    still deadlock like this:
    
      T1 row low wait on U
      U row lock wait on T2
      T2 wait_for_prior_commit on T1
    
    This commit enforces the deadlock kill in these cases. If the waited-for
    transaction is speculatively applied, then it will be deadlock killed in
    case of a conflict, even if the two transactions are in different domains
    or master connections.
    Reviewed-by: default avatarAndrei Elkin <andrei.elkin@mariadb.com>
    Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
    e365877b
rpl_mdev33798.result 3.32 KB