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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
8b7391c9
Commit
8b7391c9
authored
Jan 22, 2001
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug in master_pos_wait(), got rid of sleep hack,
added test/sanity check for master_pos_wait()
parent
1385ffee
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
20 additions
and
27 deletions
+20
-27
mysql-test/r/rpl000016.result
mysql-test/r/rpl000016.result
+4
-0
mysql-test/t/rpl000001.test
mysql-test/t/rpl000001.test
+0
-1
mysql-test/t/rpl000002.test
mysql-test/t/rpl000002.test
+0
-1
mysql-test/t/rpl000003.test
mysql-test/t/rpl000003.test
+0
-1
mysql-test/t/rpl000007.test
mysql-test/t/rpl000007.test
+0
-1
mysql-test/t/rpl000008.test
mysql-test/t/rpl000008.test
+0
-1
mysql-test/t/rpl000009.test
mysql-test/t/rpl000009.test
+0
-1
mysql-test/t/rpl000010.test
mysql-test/t/rpl000010.test
+1
-1
mysql-test/t/rpl000011.test
mysql-test/t/rpl000011.test
+0
-2
mysql-test/t/rpl000012.test
mysql-test/t/rpl000012.test
+0
-1
mysql-test/t/rpl000013.test
mysql-test/t/rpl000013.test
+0
-1
mysql-test/t/rpl000014.test
mysql-test/t/rpl000014.test
+0
-1
mysql-test/t/rpl000015.test
mysql-test/t/rpl000015.test
+2
-2
mysql-test/t/rpl000016.test
mysql-test/t/rpl000016.test
+5
-3
sql/slave.cc
sql/slave.cc
+8
-10
No files found.
mysql-test/r/rpl000016.result
View file @
8b7391c9
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 60 master-bin.001 216 Yes
s
Could not break slave
Tried hard
...
...
@@ -7,6 +9,8 @@ master-bin.002
master-bin.003
Log_name
master-bin.003
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 60 master-bin.003 128 Yes
m
34
67
...
...
mysql-test/t/rpl000001.test
View file @
8b7391c9
...
...
@@ -12,7 +12,6 @@ insert into foo values(1),(2);
save_master_pos
;
connection
slave
;
sync_with_master
;
sleep
1
;
use
test
;
select
*
from
foo
;
select
sum
(
length
(
word
))
from
t1
;
...
...
mysql-test/t/rpl000002.test
View file @
8b7391c9
...
...
@@ -9,7 +9,6 @@ save_master_pos;
connection
slave
;
use
test
;
sync_with_master
;
sleep
1
;
@
r
/
rpl000002
.
result
select
*
from
t1
;
connection
master
;
drop
table
t1
;
...
...
mysql-test/t/rpl000003.test
View file @
8b7391c9
...
...
@@ -7,7 +7,6 @@ insert into t1 values (3);
save_master_pos
;
connection
slave
;
sync_with_master
;
sleep
1
;
@
r
/
rpl000003
.
result
select
*
from
t1
;
connection
master
;
drop
table
t1
;
...
...
mysql-test/t/rpl000007.test
View file @
8b7391c9
...
...
@@ -18,7 +18,6 @@ insert into bar values(15);
save_master_pos
;
connection
slave
;
sync_with_master
;
sleep
1
;
@
r
/
rpl000007
.
result
select
foo
.
n
,
bar
.
m
from
foo
,
bar
;
connection
master
;
drop
table
if
exists
bar
,
foo
;
...
...
mysql-test/t/rpl000008.test
View file @
8b7391c9
...
...
@@ -20,7 +20,6 @@ insert into choo values(55);
save_master_pos
;
connection
slave
;
sync_with_master
;
sleep
1
;
@
r
/
rpl000008
.
result
select
foo
.
n
,
bar
.
m
,
choo
.
k
from
foo
,
bar
,
choo
;
connection
master
;
drop
table
if
exists
foo
,
bar
,
choo
;
...
...
mysql-test/t/rpl000009.test
View file @
8b7391c9
...
...
@@ -22,7 +22,6 @@ insert into bar.bar values(15);
save_master_pos
;
connection
slave
;
sync_with_master
;
sleep
1
;
@
r
/
rpl000009
.
result
select
foo
.
foo
.
n
,
bar
.
bar
.
m
from
foo
.
foo
,
bar
.
bar
;
connection
master
;
drop
database
if
exists
bar
;
...
...
mysql-test/t/rpl000010.test
View file @
8b7391c9
...
...
@@ -11,10 +11,10 @@ insert into t1 values(2);
save_master_pos
;
connection
slave
;
sync_with_master
;
sleep
1
;
@
r
/
rpl000010
.
result
select
n
from
t1
;
connection
master
;
drop
table
t1
;
save_master_pos
;
connection
slave
;
sync_with_master
;
mysql-test/t/rpl000011.test
View file @
8b7391c9
...
...
@@ -6,7 +6,6 @@ create table t1 (n int);
insert
into
t1
values
(
1
);
save_master_pos
;
connection
slave
;
#give slave some breathing room to get started
sync_with_master
;
slave
stop
;
slave
start
;
...
...
@@ -16,7 +15,6 @@ save_master_pos;
connection
slave
;
#let slave catch up
sync_with_master
;
sleep
1
;
@
r
/
rpl000011
.
result
select
*
from
t1
;
connection
master
;
drop
table
t1
;
...
...
mysql-test/t/rpl000012.test
View file @
8b7391c9
...
...
@@ -19,7 +19,6 @@ connection master2;
save_master_pos
;
connection
slave
;
sync_with_master
;
sleep
1
;
@
r
/
rpl000012
.
result
select
*
from
t2
;
@
r
/
rpl000012
.
status
.
result
show
status
like
'Slave_open_temp_tables'
;
#
...
...
mysql-test/t/rpl000013.test
View file @
8b7391c9
...
...
@@ -22,7 +22,6 @@ connection master2;
save_master_pos
;
connection
slave
;
sync_with_master
;
sleep
1
;
@
r
/
rpl000013
.
result
select
*
from
t2
;
@
r
/
rpl000013
.
status
.
result
show
status
like
'Slave_open_temp_tables'
;
#
...
...
mysql-test/t/rpl000014.test
View file @
8b7391c9
...
...
@@ -24,7 +24,6 @@ save_master_pos;
connection
slave
;
change
master
to
master_log_pos
=
73
;
sync_with_master
;
sleep
1
;
select
*
from
foo
;
connection
master
;
drop
table
foo
;
...
...
mysql-test/t/rpl000015.test
View file @
8b7391c9
...
...
@@ -4,6 +4,7 @@ source include/have_default_master.inc;
connection
master
;
reset
master
;
show
master
status
;
save_master_pos
;
connection
slave
;
reset
slave
;
show
slave
status
;
...
...
@@ -13,7 +14,7 @@ change master to master_host='127.0.0.1',master_user='root',
master_password
=
''
,
master_port
=
9306
;
show
slave
status
;
slave
start
;
s
leep
3
;
s
ync_with_master
;
show
slave
status
;
connection
master
;
drop
table
if
exists
foo
;
...
...
@@ -22,7 +23,6 @@ insert into foo values (10),(45),(90);
save_master_pos
;
connection
slave
;
sync_with_master
;
sleep
1
;
select
*
from
foo
;
connection
master
;
drop
table
foo
;
...
...
mysql-test/t/rpl000016.test
View file @
8b7391c9
...
...
@@ -10,6 +10,9 @@ system chmod 600 var/slave-data/master.info;
!
change
master
to
master_host
=
'127.0.0.1'
,
master_port
=
9306
,
master_user
=
'root'
;
reset
slave
;
!
change
master
to
master_host
=
'127.0.0.1'
,
master_port
=
9306
,
master_user
=
'root'
;
connection
master
;
reset
master
;
connection
slave
;
slave
start
;
connection
master
;
drop
table
if
exists
t1
;
...
...
@@ -18,7 +21,7 @@ insert into t1 values('Could not break slave'),('Tried hard');
save_master_pos
;
connection
slave
;
sync_with_master
;
s
leep
1
;
s
how
slave
status
;
select
*
from
t1
;
connection
master
;
flush
logs
;
...
...
@@ -27,14 +30,13 @@ create table t2(m int);
insert
into
t2
values
(
34
),(
67
),(
123
);
flush
logs
;
show
master
logs
;
sleep
2
;
# If a slow machine
purge
master
logs
to
'master-bin.003'
;
show
master
logs
;
insert
into
t2
values
(
65
);
save_master_pos
;
connection
slave
;
sync_with_master
;
s
leep
1
;
s
how
slave
status
;
select
*
from
t2
;
drop
table
if
exists
t1
,
t2
;
connection
master
;
...
...
sql/slave.cc
View file @
8b7391c9
...
...
@@ -616,7 +616,7 @@ int st_master_info::wait_for_pos(THD* thd, String* log_name, ulong log_pos)
bool
pos_reached
;
int
event_count
=
0
;
pthread_mutex_lock
(
&
lock
);
do
while
(
!
thd
->
killed
)
{
int
cmp_result
;
if
(
*
log_file_name
)
...
...
@@ -638,15 +638,13 @@ int st_master_info::wait_for_pos(THD* thd, String* log_name, ulong log_pos)
pos_reached
=
((
!
cmp_result
&&
pos
>=
log_pos
)
||
cmp_result
>
0
);
if
(
pos_reached
||
thd
->
killed
)
break
;
{
const
char
*
msg
=
thd
->
enter_cond
(
&
cond
,
&
lock
,
"Waiting for master update"
);
pthread_cond_wait
(
&
cond
,
&
lock
);
thd
->
exit_cond
(
msg
);
event_count
++
;
pos_reached
=
(
pos
>=
log_pos
);
}
}
while
(
!
pos_reached
&&
!
thd
->
killed
);
const
char
*
msg
=
thd
->
enter_cond
(
&
cond
,
&
lock
,
"Waiting for master update"
);
pthread_cond_wait
(
&
cond
,
&
lock
);
thd
->
exit_cond
(
msg
);
event_count
++
;
}
pthread_mutex_unlock
(
&
lock
);
return
thd
->
killed
?
-
1
:
event_count
;
}
...
...
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