• Brandon Nesterenko's avatar
    MDEV-31038: Parallel Replication Breaks if XA PREPARE Fails Updating Slave GTID State · 31f09e36
    Brandon Nesterenko authored
    If a replica failed to update the GTID slave state when committing
    an XA PREPARE, the replica would retry the transaction and get an
    out-of-order GTID error. This is because the commit phase of an XA
    PREPARE is bifurcated. That is, first, the prepare is handled by the
    relevant storage engines. Then second, the GTID slave state is
    updated as a separate autocommit transaction. If the second phase
    fails, and the transaction is retried, then the same transaction is
    attempted to be committed again, resulting in a GTID out-of-order
    error.
    
    This patch fixes this error by immediately stopping the slave and
    reporting the appropriate error. That is, there was logic to bypass
    the error when updating the GTID slave state table if the underlying
    error is allowed for retry on a parallel slave. This patch adds a
    parameter to disallow the error bypass, thereby forcing the error
    state to still happen.
    
    Reviewed By
    ============
    Andrei Elkin <andrei.elkin@mariadb.com>
    31f09e36
log_event_server.cc 273 KB