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
3c97d24f
Commit
3c97d24f
authored
Feb 08, 2014
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-4984: Implement MASTER_GTID_WAIT() and @@LAST_GTID.
Couple of small fixes following buildbot testing.
parent
7bb022f3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
12 deletions
+17
-12
mysql-test/include/sync_with_master_gtid.inc
mysql-test/include/sync_with_master_gtid.inc
+2
-1
mysql-test/suite/rpl/r/rpl_gtid_basic.result
mysql-test/suite/rpl/r/rpl_gtid_basic.result
+5
-5
mysql-test/suite/rpl/t/rpl_gtid_basic.test
mysql-test/suite/rpl/t/rpl_gtid_basic.test
+3
-1
mysql-test/suite/sys_vars/t/last_gtid_basic.test
mysql-test/suite/sys_vars/t/last_gtid_basic.test
+2
-0
sql/rpl_gtid.cc
sql/rpl_gtid.cc
+5
-5
No files found.
mysql-test/include/sync_with_master_gtid.inc
View file @
3c97d24f
...
@@ -40,7 +40,8 @@ if (!$_slave_timeout)
...
@@ -40,7 +40,8 @@ if (!$_slave_timeout)
if
(
$_result
==
-
1
)
if
(
$_result
==
-
1
)
{
{
--
let
$_current_gtid_pos
=
`SELECT @@GLOBAL.gtid_slave_pos`
--
let
$_current_gtid_pos
=
`SELECT @@GLOBAL.gtid_slave_pos`
--
die
Timeout
in
master_gtid_wait
(
'$master_pos'
,
$_slave_timeout
),
current
slave
GTID
position
is
:
$_current_gtid_pos
.
--
echo
Timeout
in
master_gtid_wait
(
'$master_pos'
,
$_slave_timeout
),
current
slave
GTID
position
is
:
$_current_gtid_pos
.
--
die
Failed
to
sync
with
master
}
}
--
let
$include_filename
=
sync_with_master_gtid
.
inc
--
let
$include_filename
=
sync_with_master_gtid
.
inc
...
...
mysql-test/suite/rpl/r/rpl_gtid_basic.result
View file @
3c97d24f
...
@@ -272,7 +272,7 @@ SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
...
@@ -272,7 +272,7 @@ SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
SELECT master_gtid_wait('0-1-1000', 0.5);
SELECT master_gtid_wait('0-1-1000', 0.5);
SELECT master_gtid_wait('0-1-2000');
SELECT master_gtid_wait('0-1-2000');
SELECT master_gtid_wait('2-1-10');
SELECT master_gtid_wait('2-1-10');
SELECT master_gtid_wait('2-1-
5
', 1);
SELECT master_gtid_wait('2-1-
6
', 1);
SELECT master_gtid_wait('2-1-5');
SELECT master_gtid_wait('2-1-5');
SELECT master_gtid_wait('2-1-10');
SELECT master_gtid_wait('2-1-10');
SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
...
@@ -284,14 +284,14 @@ SELECT master_gtid_wait('0-1-109');
...
@@ -284,14 +284,14 @@ SELECT master_gtid_wait('0-1-109');
SELECT master_gtid_wait('2-1-2', 0.5);
SELECT master_gtid_wait('2-1-2', 0.5);
master_gtid_wait('2-1-2', 0.5)
master_gtid_wait('2-1-2', 0.5)
-1
-1
KILL QUERY
22
;
KILL QUERY
KILL_ID
;
ERROR 70100: Query execution was interrupted
ERROR 70100: Query execution was interrupted
SET gtid_domain_id=2;
SET gtid_domain_id=2;
SET gtid_seq_no=2;
SET gtid_seq_no=2;
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (4);
master_gtid_wait('2-1-2')
master_gtid_wait('2-1-2')
0
0
KILL CONNECTION
25
;
KILL CONNECTION
KILL_ID
;
ERROR HY000: Lost connection to MySQL server during query
ERROR HY000: Lost connection to MySQL server during query
SET gtid_domain_id=1;
SET gtid_domain_id=1;
SET gtid_seq_no=4;
SET gtid_seq_no=4;
...
@@ -305,8 +305,8 @@ master_gtid_wait('2-1-1,1-1-4,0-1-110')
...
@@ -305,8 +305,8 @@ master_gtid_wait('2-1-1,1-1-4,0-1-110')
0
0
master_gtid_wait('0-1-1000', 0.5)
master_gtid_wait('0-1-1000', 0.5)
-1
-1
master_gtid_wait('2-1-
5
', 1)
master_gtid_wait('2-1-
6
', 1)
0
-1
master_gtid_wait('0-1-109')
master_gtid_wait('0-1-109')
0
0
SET gtid_domain_id=2;
SET gtid_domain_id=2;
...
...
mysql-test/suite/rpl/t/rpl_gtid_basic.test
View file @
3c97d24f
...
@@ -287,7 +287,7 @@ send SELECT master_gtid_wait('0-1-2000');
...
@@ -287,7 +287,7 @@ send SELECT master_gtid_wait('0-1-2000');
send
SELECT
master_gtid_wait
(
'2-1-10'
);
send
SELECT
master_gtid_wait
(
'2-1-10'
);
--
connect
(
s5
,
127.0
.
0.1
,
root
,,
test
,
$SERVER_MYPORT_2
,)
--
connect
(
s5
,
127.0
.
0.1
,
root
,,
test
,
$SERVER_MYPORT_2
,)
send
SELECT
master_gtid_wait
(
'2-1-
5
'
,
1
);
send
SELECT
master_gtid_wait
(
'2-1-
6
'
,
1
);
# This one we will kill also.
# This one we will kill also.
--
connect
(
s6
,
127.0
.
0.1
,
root
,,
test
,
$SERVER_MYPORT_2
,)
--
connect
(
s6
,
127.0
.
0.1
,
root
,,
test
,
$SERVER_MYPORT_2
,)
...
@@ -314,6 +314,7 @@ send SELECT master_gtid_wait('0-1-109');
...
@@ -314,6 +314,7 @@ send SELECT master_gtid_wait('0-1-109');
# This one should time out.
# This one should time out.
SELECT
master_gtid_wait
(
'2-1-2'
,
0.5
);
SELECT
master_gtid_wait
(
'2-1-2'
,
0.5
);
--
replace_result
$kill1_id
KILL_ID
eval
KILL
QUERY
$kill1_id
;
eval
KILL
QUERY
$kill1_id
;
--
connection
s3
--
connection
s3
--
error
ER_QUERY_INTERRUPTED
--
error
ER_QUERY_INTERRUPTED
...
@@ -328,6 +329,7 @@ INSERT INTO t1 VALUES (4);
...
@@ -328,6 +329,7 @@ INSERT INTO t1 VALUES (4);
reap
;
reap
;
--
connection
server_2
--
connection
server_2
--
replace_result
$kill2_id
KILL_ID
eval
KILL
CONNECTION
$kill2_id
;
eval
KILL
CONNECTION
$kill2_id
;
--
connection
s6
--
connection
s6
...
...
mysql-test/suite/sys_vars/t/last_gtid_basic.test
View file @
3c97d24f
--
source
include
/
not_embedded
.
inc
--
error
ER_INCORRECT_GLOBAL_LOCAL_VAR
--
error
ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT
@@
global
.
last_gtid
;
SELECT
@@
global
.
last_gtid
;
...
...
sql/rpl_gtid.cc
View file @
3c97d24f
...
@@ -1792,7 +1792,7 @@ gtid_waiting::wait_for_gtid(THD *thd, rpl_gtid *wait_gtid,
...
@@ -1792,7 +1792,7 @@ gtid_waiting::wait_for_gtid(THD *thd, rpl_gtid *wait_gtid,
bool
timed_out
=
false
;
bool
timed_out
=
false
;
#ifdef HAVE_REPLICATION
#ifdef HAVE_REPLICATION
queue_element
elem
;
queue_element
elem
;
uint32
_t
domain_id
=
wait_gtid
->
domain_id
;
uint32
domain_id
=
wait_gtid
->
domain_id
;
uint64
seq_no
=
wait_gtid
->
seq_no
;
uint64
seq_no
=
wait_gtid
->
seq_no
;
hash_element
*
he
;
hash_element
*
he
;
rpl_slave_state
::
element
*
slave_state_elem
=
NULL
;
rpl_slave_state
::
element
*
slave_state_elem
=
NULL
;
...
@@ -1958,10 +1958,6 @@ gtid_waiting::wait_for_gtid(THD *thd, rpl_gtid *wait_gtid,
...
@@ -1958,10 +1958,6 @@ gtid_waiting::wait_for_gtid(THD *thd, rpl_gtid *wait_gtid,
thd_wait_end
(
thd
);
thd_wait_end
(
thd
);
}
}
if
(
elem
.
wakeup_reason
==
queue_element
::
DONE
)
break
;
takeover
=
true
;
if
(
thd
->
killed
||
timed_out
)
if
(
thd
->
killed
||
timed_out
)
{
{
remove_from_wait_hash
(
he
,
&
elem
);
remove_from_wait_hash
(
he
,
&
elem
);
...
@@ -1975,6 +1971,10 @@ gtid_waiting::wait_for_gtid(THD *thd, rpl_gtid *wait_gtid,
...
@@ -1975,6 +1971,10 @@ gtid_waiting::wait_for_gtid(THD *thd, rpl_gtid *wait_gtid,
thd
->
send_kill_message
();
thd
->
send_kill_message
();
break
;
break
;
}
}
if
(
elem
.
wakeup_reason
==
queue_element
::
DONE
)
break
;
takeover
=
true
;
}
}
if
(
did_enter_cond
)
if
(
did_enter_cond
)
...
...
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