Kristian Nielsen <knielsen@knielsen-hq.org> writes:
丁奇 <dingqi.lxb@taobao.com> writes:
Hi, Kristian Ok. I have got the information from JIRA.
I find you control the commit order inside the user thread.
Will it be easier to let Trans_worker thread hold this logic?
Yes, I think you are right. Of course, the user thread is the one that knows the ordering, but the logic for waiting needs to be in the Trans_worker thread. In fact this is a bug in my first patch: Transaction T3 could wait for the THD of worker thread 1 which has both T1 and T2 queued; then it will wake up too early, when T1 commits rather than when T2 does.
I will try to implement the new idea today.
I fixed two bugs in my earlier patch (sorry for that, I should have tested a bit better :-) This one looks better. It fixes the earlier test failures I saw in mysql-test-run.pl. I tested it with 20000 inserts, it works and keeps the commit order, with a nice speedup compared to single-threaded insert on the master. There may still be more problems of course. Also, especially with --sync-binlog=0, I will need to implement my group commit ideas to achieve the best speed with in-order commit. New patch is attached (replaces earlier patches). I also pushed it to my branch: lp:~knielsen/maria/dingqi-parallel-replication - Kristian.