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
0f9acce3
Commit
0f9acce3
authored
Sep 14, 2023
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.5 into 10.6
parents
cce76df5
7de0c7b5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
59 additions
and
38 deletions
+59
-38
include/mysql/service_my_crypt.h
include/mysql/service_my_crypt.h
+1
-1
mysql-test/suite/galera/t/galera_as_slave_nonprim.test
mysql-test/suite/galera/t/galera_as_slave_nonprim.test
+0
-2
mysql-test/suite/rpl/r/rpl_xa_prepare_gtid_fail.result
mysql-test/suite/rpl/r/rpl_xa_prepare_gtid_fail.result
+10
-10
mysql-test/suite/rpl/t/rpl_xa_prepare_gtid_fail.test
mysql-test/suite/rpl/t/rpl_xa_prepare_gtid_fail.test
+16
-20
sql/log_event_server.cc
sql/log_event_server.cc
+2
-1
sql/rpl_parallel.cc
sql/rpl_parallel.cc
+15
-0
sql/slave.cc
sql/slave.cc
+13
-3
storage/innobase/buf/buf0rea.cc
storage/innobase/buf/buf0rea.cc
+2
-1
No files found.
include/mysql/service_my_crypt.h
View file @
0f9acce3
...
...
@@ -45,7 +45,7 @@ extern "C" {
/* The max key length of all supported algorithms */
#define MY_AES_MAX_KEY_LENGTH 32
#define MY_AES_CTX_SIZE 10
24
#define MY_AES_CTX_SIZE 10
40
enum
my_aes_mode
{
MY_AES_ECB
,
MY_AES_CBC
...
...
mysql-test/suite/galera/t/galera_as_slave_nonprim.test
View file @
0f9acce3
...
...
@@ -27,7 +27,6 @@ SET SESSION wsrep_sync_wait = 0;
CREATE
TABLE
t1
(
f1
INTEGER
PRIMARY
KEY
)
ENGINE
=
InnoDB
;
--
connection
node_2
--
sleep
1
--
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
INFORMATION_SCHEMA
.
TABLES
WHERE
TABLE_NAME
=
't1'
;
--
source
include
/
wait_condition
.
inc
...
...
@@ -47,7 +46,6 @@ INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
--
connection
node_2
--
sleep
5
--
let
$value
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_SQL_Error
,
1
)
--
connection
node_1
--
disable_query_log
...
...
mysql-test/suite/rpl/r/rpl_xa_prepare_gtid_fail.result
View file @
0f9acce3
...
...
@@ -2,14 +2,14 @@ include/master-slave.inc
[connection master]
connection slave;
include/stop_slave.inc
set @save_par_thds= @@global.slave_parallel_threads;
set @save_strict_mode= @@global.gtid_strict_mode;
set @save_innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
change master to master_use_gtid=slave_pos;
set @@global.slave_parallel_threads= 4;
set @@global.slave_parallel_mode= optimistic;
set @@global.gtid_strict_mode=ON;
set sql_log_bin= 0;
alter table mysql.gtid_slave_pos engine=innodb;
call mtr.add_suppression("Deadlock found.*");
set sql_log_bin= 1;
set statement sql_log_bin=0 for alter table mysql.gtid_slave_pos engine=innodb;
include/start_slave.inc
connection master;
create table t1 (a int primary key, b int) engine=innodb;
...
...
@@ -27,25 +27,25 @@ xa end '1';
xa prepare '1';
xa commit '1';
include/save_master_gtid.inc
connection slave;
connection slave1;
BEGIN;
SELECT * FROM mysql.gtid_slave_pos WHERE seq_no=100 FOR UPDATE;
domain_id sub_id server_id seq_no
connection slave;
include/start_slave.inc
include/wait_for_slave_sql_error.inc [errno=1942,1213]
include/wait_for_slave_sql_error.inc [errno=1942]
include/stop_slave_io.inc
connection slave1;
ROLLBACK;
# Cleanup
connection master;
drop table t1;
connection slave;
include/stop_slave.inc
# TODO: Remove after fixing MDEV-21777
set @@global.gtid_slave_pos= "0-1-100";
set @@global.slave_parallel_threads=
0
;
set @@global.gtid_strict_mode=
0
;
set @@global.innodb_lock_wait_timeout=
50
;
set @@global.slave_parallel_threads=
@save_par_thds
;
set @@global.gtid_strict_mode=
@save_strict_mode
;
set @@global.innodb_lock_wait_timeout=
@save_innodb_lock_wait_timeout
;
include/start_slave.inc
include/rpl_end.inc
# End of rpl_xa_prepare_gtid_fail.test
mysql-test/suite/rpl/t/rpl_xa_prepare_gtid_fail.test
View file @
0f9acce3
...
...
@@ -6,8 +6,8 @@
# GTID slave state, then the slave should immediately quit in error, without
# retry.
#
# This tests validates the above behavior by
simulating a deadlock on the
# GTID slave state table during the second part of XA PREPARE's commit, to
# This tests validates the above behavior by
forcing a lock-wait timeout on
#
the
GTID slave state table during the second part of XA PREPARE's commit, to
# ensure that the appropriate error is reported and the transaction was never
# retried.
#
...
...
@@ -23,23 +23,19 @@ source include/have_innodb.inc;
--
connection
slave
--
source
include
/
stop_slave
.
inc
--
let
$save_par_thds
=
`SELECT @@global.slave_parallel_threads`
--
let
$save_strict_mode
=
`SELECT @@global.gtid_strict_mode`
--
let
$save_innodb_lock_wait_timeout
=
`SELECT @@global.innodb_lock_wait_timeout`
set
@
save_par_thds
=
@@
global
.
slave_parallel_threads
;
set
@
save_strict_mode
=
@@
global
.
gtid_strict_mode
;
set
@
save_innodb_lock_wait_timeout
=
@@
global
.
innodb_lock_wait_timeout
;
change
master
to
master_use_gtid
=
slave_pos
;
set
@@
global
.
slave_parallel_threads
=
4
;
set
@@
global
.
slave_parallel_mode
=
optimistic
;
set
@@
global
.
gtid_strict_mode
=
ON
;
set
sql_log_bin
=
0
;
alter
table
mysql
.
gtid_slave_pos
engine
=
innodb
;
call
mtr
.
add_suppression
(
"Deadlock found.*"
);
set
sql_log_bin
=
1
;
set
statement
sql_log_bin
=
0
for
alter
table
mysql
.
gtid_slave_pos
engine
=
innodb
;
--
source
include
/
start_slave
.
inc
--
connection
master
let
$datadir
=
`select @@datadir`
;
create
table
t1
(
a
int
primary
key
,
b
int
)
engine
=
innodb
;
insert
t1
values
(
1
,
1
);
--
source
include
/
save_master_gtid
.
inc
...
...
@@ -64,11 +60,6 @@ xa prepare '1';
xa
commit
'1'
;
--
source
include
/
save_master_gtid
.
inc
--
connection
slave
#--eval set statement sql_log_bin=0 for insert into mysql.gtid_slave_pos values ($gtid_domain_id, 5, $gtid_server_id, $xap_seq_no)
--
connection
slave1
BEGIN
;
--
eval
SELECT
*
FROM
mysql
.
gtid_slave_pos
WHERE
seq_no
=
$xap_seq_no
FOR
UPDATE
...
...
@@ -76,9 +67,14 @@ BEGIN;
--
connection
slave
--
source
include
/
start_slave
.
inc
--
let
$slave_sql_errno
=
1942
,
1213
--
let
$slave_sql_errno
=
1942
--
source
include
/
wait_for_slave_sql_error
.
inc
# TODO: Remove after fixing MDEV-21777
# Stop the IO thread too, so the existing relay logs are force purged on slave
# restart, as to not re-execute the already-prepared transaction
--
source
include
/
stop_slave_io
.
inc
--
let
$retried_tx_test
=
query_get_value
(
SHOW
ALL
SLAVES
STATUS
,
Retried_transactions
,
1
)
if
(
$retried_tx_initial
!=
$retried_tx_test
)
{
...
...
@@ -95,11 +91,11 @@ ROLLBACK;
drop
table
t1
;
--
connection
slave
--
source
include
/
stop_slave
.
inc
--
echo
# TODO: Remove after fixing MDEV-21777
--
eval
set
@@
global
.
gtid_slave_pos
=
"
$new_gtid
"
--
eval
set
@@
global
.
slave_parallel_threads
=
$save_par_thds
--
eval
set
@@
global
.
gtid_strict_mode
=
$save_strict_mode
--
eval
set
@@
global
.
innodb_lock_wait_timeout
=
$save_innodb_lock_wait_timeout
set
@@
global
.
slave_parallel_threads
=
@
save_par_thds
;
set
@@
global
.
gtid_strict_mode
=
@
save_strict_mode
;
set
@@
global
.
innodb_lock_wait_timeout
=
@
save_innodb_lock_wait_timeout
;
--
source
include
/
start_slave
.
inc
--
source
include
/
rpl_end
.
inc
...
...
sql/log_event_server.cc
View file @
0f9acce3
...
...
@@ -5778,7 +5778,8 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
ignored_error_code
(
actual_error
)
:
0
);
#ifdef WITH_WSREP
if
(
WSREP
(
thd
)
&&
wsrep_ignored_error_code
(
this
,
actual_error
))
if
(
WSREP
(
thd
)
&&
thd
->
wsrep_applier
&&
wsrep_ignored_error_code
(
this
,
actual_error
))
{
idempotent_error
=
true
;
thd
->
wsrep_has_ignored_error
=
true
;
...
...
sql/rpl_parallel.cc
View file @
0f9acce3
...
...
@@ -820,6 +820,10 @@ retry_event_group(rpl_group_info *rgi, rpl_parallel_thread *rpt,
event_count
=
0
;
err
=
0
;
errmsg
=
NULL
;
#ifdef WITH_WSREP
thd
->
wsrep_cs
().
reset_error
();
WSREP_DEBUG
(
"retrying async replication event"
);
#endif
/* WITH_WSREP */
/*
If we already started committing before getting the deadlock (or other
...
...
@@ -920,6 +924,7 @@ retry_event_group(rpl_group_info *rgi, rpl_parallel_thread *rpt,
err
=
rgi
->
worker_error
=
1
;
my_error
(
ER_PRIOR_COMMIT_FAILED
,
MYF
(
0
));
mysql_mutex_unlock
(
&
entry
->
LOCK_parallel_entry
);
goto
err
;
}
mysql_mutex_unlock
(
&
entry
->
LOCK_parallel_entry
);
...
...
@@ -961,7 +966,17 @@ retry_event_group(rpl_group_info *rgi, rpl_parallel_thread *rpt,
possibility of an old deadlock kill lingering on beyond this point.
*/
thd
->
reset_killed
();
#ifdef WITH_WSREP
if
(
wsrep_before_command
(
thd
))
{
WSREP_WARN
(
"Parallel slave worker failed at wsrep_before_command() hook"
);
err
=
1
;
goto
err
;
}
wsrep_start_trx_if_not_started
(
thd
);
WSREP_DEBUG
(
"parallel slave retry, after trx start"
);
#endif
/* WITH_WSREP */
strmake_buf
(
log_name
,
ir
->
name
);
if
((
fd
=
open_binlog
(
&
rlog
,
log_name
,
&
errmsg
))
<
0
)
{
...
...
sql/slave.cc
View file @
0f9acce3
...
...
@@ -3908,9 +3908,19 @@ apply_event_and_update_pos_apply(Log_event* ev, THD* thd, rpl_group_info *rgi,
default:
WSREP_DEBUG
(
"SQL apply failed, res %d conflict state: %s"
,
exec_res
,
wsrep_thd_transaction_state_str
(
thd
));
rli
->
abort_slave
=
1
;
rli
->
report
(
ERROR_LEVEL
,
ER_UNKNOWN_COM_ERROR
,
rgi
->
gtid_info
(),
"Node has dropped from cluster"
);
/*
async replication thread should be stopped, if failure was
not due to optimistic parallel applying or if node
has dropped from cluster
*/
if
(
thd
->
system_thread
==
SYSTEM_THREAD_SLAVE_SQL
&&
((
rli
->
mi
->
using_parallel
()
&&
rli
->
mi
->
parallel_mode
<=
SLAVE_PARALLEL_CONSERVATIVE
)
||
wsrep_ready
==
0
))
{
rli
->
abort_slave
=
1
;
rli
->
report
(
ERROR_LEVEL
,
ER_UNKNOWN_COM_ERROR
,
rgi
->
gtid_info
(),
"Node has dropped from cluster"
);
}
break
;
}
mysql_mutex_unlock
(
&
thd
->
LOCK_thd_data
);
...
...
storage/innobase/buf/buf0rea.cc
View file @
0f9acce3
...
...
@@ -318,7 +318,8 @@ buf_read_page_low(
auto
fio
=
space
->
io
(
IORequest
(
sync
?
IORequest
::
READ_SYNC
:
IORequest
::
READ_ASYNC
),
page_id
.
page_no
()
*
len
,
len
,
dst
,
bpage
);
os_offset_t
{
page_id
.
page_no
()}
*
len
,
len
,
dst
,
bpage
);
if
(
UNIV_UNLIKELY
(
fio
.
err
!=
DB_SUCCESS
))
{
buf_pool
.
corrupted_evict
(
bpage
,
buf_page_t
::
READ_FIX
);
...
...
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