← Back to team overview

maria-developers team mailing list archive

答复: 答复: 答复: 答复: MDEV-520: consider parallel replication patch from taobao patches

 

Hi, Kristian
  It's great. I just test all the test-case again after modified as you said, the result looks normal.

  What's your cmake parameter? I did not crah it in my envieronment, in fact if it crashed, I should resolved it before sending it to you.

   I am now working in my local , base on the bzr : http://bazaar.launchpad.net/~maria-captains/maria/10.0-base/
   Can you suggest a suitable place on launchpad? or a branch under ~maria-captains/maria/ ?

Xiaobin

发件人: Kristian Nielsen [knielsen@xxxxxxxxxxxxxxx]
发送时间: 2012年12月5日 22:31
到: 丁奇
Cc: maria-developers@xxxxxxxxxxxxxxxxxxx
主题: Re: [Maria-developers] 答复: 答复:  答复: MDEV-520: consider parallel replication patch from taobao patches

丁奇 <dingqi.lxb@xxxxxxxxxx> writes:

> Finally, there are some test-cases that are too complex and need your help.
>    rpl.rpl_deadlock_innodb

I debugged this one.

When I run the test, it crashes inside sql_plugin.cc.

The reason is this code in Transfer_worker::run():

  thd= new THD;
  ...
  thd->variables= rli->sql_thd->variables;

I assume the intention is that slave workers should have the same session
variables as the "normal" sql thread. However, it does not work to copy
thd->variables like this. The reason it crashes here is that it copies
thd->variables.table_plugin without using plugin_lock(). And debug builds have
some extra code to help catch missing lock() / incorrect refcounting (it is
turned into a double free). There may be other problems with copying
thd->variables directly that I'm not aware of.

But maybe it would be better if we did not try to copy thd->variables from the
sql thread? I tried the following patch, and then rpl_deadlock_innodb no
longer crashes:

=== modified file 'sql/slave.cc'
--- sql/slave.cc        2012-12-05 14:05:37 +0000
+++ sql/slave.cc        2012-12-05 14:13:29 +0000
@@ -2889,13 +2889,11 @@ int Transfer_worker::run()
   thd= new THD;
   pthread_detach_this_thread();
   thd->thread_stack= (char*) &i;
-  thd->variables= rli->sql_thd->variables;
+  init_slave_thread(thd, SLAVE_THD_SQL);
   thd->variables.option_bits|= OPTION_NO_FOREIGN_KEY_CHECKS;
   thd->variables.dynamic_variables_ptr= NULL;
-  thd->security_ctx= rli->sql_thd->security_ctx;
   thd->lex->thd= thd;
   thd->lex->derived_tables= 0;
-  thd->system_thread = SYSTEM_THREAD_SLAVE_SQL;

   dummy_rli= new Relay_log_info(FALSE);
   dummy_rli->no_storage= TRUE;

Basically, initialise thd->variables from scratch like sql thread does, not
copy from the thd of the sql thread. What do you think?

BTW, the rpl_deadlock_innodb test fails differently with my patch, it times
out waiting for error 1205. I did not investigate yet, maybe it is now similar
to some of the other errors in other tests that you already explained.

I will continue looking at the other questions in your mail.

BTW, are you keeping the code in revision control somewhere (bzr, git,
whatever)? It might be easier to work together on some tree where we can
commit changes, rather than mail patches back and forth?

Later,

 - Kristian.

________________________________

This email (including any attachments) is confidential and may be legally privileged. If you received this email in error, please delete it immediately and do not copy it or use it for any purpose or disclose its contents to any other person. Thank you.

本电邮(包括任何附件)可能含有机密资料并受法律保护。如您不是正确的收件人,请您立即删除本邮件。请不要将本电邮进行复制并用作任何其他用途、或透露本邮件之内容。谢谢。

Follow ups

References