← Back to team overview

maria-developers team mailing list archive

Re: The funcation of retry_transaction in parallen replication

 

hi Jeremy,

I can not give a test case because I have changed the way of retrying transaction in mysql-5.5.30 and then found this problem. The mysql-5.5.30 SQL thread's original way that retry failed events group(or a transaction) is droping the failed log-event object, then reading group's log events from BEGIN in relay log and applying their objects one by one again.for the log-event objects is new, the process of retry can get the same result as last time.
But in parallel replication of dingqi's patch the retry-way is changed. It reads in all events of a group and build a list of log-event objects in a time , then call log events' do_apply_event function from the event-object list head to tail. If there is some error happened, the retry-way is calling log events' do_apply_event function from the event-object list head again. so a log event object could do do_apply_event() twice. I imitated this process in mysql-5.5.30, made a log event object do do_apply_event() twice when it first time return nozero. then I find this problem that a Rows_log_event::do_apply_event() could call twice but return different results(first time is nozero, while second is zero). I also find the reason why the second time return zero is m_curr_row==m_rows_end in the Rows_log_event object. Does it need to set m_curr_row back to its original value before return from Rows_log_event::do_apply_event().

Regards,

Rao


2013-07-16



nanyi607rao



Hi,


Do you have a test case (or sequence of SQL statements you could provide in email)? Your email is a bit hard to follow, but this sounds interesting.

Regards,


Jeremy



On Thu, Jul 11, 2013 at 11:51 PM, nanyi607rao <nanyi607rao@xxxxxxxxx> wrote:

hi,
  In order to test  "retry_transaction" in function execute_single_transaction(), I change Relay_log_pos to make SQL thread insert Duplicate entry, but I find it successed and do not report error!

  so I debug the function execute_single_transaction() and find the reason : at first time, the insert Rows_log_event::do_apply_event() return 121, that means insert fails. But when retry the insert Rows_log_event::do_apply_event(),it return 0, that means insert success! it seems the Rows_log_event::do_apply_event() do twice, but return different results. how this happened? is it a bug of Rows_log_event::do_apply_event() ?

  By the way, I do this test in mysql-5.5.30, do mariaDB has the some problem?


2013-07-12



nanyi607rao

_______________________________________________
Mailing list: https://launchpad.net/~maria-developers
Post to     : maria-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp

References