← Back to team overview

maria-developers team mailing list archive

Re: Fwd: crash in slave replication with XA transaction



>>>>> "Zardosht" == Zardosht Kasheff <zardosht@xxxxxxxxx> writes:

Zardosht> Hello all,
Zardosht> We see this on Maria 5.2 and Maria 5.5 as well. Does the following fix work?

Zardosht> -Zardosht

Zardosht> We are running MySQL 5.5.21 with both InnoDB and TokuDB as XA storage
Zardosht> engines.  When one runs a transaction that inserts into an InnoDB
Zardosht> table and a TokuDB table, the commit crashes the replication slave at
Zardosht> log.cc line 6602 because cache_mngr == NULL.  We found a pattern in
Zardosht> various log functions in log.cc that calls binlog_setup_trx_data to
Zardosht> initialize the txn state.

Zardosht> This change fixes our immediate problem.

Zardosht> $ diff log.cc.orig log.cc
Zardosht> 6595a6596,6597
>>   if (thd_get_ha_data(thd, binlog_hton) == NULL)
>>     thd->binlog_setup_trx_data();

Zardosht> Is this a correct fix?  If so, are there other places that need a
Zardosht> similar change?

I would just add a call to

if (thd->binlog_setup_trx_data())

Just before calling:

binlog_cache_mngr *cache_mngr=
    (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);

There is no need to test for value of thd_get_ha_data(thd,binlog_hton)
as the function thd->binlog_setup_trx_data() already does that.

There is a couple of other functions that also calls
thd_get_ha_data(thd, binlog_hton) and uses this without checking if
the value returned is == NULL . You probably want to add the same code
in these functions.


Follow ups