← Back to team overview

maria-developers team mailing list archive

Idea for parallel replication with statement-based binlogging

 

Hi Xiaobin,

I hope you are enjoying the Spring Festival! All the best wishes for you and
your family for the coming year.

I had an idea for your parallel replication work, inspired by my work on
in-order commit. I wanted to hear your opinion on it, if you are interested.

The idea is to make your patch work with statement-based replication.

For row-based InnoDB events, you hash all the unique keys to check for
conflicts, and if no conflict you can run transactions in parallel even
against the same table.

For MyISAM, I get deadlock issues in my in-order-commit patch, if I try to
replicate in parallel against the same table. So I hash just the table names,
so that two transactions on the same table always conflict. Then I can still
replicate in parallel events against different tables.

Now suppose that for statement-based events, we obtain the names of all tables
used in the queries. We could add a new event to the binlog with the table
names, or perhaps parse the statement on the slave, if that is not too
expensive. Then we could hash just the names to check for conflicts, just like
I did for MyISAM with row-based events.

It seems to me that we could then safely replicate statement-based events in
parallel on the slave if they are to different tables. This would be great for
people that do not want to use row-based replication, it would surely be
better than the MySQL 5.6 multi-threaded slave which can only do queries
against different databases in parallel.

What do you think?

 - Kristian.


Follow ups

References