Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
And a new test for this bug.
mysql-test/r/rpl_loaddata.result:
Now, after CHANGE MASTER the coordinates of the I/O thread are the last ones of the SQL thread, so result update.
sql/sql_repl.cc:
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
2003-11-18 17:31:17 +01:00
|
|
|
source include/master-slave.inc;
|
|
|
|
|
|
|
|
connection slave;
|
|
|
|
select get_lock("a",5);
|
|
|
|
connection master;
|
|
|
|
create table t1(n int);
|
2003-11-23 20:03:10 +01:00
|
|
|
insert into t1 values(1+get_lock("a",15)*0);
|
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
And a new test for this bug.
mysql-test/r/rpl_loaddata.result:
Now, after CHANGE MASTER the coordinates of the I/O thread are the last ones of the SQL thread, so result update.
sql/sql_repl.cc:
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
2003-11-18 17:31:17 +01:00
|
|
|
insert into t1 values(2);
|
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
2003-11-23 20:03:10 +01:00
|
|
|
--real_sleep 3; # can't sync_with_master as we should be blocked
|
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
And a new test for this bug.
mysql-test/r/rpl_loaddata.result:
Now, after CHANGE MASTER the coordinates of the I/O thread are the last ones of the SQL thread, so result update.
sql/sql_repl.cc:
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
2003-11-18 17:31:17 +01:00
|
|
|
stop slave;
|
|
|
|
select * from t1;
|
2003-11-22 02:21:40 +01:00
|
|
|
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
2003-11-21 00:53:01 +01:00
|
|
|
--replace_column 1 # 33 #
|
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
And a new test for this bug.
mysql-test/r/rpl_loaddata.result:
Now, after CHANGE MASTER the coordinates of the I/O thread are the last ones of the SQL thread, so result update.
sql/sql_repl.cc:
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
2003-11-18 17:31:17 +01:00
|
|
|
show slave status;
|
|
|
|
change master to master_user='root';
|
2003-11-22 02:21:40 +01:00
|
|
|
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
2003-11-21 00:53:01 +01:00
|
|
|
--replace_column 1 # 33 #
|
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
And a new test for this bug.
mysql-test/r/rpl_loaddata.result:
Now, after CHANGE MASTER the coordinates of the I/O thread are the last ones of the SQL thread, so result update.
sql/sql_repl.cc:
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
2003-11-18 17:31:17 +01:00
|
|
|
show slave status;
|
|
|
|
# Will restart from after the values(2), which is bug
|
|
|
|
select release_lock("a");
|
|
|
|
start slave;
|
|
|
|
sync_with_master;
|
|
|
|
select * from t1;
|
|
|
|
connection master;
|
|
|
|
drop table t1;
|
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|