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
b3e38170
Commit
b3e38170
authored
Aug 26, 2019
by
Andrei Elkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-742 (intermediate commit)
typ == XID_EVENT || typ == XA_PREPARE_LOG_EVENT augmentation.
parent
21286d88
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
7 deletions
+27
-7
mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result
mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result
+1
-0
mysql-test/suite/rpl/t/rpl_xa.inc
mysql-test/suite/rpl/t/rpl_xa.inc
+18
-0
sql/log_event.cc
sql/log_event.cc
+2
-1
sql/rpl_parallel.cc
sql/rpl_parallel.cc
+2
-2
sql/rpl_rli.cc
sql/rpl_rli.cc
+2
-2
sql/sql_repl.cc
sql/sql_repl.cc
+2
-2
No files found.
mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result
View file @
b3e38170
...
...
@@ -35,6 +35,7 @@ xa start 's';
insert into t2 values (0);
xa end 's';
xa prepare 's';
include/save_master_gtid.inc
connection slave;
include/sync_with_master_gtid.inc
SELECT @@global.gtid_slave_pos = CONCAT(domain_id,"-",server_id,"-",seq_no) FROM mysql.gtid_slave_pos WHERE seq_no = (SELECT DISTINCT max(seq_no) FROM mysql.gtid_slave_pos);
...
...
mysql-test/suite/rpl/t/rpl_xa.inc
View file @
b3e38170
...
...
@@ -11,7 +11,25 @@ xa start 't';
insert
into
t1
values
(
1
,
2
);
xa
end
't'
;
xa
prepare
't'
;
# Debug with SLEEP
#
--
disable_query_log
--
disable_result_log
#select sleep(10000);
--
enable_result_log
--
enable_query_log
#
# End of Debug
xa
commit
't'
;
# Debug with SLEEP
#
--
disable_query_log
--
disable_result_log
#select sleep(10000);
--
enable_result_log
--
enable_query_log
#
# End of Debug
sync_slave_with_master
;
let
$diff_tables
=
master
:
t1
,
slave
:
t1
;
...
...
sql/log_event.cc
View file @
b3e38170
...
...
@@ -9006,7 +9006,8 @@ int Xid_apply_log_event::do_apply_event(rpl_group_info *rgi)
rpl_gtid
gtid
;
/*
XID_EVENT works like a COMMIT statement. And it also updates the
An instance of this class such as XID_EVENT works like a COMMIT
statement. As well as XA_PREPARE_LOG_EVENT it also updates
mysql.gtid_slave_pos table with the GTID of the current transaction.
Therefore, it acts much like a normal SQL statement, so we need to do
...
...
sql/rpl_parallel.cc
View file @
b3e38170
...
...
@@ -648,7 +648,7 @@ convert_kill_to_deadlock_error(rpl_group_info *rgi)
static
int
is_group_ending
(
Log_event
*
ev
,
Log_event_type
event_type
)
{
if
(
event_type
==
XID_EVENT
)
if
(
event_type
==
XID_EVENT
||
event_type
==
XA_PREPARE_LOG_EVENT
)
return
1
;
if
(
event_type
==
QUERY_EVENT
)
// COMMIT/ROLLBACK are never compressed
{
...
...
@@ -2615,7 +2615,7 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev,
else
{
DBUG_ASSERT
(
rli
->
gtid_skip_flag
==
GTID_SKIP_TRANSACTION
);
if
(
typ
==
XID_EVENT
||
if
(
typ
==
XID_EVENT
||
typ
==
XA_PREPARE_LOG_EVENT
||
(
typ
==
QUERY_EVENT
&&
// COMMIT/ROLLBACK are never compressed
(((
Query_log_event
*
)
ev
)
->
is_commit
()
||
((
Query_log_event
*
)
ev
)
->
is_rollback
())))
...
...
sql/rpl_rli.cc
View file @
b3e38170
...
...
@@ -2234,10 +2234,10 @@ void rpl_group_info::cleanup_context(THD *thd, bool error)
It could be done only after necessarily closing tables which dictates
the following placement.
*/
XID_STATE
*
xid_state
=
&
thd
->
transaction
.
xid_state
;
if
(
xid_state
->
is_explicit_XA
())
if
(
thd
->
transaction
.
xid_state
.
is_explicit_XA
())
{
xa_trans_force_rollback
(
thd
);
attach_native_trx
(
thd
);
}
thd
->
mdl_context
.
release_transactional_locks
();
...
...
sql/sql_repl.cc
View file @
b3e38170
...
...
@@ -1640,7 +1640,7 @@ is_until_reached(binlog_send_info *info, ulong *ev_offset,
return
false
;
break
;
case
GTID_UNTIL_STOP_AFTER_TRANSACTION
:
if
(
event_type
!=
XID_EVENT
&&
if
(
event_type
!=
XID_EVENT
&&
event_type
!=
XA_PREPARE_LOG_EVENT
&&
(
event_type
!=
QUERY_EVENT
||
/* QUERY_COMPRESSED_EVENT would never be commmit or rollback */
!
Query_log_event
::
peek_is_commit_rollback
(
info
->
packet
->
ptr
()
+*
ev_offset
,
...
...
@@ -1875,7 +1875,7 @@ send_event_to_slave(binlog_send_info *info, Log_event_type event_type,
info
->
gtid_skip_group
=
GTID_SKIP_NOT
;
return
NULL
;
case
GTID_SKIP_TRANSACTION
:
if
(
event_type
==
XID_EVENT
||
if
(
event_type
==
XID_EVENT
||
event_type
==
XA_PREPARE_LOG_EVENT
||
(
event_type
==
QUERY_EVENT
&&
/* QUERY_COMPRESSED_EVENT would never be commmit or rollback */
Query_log_event
::
peek_is_commit_rollback
(
packet
->
ptr
()
+
ev_offset
,
len
-
ev_offset
,
...
...
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