#At file:///home/andrei/MySQL/BZR/2a-23May/WL/mysql-next-mr-wl5569/ based on revid:andrei.elkin@stripped
3250 Andrei Elkin 2010-12-18
wl#5569 MTS
fixing --mts-exp-slave-run-query-in-parallel=1 case when Query-log-event can be run
in parallel incl DML and DDL.
The feature is `exp'erimental still can be tried while there are no temp tables involved neither
a db different than the session's default is modified by the query.
Tested:
Changes sustain
mtr rpl_parallel --mysqld=--mts-exp-slave-run-query-in-parallel=1 --mysqld=--binlog-format=statement
@ sql/log_event.cc
making a single-query group such as DDL to be distributed to Workers.
modified:
sql/log_event.cc
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2010-12-16 21:41:45 +0000
+++ b/sql/log_event.cc 2010-12-18 19:00:23 +0000
@@ -2432,6 +2432,8 @@ Slave_worker *Log_event::get_slave_worke
// the last occupied GAQ's array index
gaq_idx= rli->gaq->assigned_group_index= rli->gaq->en_queue((void *) &g);
+ // serves as a mark for Coord to delete events otherwise
+ const_cast<Relay_log_info*>(rli)->curr_group_is_parallel= TRUE;
DBUG_ASSERT(gaq_idx != (ulong) -1 && gaq_idx < rli->gaq->s);
DBUG_ASSERT(((Slave_job_group *)
@@ -2450,14 +2452,14 @@ Slave_worker *Log_event::get_slave_worke
// mark the current grup as started with B-event
const_cast<Relay_log_info*>(rli)->curr_group_seen_begin= TRUE;
+ return NULL;
}
else
{
DBUG_ASSERT(!rli->curr_group_seen_begin);
+
+ // Parallel single event proceeds to partiting etc ...
}
- // serves as a mark for Coord to delete events otherwise
- const_cast<Relay_log_info*>(rli)->curr_group_is_parallel= TRUE;
- return NULL;
}
//else // g
@@ -2765,32 +2767,6 @@ int Log_event::apply_event(Relay_log_inf
// This `only-sequential' case relates to a DDL Query case
DBUG_ASSERT(rli->curr_group_da.elements == 0);
-#if 0
- if (rli->curr_group_da.elements > 0)
- {
- int res;
- Log_event *ev_begin= * (Log_event**) pop_dynamic(&c_rli->curr_group_da);
-
- DBUG_ASSERT(rli->curr_group_da.elements == 0);
- DBUG_ASSERT(rli->curr_group_seen_begin);
-
- // While Query-log-event is not supported GAQ needs rollback
- if (rli->curr_group_seen_begin)
- {
- Slave_job_group g;
- ulong ind= rli->gaq->de_tail((uchar *) &g);
- const_cast<Relay_log_info*>(rli)->mts_total_groups--;
-
- DBUG_ASSERT(rli->last_assigned_worker == NULL);
- DBUG_ASSERT(c_rli->gaq->assigned_group_index == ind);
- }
- res= ev_begin->do_apply_event(rli);
- delete ev_begin;
- c_rli->curr_group_is_parallel= FALSE; // Coord will destruct events
- if (res)
- DBUG_RETURN(res);
- }
-#endif
DBUG_ASSERT(!rli->curr_group_seen_begin);
c_rli->curr_group_is_parallel= FALSE; // Coord will destruct events
Attachment: [text/bzr-bundle] bzr/andrei.elkin@oracle.com-20101218190023-izuik4l1fjq66fw6.bundle
| Thread |
|---|
| • bzr commit into mysql-next-mr-wl5569 branch (andrei.elkin:3250) WL#5569 | Andrei Elkin | 18 Dec |