• Daniele Sciascia's avatar
    MDEV-31272 Statement rollback causes empty writeset replication · 0e1f4bd6
    Daniele Sciascia authored
    This patch fixes cases where a transaction caused empty writeset to be
    replicated. This could happen in the case where a transaction executes
    a statement that initially manages to modify some data and therefore
    appended keys some for  certification. The statement is however rolled
    back at some later stage due to some error (for example, a duplicate
    key error). After statement rollback the transaction is still alive,
    has no other changes. When committing such transaction, an empty
    writeset was replicated through Galera.
    
    The fix is to avoid calling into commit hook only when transaction
    has appended one or keys for certification *and* has some data in
    binlog cache to replicate. Otherwise, the commit is considered empty,
    and goes through usual empty commit path.
    Signed-off-by: default avatarJulius Goryavsky <julius.goryavsky@mariadb.com>
    0e1f4bd6
MDEV-31272.combinations 53 Bytes