Below is the list of changes that have just been committed into a local
5.1 repository of mats. When mats does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-10-10 15:18:21+02:00, mats@romeo.(none) +2 -0
BUG#21474 (There is a rotation before the last table map):
Removing code to step the group log position and just stepping
the event log position. If the group log position were stepped
one time too many, it might be that the group starts at a position
that is not possible, e.g., at a Rows_log_event, or between an
Intvar_log_event and the following associated Query_log_event.
sql/log_event.cc@stripped, 2006-10-10 15:18:03+02:00, mats@romeo.(none) +13 -13
Removing code to step the group log position and just stepping
the event log position. If the group log position were stepped
one time too many, it might be that the group starts at a position
that is not possible, e.g., at a Rows_log_event, or between an
Intvar_log_event and the following associated Query_log_event.
sql/slave.cc@stripped, 2006-10-10 15:18:03+02:00, mats@romeo.(none) +16 -11
Removing code to step the group log position and just stepping
the event log position when executing a Format_description_log_event.
If the group log position were stepped one time too many, it might be that the group
starts at a position
that is not possible, e.g., at a Rows_log_event, or between an
Intvar_log_event and the following associated Query_log_event.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: mats
# Host: romeo.(none)
# Root: /home/bk/b21474-mysql-5.1-new-rpl
--- 1.244/sql/log_event.cc 2006-10-10 15:19:03 +02:00
+++ 1.245/sql/log_event.cc 2006-10-10 15:19:03 +02:00
@@ -2381,19 +2381,19 @@
if (server_id == (uint32) ::server_id)
{
/*
- Do not modify rli->group_master_log_pos, as this event did not exist on
- the master. That is, just update the *relay log* coordinates; this is
- done by passing log_pos=0 to inc_group_relay_log_pos, like we do in
- Stop_log_event::exec_event().
- If in a transaction, don't touch group_* coordinates.
- */
- if (thd->options & OPTION_BEGIN)
- rli->inc_event_relay_log_pos();
- else
- {
- rli->inc_group_relay_log_pos(0);
- flush_relay_log_info(rli);
- }
+ We only increase the relay log position if we are skipping
+ events and do not touch any group_* variables, nor flush the
+ relay log info. If there is a crash, we will have to re-skip
+ the events again, but that is a minor issue.
+
+ If we do not skip stepping the group log position (and the
+ server id was changed when restarting the server), it might well
+ be that we start executing at a position that is invalid, e.g.,
+ at a Rows_log_event or a Query_log_event preceeded by a
+ Intvar_log_event instead of starting at a Table_map_log_event or
+ the Intvar_log_event respectively.
+ */
+ rli->inc_event_relay_log_pos();
DBUG_RETURN(0);
}
--- 1.285/sql/slave.cc 2006-10-10 15:19:04 +02:00
+++ 1.286/sql/slave.cc 2006-10-10 15:19:04 +02:00
@@ -3101,17 +3101,22 @@
type_code != START_EVENT_V3 && type_code!= FORMAT_DESCRIPTION_EVENT))
{
DBUG_PRINT("info", ("event skipped"));
- if (thd->options & OPTION_BEGIN)
- rli->inc_event_relay_log_pos();
- else
- {
- rli->inc_group_relay_log_pos((type_code == ROTATE_EVENT ||
- type_code == STOP_EVENT ||
- type_code == FORMAT_DESCRIPTION_EVENT) ?
- LL(0) : ev->log_pos,
- 1/* skip lock*/);
- flush_relay_log_info(rli);
- }
+ /*
+ We only skip the event here and do not increase the group log
+ position. In the event that we have to restart, this means
+ that we might have to skip the event again, but that is a
+ minor issue.
+
+ If we were to increase the group log position when skipping an
+ event, it might be that we are restarting at the wrong
+ position and have events before that we should have executed,
+ so not increasing the group log position is a sure bet in this
+ case.
+
+ In this way, we just step the group log position when we
+ *know* that we are at the end of a group.
+ */
+ rli->inc_event_relay_log_pos();
/*
Protect against common user error of setting the counter to 1
| Thread |
|---|
| • bk commit into 5.1 tree (mats:1.2345) BUG#21474 | Mats Kindahl | 10 Oct |