Comment 2 for bug 1282034

Revision history for this message
Teemu Ollakka (teemu-ollakka) wrote :

Managed to crash lp:codership-mysql/5.6 with grammar from http://bazaar.launchpad.net/~teemu-ollakka/randgen/randgen_gc/view/head:/conf/galera/galera_stress-56.yy . LOAD DATA is not involved, but I suppose that the reason for the crash may be the same.

Function wsrep_run_wsrep_commit() in wsrep_hton.cc overrides thd->transaction.xid_state.xid if it has MySQLXid prefix:

    /* Override XID iff it was generated by mysql */
    if (thd->transaction.xid_state.xid.get_my_xid())
    {
      wsrep_xid_init(&thd->transaction.xid_state.xid,
                     &thd->wsrep_trx_meta.gtid.uuid,
                     thd->wsrep_trx_meta.gtid.seqno);
    }

If thd->transaction.xid_state.xid is not reset after previous commit for some reason and XID remain with WSREPXid prefix, it is not overridden here at commit time and old XID is used in InnoDB commit leading to assertion.

Overriding XID here also in case of WSREPXid prefix would avoid the crash. However, warning message or DBUG_ASSERT should be added somewhere to make sure that situations where thd->transaction.xid_state.xid reset is skipped between transactions are caught.