Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
cf50a67c
Commit
cf50a67c
authored
Feb 27, 2008
by
svoj@mysql.com/june.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if
log-slave-updates and circul repl After merge fixes.
parent
6c6afd71
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
10 deletions
+19
-10
mysql-test/include/wait_for_slave_sql_to_stop.inc
mysql-test/include/wait_for_slave_sql_to_stop.inc
+4
-1
mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt
mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt
+0
-0
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
+5
-4
sql/rpl_rli.cc
sql/rpl_rli.cc
+7
-2
sql/rpl_rli.h
sql/rpl_rli.h
+1
-1
sql/slave.cc
sql/slave.cc
+2
-2
No files found.
mysql-test/include/wait_for_slave_sql_to_stop.inc
View file @
cf50a67c
...
...
@@ -9,7 +9,10 @@
# sql threads to stop
# 3) If loops too long die.
####################################################
connection
slave
;
if
(
!
$keep_connection
)
{
connection
slave
;
}
let
$row_number
=
1
;
let
$run
=
1
;
let
$counter
=
300
;
...
...
mysql-test/t/rpl_dual_pos_advance-slave.opt
→
mysql-test/
suite/rpl/
t/rpl_dual_pos_advance-slave.opt
View file @
cf50a67c
File moved
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
View file @
cf50a67c
...
...
@@ -12,6 +12,7 @@ source include/have_innodb.inc;
# set up "dual head"
let
$keep_connection
=
1
;
connection
slave
;
reset
master
;
...
...
@@ -67,11 +68,11 @@ connection master;
start
slave
until
master_log_file
=
"slave-bin.000001"
,
master_log_pos
=
195
;
# wait until it's started (the position below is the start of "CREATE
# TABLE t2") (otherwise wait_for_slave_to_stop may return at once)
# TABLE t2") (otherwise wait_for_slave_
sql_
to_stop may return at once)
select
master_pos_wait
(
"slave-bin.000001"
,
137
);
--
source
include
/
wait_for_slave_to_stop
.
inc
--
source
include
/
wait_for_slave_
sql_
to_stop
.
inc
# then BUG#13861 causes t3 to show up below (because stopped too
# late).
...
...
@@ -80,12 +81,12 @@ show tables;
# ensure that we do not break set @a=1; insert into t3 values(@a);
start
slave
until
master_log_file
=
"slave-bin.000001"
,
master_log_pos
=
438
;
--
source
include
/
wait_for_slave_to_stop
.
inc
--
source
include
/
wait_for_slave_
sql_
to_stop
.
inc
select
*
from
t3
;
# ensure that we do not break transaction
start
slave
until
master_log_file
=
"slave-bin.000001"
,
master_log_pos
=
663
;
--
source
include
/
wait_for_slave_to_stop
.
inc
--
source
include
/
wait_for_slave_
sql_
to_stop
.
inc
select
*
from
t3
;
start
slave
;
...
...
sql/rpl_rli.cc
View file @
cf50a67c
...
...
@@ -955,6 +955,11 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
Check if condition stated in UNTIL clause of START SLAVE is reached.
SYNOPSYS
Relay_log_info::is_until_satisfied()
master_beg_pos position of the beginning of to be executed event
(not log_pos member of the event that points to the
beginning of the following event)
DESCRIPTION
Checks if UNTIL condition is reached. Uses caching result of last
comparison of current log file name and target log file name. So cached
...
...
@@ -979,7 +984,7 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
false - condition not met
*/
bool
Relay_log_info
::
is_until_satisfied
()
bool
Relay_log_info
::
is_until_satisfied
(
my_off_t
master_beg_pos
)
{
const
char
*
log_name
;
ulonglong
log_pos
;
...
...
@@ -990,7 +995,7 @@ bool Relay_log_info::is_until_satisfied()
if
(
until_condition
==
UNTIL_MASTER_POS
)
{
log_name
=
group_master_log_name
;
log_pos
=
group_master_lo
g_pos
;
log_pos
=
master_be
g_pos
;
}
else
{
/* until_condition == UNTIL_RELAY_POS */
...
...
sql/rpl_rli.h
View file @
cf50a67c
...
...
@@ -296,7 +296,7 @@ class Relay_log_info : public Slave_reporting_capability
void
close_temporary_tables
();
/* Check if UNTIL condition is satisfied. See slave.cc for more. */
bool
is_until_satisfied
();
bool
is_until_satisfied
(
my_off_t
master_beg_pos
);
inline
ulonglong
until_pos
()
{
return
((
until_condition
==
UNTIL_MASTER_POS
)
?
group_master_log_pos
:
...
...
sql/slave.cc
View file @
cf50a67c
...
...
@@ -1990,7 +1990,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
This tests if the position of the beginning of the current event
hits the UNTIL barrier.
*/
if
(
rli
->
until_condition
!=
R
ELAY_LOG_INFO
::
UNTIL_NONE
&&
if
(
rli
->
until_condition
!=
R
elay_log_info
::
UNTIL_NONE
&&
rli
->
is_until_satisfied
((
rli
->
is_in_group
()
||
!
ev
->
log_pos
)
?
rli
->
group_master_log_pos
:
ev
->
log_pos
-
ev
->
data_written
))
...
...
@@ -2648,7 +2648,7 @@ Slave SQL thread aborted. Can't execute init_slave query");
do not want to wait for next event in this case.
*/
pthread_mutex_lock
(
&
rli
->
data_lock
);
if
(
rli
->
until_condition
!=
R
ELAY_LOG_INFO
::
UNTIL_NONE
&&
if
(
rli
->
until_condition
!=
R
elay_log_info
::
UNTIL_NONE
&&
rli
->
is_until_satisfied
(
rli
->
group_master_log_pos
))
{
char
buf
[
22
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment