3259 Andrei Elkin 2010-12-22 [merge]
wl#5569 MTS merging from the repo.
added:
mysql-test/include/not_mts_slave_parallel_workers.inc
mysql-test/suite/rpl/r/rpl_mixed_parallel_crash_safe.result
mysql-test/suite/rpl/r/rpl_row_parallel_crash_safe.result
mysql-test/suite/rpl/r/rpl_stm_parallel_crash_safe.result
mysql-test/suite/rpl/t/rpl_mixed_parallel_crash_safe-slave.opt
mysql-test/suite/rpl/t/rpl_mixed_parallel_crash_safe.test
mysql-test/suite/rpl/t/rpl_row_parallel_crash_safe-slave.opt
mysql-test/suite/rpl/t/rpl_row_parallel_crash_safe.test
mysql-test/suite/rpl/t/rpl_stm_parallel_crash_safe-slave.opt
mysql-test/suite/rpl/t/rpl_stm_parallel_crash_safe.test
modified:
mysql-test/extra/rpl_tests/rpl_crash_safe.inc
mysql-test/suite/rpl/t/rpl_migration_crash_safe.test
mysql-test/suite/rpl/t/rpl_mixed_crash_safe.test
mysql-test/suite/rpl/t/rpl_row_crash_safe.test
mysql-test/suite/rpl/t/rpl_stm_crash_safe.test
sql/rpl_rli_pdb.cc
sql/rpl_slave.cc
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2010-12-22 11:57:18 +0000
+++ b/sql/log_event.cc 2010-12-22 18:31:13 +0000
@@ -2772,18 +2772,26 @@ int Log_event::apply_event(Relay_log_inf
only_sequential_exec(rli->run_query_in_parallel,
rli->curr_group_seen_begin /* todo: obs 2nd arg */))
// rli->curr_group_seen_begin && ends_group() => rli->last_assigned_worker
- && !rli->curr_group_seen_begin))
+ && (!rli->curr_group_seen_begin || parallel_exec_by_coordinator(::server_id))))
{
if (parallel)
{
// This `only-sequential' case relates to a DDL Query case
-
- DBUG_ASSERT(rli->curr_group_da.elements == 0);
- DBUG_ASSERT(!rli->curr_group_seen_begin);
+ // or a group split apart by FD event
+ DBUG_ASSERT(seq_event &&
+ (rli->curr_group_da.elements == 0 || rli->curr_group_seen_begin));
- c_rli->curr_group_is_parallel= FALSE; // Coord will destruct events
if (!parallel_exec_by_coordinator(::server_id))
+ {
+ DBUG_ASSERT(!rli->curr_group_seen_begin);
+
+ c_rli->curr_group_is_parallel= FALSE; // Coord will destruct events
(void) wait_for_workers_to_finish(rli);
+ }
+ else
+ {
+ c_rli->curr_event_is_not_in_group= TRUE;
+ }
}
else if (rli->is_mts_recovery())
{
=== modified file 'sql/log_event.h'
--- a/sql/log_event.h 2010-12-21 19:31:29 +0000
+++ b/sql/log_event.h 2010-12-22 18:31:13 +0000
@@ -1246,8 +1246,9 @@ public:
bool parallel_exec_by_coordinator(ulong slave_server_id)
{
return
- get_type_code() == FORMAT_DESCRIPTION_EVENT &&
- (server_id == (uint32) ::server_id);
+ (get_type_code() == FORMAT_DESCRIPTION_EVENT ||
+ get_type_code() == ROTATE_EVENT) &&
+ ((server_id == (uint32) ::server_id) || (log_pos == 0));
}
/**
=== modified file 'sql/rpl_rli.h'
--- a/sql/rpl_rli.h 2010-12-22 11:57:18 +0000
+++ b/sql/rpl_rli.h 2010-12-22 18:31:13 +0000
@@ -474,6 +474,7 @@ public:
MY_BITMAP recovery_groups; // bitmap used during recovery.
ulong mts_recovery_group_cnt; // number of groups to execute at recovery
ulong mts_recovery_index; // running index of recoverable groups
+ bool curr_event_is_not_in_group; // a special case of group split apart by FD
/* most of allocation in the coordinator rli is there */
void init_workers(ulong);
=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc 2010-12-22 12:30:09 +0000
+++ b/sql/rpl_slave.cc 2010-12-22 18:34:26 +0000
@@ -2848,10 +2848,11 @@ int apply_event_and_update_pos(Log_event
int error= 0;
if (skip_event ||
(!rli->is_parallel_exec() ||
- !rli->curr_group_is_parallel))
+ (!rli->curr_group_is_parallel || rli->curr_event_is_not_in_group)))
{
DBUG_ASSERT(skip_event || !rli->is_parallel_exec() ||
- !rli->curr_group_is_parallel ||
+ (!rli->curr_group_is_parallel ||
+ rli->curr_event_is_not_in_group) ||
(ev->only_sequential_exec(rli->run_query_in_parallel,
(rli->curr_group_seen_begin ||
rli->last_assigned_worker != NULL))
@@ -3055,7 +3056,7 @@ static int exec_relay_log_event(THD* thd
// if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
{
if ((!rli->is_parallel_exec() ||
- !rli->curr_group_is_parallel)
+ !rli->curr_group_is_parallel || rli->curr_event_is_not_in_group)
&& ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
{
DBUG_ASSERT(!rli->is_parallel_exec() ||
@@ -3063,7 +3064,8 @@ static int exec_relay_log_event(THD* thd
// rli->curr_group_is_parallel
(rli->curr_group_seen_begin ||
rli->last_assigned_worker != NULL))
- && !rli->curr_group_seen_begin));
+ && (!rli->curr_group_seen_begin ||
+ ev->parallel_exec_by_coordinator(::server_id))));
/* MTS: Observation/todo.
ROWS_QUERY_LOG_EVENT could be supported easier if
@@ -3083,6 +3085,8 @@ static int exec_relay_log_event(THD* thd
ev= NULL;
}
}
+ if (rli->curr_event_is_not_in_group)
+ rli->curr_event_is_not_in_group= FALSE;
}
/*
@@ -4348,6 +4352,7 @@ int slave_start_workers(Relay_log_info *
rli->curr_group_isolated= FALSE;
rli->run_query_in_parallel= opt_mts_slave_run_query_in_parallel;
rli->checkpoint_seqno= 0;
+ rli->curr_event_is_not_in_group= FALSE;
//rli->worker_bitmap_buf= my_malloc(n/8 + 1,MYF(MY_WME));
// end recovery right now if mts_recovery_groups() did not find any gaps
Attachment: [text/bzr-bundle] bzr/andrei.elkin@oracle.com-20101222183426-qvgdlur7iadyl1fb.bundle
| Thread |
|---|
| • bzr push into mysql-next-mr-wl5569 branch (andrei.elkin:3259) WL#5569 | Andrei Elkin | 22 Dec |