#At file:///home/lsoares/Workspace/bzr/work/bugfixing/11765124/mysql-trunk/ based on revid:georgi.kodinov@stripped
3327 Luis Soares 2011-03-25
Experimenting...
@ sql/log_event.cc
Passing through Log_event instance to rli->stmt_done.
@ sql/log_event_old.cc
Passing through Log_event instance to rli->stmt_done.
@ sql/rpl_rli.cc
Updating the timestamp only when updating the *group* position.
@ sql/rpl_rli.h
Changes stmt_done interface.
@ sql/rpl_slave.cc
Remove the part of the code that updates the timestamp on
event dequeue...
modified:
sql/log_event.cc
sql/log_event_old.cc
sql/rpl_rli.cc
sql/rpl_rli.h
sql/rpl_slave.cc
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2011-03-25 12:15:56 +0000
+++ b/sql/log_event.cc 2011-03-25 16:38:11 +0000
@@ -806,7 +806,9 @@ int Log_event::do_update_pos(Relay_log_i
Matz: I don't think we will need this check with this refactoring.
*/
if (rli)
- rli->stmt_done(log_pos);
+ {
+ rli->stmt_done(log_pos, this);
+ }
return 0; // Cannot fail currently
}
@@ -8328,7 +8330,7 @@ Rows_log_event::do_update_pos(Relay_log_
Step the group log position if we are not in a transaction,
otherwise increase the event log position.
*/
- rli->stmt_done(log_pos);
+ rli->stmt_done(log_pos, this);
/*
Clear any errors in thd->net.last_err*. It is not known if this is
needed or not. It is believed that any errors that may exist in
=== modified file 'sql/log_event_old.cc'
--- a/sql/log_event_old.cc 2010-11-01 05:40:27 +0000
+++ b/sql/log_event_old.cc 2011-03-25 16:38:11 +0000
@@ -1851,7 +1851,7 @@ Old_rows_log_event::do_update_pos(Relay_
Step the group log position if we are not in a transaction,
otherwise increase the event log position.
*/
- rli->stmt_done(log_pos);
+ rli->stmt_done(log_pos, this);
/*
Clear any errors in thd->net.last_err*. It is not known if this is
needed or not. It is believed that any errors that may exist in
=== modified file 'sql/rpl_rli.cc'
--- a/sql/rpl_rli.cc 2011-03-10 10:08:09 +0000
+++ b/sql/rpl_rli.cc 2011-03-25 16:38:11 +0000
@@ -891,7 +891,7 @@ bool Relay_log_info::cached_charset_comp
}
-void Relay_log_info::stmt_done(my_off_t event_master_log_pos)
+void Relay_log_info::stmt_done(my_off_t event_master_log_pos, Log_event *ev)
{
clear_flag(IN_STMT);
DBUG_ASSERT(!belongs_to_client());
@@ -925,6 +925,12 @@ void Relay_log_info::stmt_done(my_off_t
{
inc_group_relay_log_pos(event_master_log_pos);
flush_info(is_transactional() ? TRUE : FALSE);
+
+ if (!(ev->is_artificial_event() || ev->is_relay_log_event() || (ev->when == 0)))
+ {
+ this->last_master_timestamp= ev->when + (time_t) ev->exec_time;
+ DBUG_ASSERT(this->last_master_timestamp >= 0);
+ }
}
}
=== modified file 'sql/rpl_rli.h'
--- a/sql/rpl_rli.h 2010-12-21 09:33:41 +0000
+++ b/sql/rpl_rli.h 2011-03-25 16:38:11 +0000
@@ -437,7 +437,7 @@ public:
relay log info and used to produce information for <code>SHOW
SLAVE STATUS</code>.
*/
- void stmt_done(my_off_t event_log_pos);
+ void stmt_done(my_off_t event_log_pos, Log_event *ev);
/**
=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc 2011-03-17 17:39:31 +0000
+++ b/sql/rpl_slave.cc 2011-03-25 16:38:11 +0000
@@ -2880,22 +2880,6 @@ static int exec_relay_log_event(THD* thd
int exec_res;
/*
- Even if we don't execute this event, we keep the master timestamp,
- so that seconds behind master shows correct delta (there are events
- that are not replayed, so we keep falling behind).
-
- If it is an artificial event, or a relay log event (IO thread generated
- event) or ev->when is set to 0, or a FD from master, we don't update the
- last_master_timestamp.
- */
- if (!(ev->is_artificial_event() || ev->is_relay_log_event() ||
- (ev->when == 0) || ev->get_type_code() == FORMAT_DESCRIPTION_EVENT))
- {
- rli->last_master_timestamp= ev->when + (time_t) ev->exec_time;
- DBUG_ASSERT(rli->last_master_timestamp >= 0);
- }
-
- /*
This tests if the position of the beginning of the current event
hits the UNTIL barrier.
*/
Attachment: [text/bzr-bundle] bzr/luis.soares@oracle.com-20110325163811-f56gfpfttcdu26ra.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk branch (luis.soares:3327) | Luis Soares | 25 Mar |