diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2015-02-06 10:02:02 +0100 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2015-02-07 09:42:58 +0100 |
commit | 8672339328c30c894b4062f94c4fb0510fb20f9a (patch) | |
tree | 684a4dfb1b8269276e3602e3d716683aa369846a /sql/rpl_parallel.cc | |
parent | 734c4c01439488781837196ff09ad5f2c5276ead (diff) | |
download | mariadb-git-8672339328c30c894b4062f94c4fb0510fb20f9a.tar.gz |
MDEV-6676: Optimistic parallel replication
Adjust the configuration options, as discussed on the
maria-developers@ mailing list.
The option to hint a transaction to not be replicated in parallel is
now called @@skip_parallel_replication, consistent with
@@skip_replication.
And the --slave-parallel-mode is now simplified to have just one of
the following values:
none
minimal
conservative
optimistic
aggressive
This reflects successively harder efforts to find opportunities to run
things in parallel on the slave. It allows to extend the server with
more automatic heuristics in the future without having to introduce a
new configuration option for each and every one.
Diffstat (limited to 'sql/rpl_parallel.cc')
-rw-r--r-- | sql/rpl_parallel.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index e37a82720b5..609f50952c0 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -2013,7 +2013,7 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev, { Gtid_log_event *gtid_ev= static_cast<Gtid_log_event *>(ev); uint32 domain_id= (rli->mi->using_gtid == Master_info::USE_GTID_NO || - !(rli->mi->parallel_mode & SLAVE_PARALLEL_DOMAIN) ? + rli->mi->parallel_mode <= SLAVE_PARALLEL_MINIMAL ? 0 : gtid_ev->domain_id); if (!(e= find(domain_id))) { @@ -2054,7 +2054,7 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev, { Gtid_log_event *gtid_ev= static_cast<Gtid_log_event *>(ev); bool new_gco; - ulonglong mode= rli->mi->parallel_mode; + enum_slave_parallel_mode mode= rli->mi->parallel_mode; uchar gtid_flags= gtid_ev->flags2; group_commit_orderer *gco; uint8 force_switch_flag; @@ -2093,7 +2093,8 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev, { uint8 flags= gco->flags; - if (!(gtid_flags & Gtid_log_event::FL_GROUP_COMMIT_ID) || + if (mode <= SLAVE_PARALLEL_MINIMAL || + !(gtid_flags & Gtid_log_event::FL_GROUP_COMMIT_ID) || e->last_commit_id != gtid_ev->commit_id) flags|= group_commit_orderer::MULTI_BATCH; /* Make sure we do not attempt to run DDL in parallel speculatively. */ @@ -2108,7 +2109,7 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev, */ new_gco= false; } - else if ((mode & SLAVE_PARALLEL_TRX) && + else if ((mode >= SLAVE_PARALLEL_OPTIMISTIC) && !(flags & group_commit_orderer::FORCE_SWITCH)) { /* @@ -2124,9 +2125,9 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev, */ new_gco= false; if (!(gtid_flags & Gtid_log_event::FL_TRANSACTIONAL) || - !(gtid_flags & Gtid_log_event::FL_ALLOW_PARALLEL) || - ((gtid_flags & Gtid_log_event::FL_WAITED) && - !(mode & SLAVE_PARALLEL_WAITING))) + ( (!(gtid_flags & Gtid_log_event::FL_ALLOW_PARALLEL) || + (gtid_flags & Gtid_log_event::FL_WAITED)) && + (mode < SLAVE_PARALLEL_AGGRESSIVE))) { /* This transaction should not be speculatively run in parallel with |