• Kristian Nielsen's avatar
    MDEV-33668: More precise dependency tracking of XA XID in parallel replication · d90a2b44
    Kristian Nielsen authored
    Keep track of each recently active XID, recording which worker it was queued
    on. If an XID might still be active, choose the same worker to queue event
    groups that refer to the same XID to avoid conflicts.
    
    Otherwise, schedule the XID freely in the next round-robin slot.
    
    This way, XA PREPARE can normally be scheduled without restrictions (unless
    duplicate XID transactions come close together). This improves scheduling
    and parallelism over the old method, where the worker thread to schedule XA
    PREPARE on was fixed based on a hash value of the XID.
    
    XA COMMIT will normally be scheduled on the same worker as XA PREPARE, but
    can be a different one if the XA PREPARE is far back in the event history.
    
    Testcase and code for trimming dynamic array due to Andrei.
    Reviewed-by: default avatarAndrei Elkin <andrei.elkin@mariadb.com>
    Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
    d90a2b44
rpl_parallel_multi_domain_xa.result 1.92 KB