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
f176248d
Commit
f176248d
authored
Sep 17, 2024
by
Julius Goryavsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.6' into '10.11'
parents
b1874147
80fff4c6
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
642 additions
and
491 deletions
+642
-491
client/mysqlbinlog.cc
client/mysqlbinlog.cc
+29
-1
mysql-test/suite/binlog/r/binlog_mysqlbinlog_warn_stop_datetime.result
...ite/binlog/r/binlog_mysqlbinlog_warn_stop_datetime.result
+23
-0
mysql-test/suite/binlog/r/binlog_mysqlbinlog_warn_stop_position.result
...ite/binlog/r/binlog_mysqlbinlog_warn_stop_position.result
+13
-0
mysql-test/suite/binlog/t/binlog_mysqlbinlog_warn_stop_datetime.test
...suite/binlog/t/binlog_mysqlbinlog_warn_stop_datetime.test
+42
-0
mysql-test/suite/binlog/t/binlog_mysqlbinlog_warn_stop_position.test
...suite/binlog/t/binlog_mysqlbinlog_warn_stop_position.test
+26
-0
mysql-test/suite/galera/r/GCF-939.result
mysql-test/suite/galera/r/GCF-939.result
+5
-1
mysql-test/suite/galera/t/GCF-939.test
mysql-test/suite/galera/t/GCF-939.test
+5
-1
mysql-test/suite/galera/t/galera_fk_lock_wait.cnf
mysql-test/suite/galera/t/galera_fk_lock_wait.cnf
+11
-0
mysql-test/suite/galera/t/galera_fk_lock_wait.test
mysql-test/suite/galera/t/galera_fk_lock_wait.test
+1
-0
mysql-test/suite/galera_3nodes/r/GCF-354.result
mysql-test/suite/galera_3nodes/r/GCF-354.result
+3
-6
mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result
...est/suite/galera_3nodes/r/galera_safe_to_bootstrap.result
+2
-0
mysql-test/suite/galera_3nodes/t/GCF-354.test
mysql-test/suite/galera_3nodes/t/GCF-354.test
+6
-4
mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test
...-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test
+2
-0
scripts/wsrep_sst_backup.sh
scripts/wsrep_sst_backup.sh
+15
-33
scripts/wsrep_sst_common.sh
scripts/wsrep_sst_common.sh
+234
-68
scripts/wsrep_sst_mariabackup.sh
scripts/wsrep_sst_mariabackup.sh
+56
-154
scripts/wsrep_sst_mysqldump.sh
scripts/wsrep_sst_mysqldump.sh
+20
-3
scripts/wsrep_sst_rsync.sh
scripts/wsrep_sst_rsync.sh
+134
-207
sql/mf_iocache_encr.cc
sql/mf_iocache_encr.cc
+2
-2
sql/sql_insert.cc
sql/sql_insert.cc
+0
-1
sql/wsrep_sst.cc
sql/wsrep_sst.cc
+2
-0
storage/innobase/fil/fil0fil.cc
storage/innobase/fil/fil0fil.cc
+7
-6
unittest/mysys/stacktrace-t.c
unittest/mysys/stacktrace-t.c
+4
-4
No files found.
client/mysqlbinlog.cc
View file @
f176248d
...
...
@@ -148,6 +148,7 @@ static char *ignore_server_ids_str, *do_server_ids_str;
static
char
*
start_pos_str
,
*
stop_pos_str
;
static
ulonglong
start_position
=
BIN_LOG_HEADER_SIZE
,
stop_position
=
(
longlong
)(
~
(
my_off_t
)
0
)
;
static
const
longlong
stop_position_default
=
(
longlong
)(
~
(
my_off_t
)
0
);
#define start_position_mot ((my_off_t)start_position)
#define stop_position_mot ((my_off_t)stop_position)
...
...
@@ -3392,6 +3393,7 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
IO_CACHE
cache
,
*
file
=
&
cache
;
uchar
tmp_buff
[
BIN_LOG_HEADER_SIZE
];
Exit_status
retval
=
OK_CONTINUE
;
my_time_t
last_ev_when
=
MY_TIME_T_MAX
;
if
(
logname
&&
strcmp
(
logname
,
"-"
)
!=
0
)
{
...
...
@@ -3483,9 +3485,35 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
llstr
(
old_off
,
llbuff
));
goto
err
;
}
// file->error == 0 means EOF, that's OK, we break in this case
// else file->error == 0 means EOF, that's OK, we break in this case
/*
Emit a warning in the event that we finished processing input
before reaching the boundary indicated by --stop-position.
*/
if
(((
longlong
)
stop_position
!=
stop_position_default
)
&&
stop_position
>
my_b_tell
(
file
))
{
retval
=
OK_STOP
;
warning
(
"Did not reach stop position %llu before "
"end of input"
,
stop_position
);
}
/*
Emit a warning in the event that we finished processing input
before reaching the boundary indicated by --stop-datetime.
*/
if
(
stop_datetime
!=
MY_TIME_T_MAX
&&
stop_datetime
>
last_ev_when
)
{
retval
=
OK_STOP
;
warning
(
"Did not reach stop datetime '%s' "
"before end of input"
,
stop_datetime_str
);
}
goto
end
;
}
last_ev_when
=
ev
->
when
;
if
((
retval
=
process_event
(
print_event_info
,
ev
,
old_off
,
logname
))
!=
OK_CONTINUE
)
goto
end
;
...
...
mysql-test/suite/binlog/r/binlog_mysqlbinlog_warn_stop_datetime.result
0 → 100644
View file @
f176248d
# MDEV-27037 mysqlbinlog emits a warning when reaching EOF before stop-datetime
set timestamp=1000000000;
CREATE TABLE t1(word VARCHAR(20));
set timestamp=1000000010;
INSERT INTO t1 VALUES ("abirvalg");
set timestamp=1000000020;
INSERT INTO t1 SELECT * FROM t1;
flush logs;
Case: Default, must not see warning.
# MYSQL_BINLOG --short-form MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
Case: Stop datetime before EOF, must not see warning.
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:50' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
Case: Stop datetime between records, must not see warning.
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
Case: Stop datetime at EOF, must not see warning.
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
Case: Stop datetime after EOF, must see warning.
# MYSQL_BINLOG --short-form --stop-datetime='2035-01-19 03:14:05' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
WARNING: Did not reach stop datetime '2035-01-19 03:14:05' before end of input
DROP TABLE t1;
# End of binlog_mysqlbinlog_warn_stop_datetime.test
mysql-test/suite/binlog/r/binlog_mysqlbinlog_warn_stop_position.result
0 → 100644
View file @
f176248d
# MDEV-27037 mysqlbinlog emits a warning when reaching EOF before stop-condition
Case: Default stop position, WARNING must not appear
# MYSQL_BINLOG --short-form --start-position=4 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
Case: Stop position before EOF, WARNING must not appear
# MYSQL_BINLOG --short-form --start-position=4 --stop-position=97 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
Case: Stop position at EOF, WARNING must not appear
# MYSQL_BINLOG --short-form --start-position=4 --stop-position=98 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
Case: Stop position after EOF, WARNING must appear
# MYSQL_BINLOG --short-form --start-position=4 --stop-position=99 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
WARNING: Did not reach stop position 99 before end of input
# End of binlog_mysqlbinlog_warn_stop_position.test
mysql-test/suite/binlog/t/binlog_mysqlbinlog_warn_stop_datetime.test
0 → 100644
View file @
f176248d
--
echo
--
echo
# MDEV-27037 mysqlbinlog emits a warning when reaching EOF before stop-datetime
--
echo
--
source
include
/
have_binlog_format_statement
.
inc
--
let
ignored_output_file
=
$MYSQLTEST_VARDIR
/
tmp
/
warn_pos_test_file
.
out
set
timestamp
=
1000000000
;
CREATE
TABLE
t1
(
word
VARCHAR
(
20
));
set
timestamp
=
1000000010
;
INSERT
INTO
t1
VALUES
(
"abirvalg"
);
set
timestamp
=
1000000020
;
INSERT
INTO
t1
SELECT
*
FROM
t1
;
--
let
MYSQLD_DATADIR
=
`select @@datadir;`
flush
logs
;
--
echo
Case
:
Default
,
must
not
see
warning
.
--
echo
# MYSQL_BINLOG --short-form MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
--
exec
$MYSQL_BINLOG
--
short
-
form
$MYSQLD_DATADIR
/
master
-
bin
.
000001
--
result
-
file
=
$ignored_output_file
2
>&
1
--
echo
Case
:
Stop
datetime
before
EOF
,
must
not
see
warning
.
--
echo
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:50' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
--
exec
$MYSQL_BINLOG
--
short
-
form
--
stop
-
datetime
=
'2001-09-08 21:46:50'
$MYSQLD_DATADIR
/
master
-
bin
.
000001
--
result
-
file
=
$ignored_output_file
2
>&
1
--
echo
Case
:
Stop
datetime
between
records
,
must
not
see
warning
.
--
echo
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
--
exec
$MYSQL_BINLOG
--
short
-
form
--
stop
-
datetime
=
'2001-09-08 21:46:55'
$MYSQLD_DATADIR
/
master
-
bin
.
000001
--
result
-
file
=
$ignored_output_file
2
>&
1
--
echo
Case
:
Stop
datetime
at
EOF
,
must
not
see
warning
.
--
echo
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
--
exec
$MYSQL_BINLOG
--
short
-
form
--
stop
-
datetime
=
'2001-09-08 21:46:55'
$MYSQLD_DATADIR
/
master
-
bin
.
000001
--
result
-
file
=
$ignored_output_file
2
>&
1
--
echo
Case
:
Stop
datetime
after
EOF
,
must
see
warning
.
--
echo
# MYSQL_BINLOG --short-form --stop-datetime='2035-01-19 03:14:05' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
--
exec
$MYSQL_BINLOG
--
short
-
form
--
stop
-
datetime
=
'2035-01-19 03:14:05'
$MYSQLD_DATADIR
/
master
-
bin
.
000001
--
result
-
file
=
$ignored_output_file
2
>&
1
DROP
TABLE
t1
;
--
remove_file
$ignored_output_file
--
echo
# End of binlog_mysqlbinlog_warn_stop_datetime.test
mysql-test/suite/binlog/t/binlog_mysqlbinlog_warn_stop_position.test
0 → 100644
View file @
f176248d
--
echo
--
echo
# MDEV-27037 mysqlbinlog emits a warning when reaching EOF before stop-condition
--
echo
--
let
assert_file
=
$MYSQLTEST_VARDIR
/
tmp
/
warn_pos_test_file
.
out
--
let
data_file
=
$MYSQLTEST_VARDIR
/
std_data
/
master
-
bin
.
000001
--
echo
Case
:
Default
stop
position
,
WARNING
must
not
appear
--
echo
# MYSQL_BINLOG --short-form --start-position=4 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
--
exec
$MYSQL_BINLOG
--
short
-
form
--
start
-
position
=
4
$data_file
--
result
-
file
=
$assert_file
2
>&
1
--
echo
Case
:
Stop
position
before
EOF
,
WARNING
must
not
appear
--
echo
# MYSQL_BINLOG --short-form --start-position=4 --stop-position=97 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
--
exec
$MYSQL_BINLOG
--
short
-
form
--
start
-
position
=
4
--
stop
-
position
=
97
$data_file
--
result
-
file
=
$assert_file
2
>&
1
--
echo
Case
:
Stop
position
at
EOF
,
WARNING
must
not
appear
--
echo
# MYSQL_BINLOG --short-form --start-position=4 --stop-position=98 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
--
exec
$MYSQL_BINLOG
--
short
-
form
--
start
-
position
=
4
--
stop
-
position
=
98
$data_file
--
result
-
file
=
$assert_file
2
>&
1
--
echo
Case
:
Stop
position
after
EOF
,
WARNING
must
appear
--
echo
# MYSQL_BINLOG --short-form --start-position=4 --stop-position=99 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
--
exec
$MYSQL_BINLOG
--
short
-
form
--
start
-
position
=
4
--
stop
-
position
=
99
$data_file
--
result
-
file
=
$assert_file
2
>&
1
--
remove_file
$assert_file
--
echo
# End of binlog_mysqlbinlog_warn_stop_position.test
mysql-test/suite/galera/r/GCF-939.result
View file @
f176248d
...
...
@@ -5,7 +5,11 @@ DROP TABLE t1;
ERROR 42S02: Unknown table 'test.t1'
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
GRA_.log
connection node_2;
SELECT * FROM t1;
f1
1
connection node_1;
GRA_.log
DROP TABLE t1;
CALL mtr.add_suppression("Ignoring error 'Unknown table 'test\\.t1'' on query");
...
...
mysql-test/suite/galera/t/GCF-939.test
View file @
f176248d
...
...
@@ -13,6 +13,11 @@ DROP TABLE t1;
CREATE
TABLE
t1
(
f1
INTEGER
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
1
);
--
connection
node_2
SELECT
*
FROM
t1
;
--
connection
node_1
# Expect only one GRA_*.log file
# TODO replace_regex is somehow broken, it will filter out
# result totally if replacement string is already in result
...
...
@@ -20,7 +25,6 @@ INSERT INTO t1 VALUES (1);
# to get GRA_.log two times, this works for some reason
#
--
replace_regex
/
GRA_
.+
\
.
log
/
GRA_
.
log
/
--
list_files
$MYSQLTEST_VARDIR
/
mysqld
.
2
/
data
GRA_
*.
log
--
replace_regex
/
GRA_
.+
\
.
log
/
GRA_
.
log
/
--
list_files
$MYSQLTEST_VARDIR
/
mysqld
.
2
/
data
GRA_
*.
log
...
...
mysql-test/suite/galera/t/galera_fk_lock_wait.cnf
0 → 100644
View file @
f176248d
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep-debug=1
auto_increment_offset=1
auto_increment_increment=2
[mysqld.2]
wsrep-debug=1
auto_increment_offset=2
auto_increment_increment=2
mysql-test/suite/galera/t/galera_fk_lock_wait.test
View file @
f176248d
--
source
include
/
galera_cluster
.
inc
--
source
include
/
have_innodb
.
inc
CREATE
TABLE
parent
(
parent_id
int
not
null
AUTO_INCREMENT
PRIMARY
KEY
,
parent_name
varchar
(
80
))
ENGINE
=
InnoDB
;
...
...
mysql-test/suite/galera_3nodes/r/GCF-354.result
View file @
f176248d
connection node_2;
connection node_1;
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_1;
connection node_2;
connection node_3;
connection node_2;
SET wsrep_on=OFF;
SET
SESSION
wsrep_on=OFF;
DROP SCHEMA test;
connection node_3;
SET wsrep_on=OFF;
SET
SESSION
wsrep_on=OFF;
CREATE TABLE test.t1 (f1 INTEGER NOT NULL PRIMARY KEY) engine=innodb;
connection node_1;
CREATE TABLE test.t1 (f1 INTEGER NOT NULL PRIMARY KEY) engine=innodb;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE
1
INSERT INTO test.t1 values (1);
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status Primary
...
...
mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result
View file @
f176248d
...
...
@@ -45,6 +45,7 @@ CALL mtr.add_suppression("It may not be safe to bootstrap the cluster from this
CALL mtr.add_suppression("Aborting");
CALL mtr.add_suppression("Plugin 'wsrep' init function returned error\\.");
CALL mtr.add_suppression("Plugin 'wsrep' registration as a STORAGE ENGINE failed\\.");
CALL mtr.add_suppression("Plugin 'wsrep' registration as a FUNCTION failed\\.");
CALL mtr.add_suppression("Failed to initialize plugins\\.");
CALL mtr.add_suppression("WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg\\(\\)");
connection node_3;
...
...
@@ -58,6 +59,7 @@ CALL mtr.add_suppression("It may not be safe to bootstrap the cluster from this
CALL mtr.add_suppression("Aborting");
CALL mtr.add_suppression("Plugin 'wsrep' init function returned error\\.");
CALL mtr.add_suppression("Plugin 'wsrep' registration as a STORAGE ENGINE failed\\.");
CALL mtr.add_suppression("Plugin 'wsrep' registration as a FUNCTION failed\\.");
CALL mtr.add_suppression("Failed to initialize plugins\\.");
CALL mtr.add_suppression("WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg\\(\\)");
SHOW CREATE TABLE t1;
...
...
mysql-test/suite/galera_3nodes/t/GCF-354.test
View file @
f176248d
...
...
@@ -2,7 +2,9 @@
--
source
include
/
have_innodb
.
inc
--
source
include
/
force_restart
.
inc
--
connect
node_3
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_3
--
let
$galera_connection_name
=
node_3
--
let
$galera_server_number
=
3
--
source
include
/
galera_connect
.
inc
# Save original auto_increment_offset values.
--
let
$node_1
=
node_1
...
...
@@ -14,11 +16,11 @@
# 1. Create different inconsistencies on nodes 2 and 3
#
--
connection
node_2
SET
wsrep_on
=
OFF
;
SET
SESSION
wsrep_on
=
OFF
;
DROP
SCHEMA
test
;
--
connection
node_3
SET
wsrep_on
=
OFF
;
SET
SESSION
wsrep_on
=
OFF
;
CREATE
TABLE
test
.
t1
(
f1
INTEGER
NOT
NULL
PRIMARY
KEY
)
engine
=
innodb
;
#
# 2. The following should generate different errors on nodes 2 and 3 and
...
...
@@ -27,10 +29,10 @@ CREATE TABLE test.t1 (f1 INTEGER NOT NULL PRIMARY KEY) engine=innodb;
#
--
connection
node_1
CREATE
TABLE
test
.
t1
(
f1
INTEGER
NOT
NULL
PRIMARY
KEY
)
engine
=
innodb
;
INSERT
INTO
test
.
t1
values
(
1
);
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
1
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_size'
--
source
include
/
wait_condition
.
inc
SELECT
VARIABLE_VALUE
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_size'
;
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
'Primary'
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_status'
--
source
include
/
wait_condition
.
inc
SHOW
STATUS
LIKE
'wsrep_cluster_status'
;
...
...
mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test
View file @
f176248d
...
...
@@ -193,6 +193,7 @@ CALL mtr.add_suppression("It may not be safe to bootstrap the cluster from this
CALL
mtr
.
add_suppression
(
"Aborting"
);
CALL
mtr
.
add_suppression
(
"Plugin 'wsrep' init function returned error
\\
."
);
CALL
mtr
.
add_suppression
(
"Plugin 'wsrep' registration as a STORAGE ENGINE failed
\\
."
);
CALL
mtr
.
add_suppression
(
"Plugin 'wsrep' registration as a FUNCTION failed
\\
."
);
CALL
mtr
.
add_suppression
(
"Failed to initialize plugins
\\
."
);
CALL
mtr
.
add_suppression
(
"WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg
\\
(
\\
)"
);
...
...
@@ -207,6 +208,7 @@ CALL mtr.add_suppression("It may not be safe to bootstrap the cluster from this
CALL
mtr
.
add_suppression
(
"Aborting"
);
CALL
mtr
.
add_suppression
(
"Plugin 'wsrep' init function returned error
\\
."
);
CALL
mtr
.
add_suppression
(
"Plugin 'wsrep' registration as a STORAGE ENGINE failed
\\
."
);
CALL
mtr
.
add_suppression
(
"Plugin 'wsrep' registration as a FUNCTION failed
\\
."
);
CALL
mtr
.
add_suppression
(
"Failed to initialize plugins
\\
."
);
CALL
mtr
.
add_suppression
(
"WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg
\\
(
\\
)"
);
...
...
scripts/wsrep_sst_backup.sh
View file @
f176248d
...
...
@@ -2,7 +2,7 @@
set
-ue
# Copyright (C) 2017-202
1
MariaDB
# Copyright (C) 2017-202
4
MariaDB
# Copyright (C) 2010-2014 Codership Oy
#
# This program is free software; you can redistribute it and/or modify
...
...
@@ -19,52 +19,30 @@ set -ue
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
# MA 02110-1335 USA.
# This is a reference script for rsync-based state snapshot transfer
RSYNC_REAL_PID
=
0
# rsync process id
STUNNEL_REAL_PID
=
0
# stunnel process id
OS
=
"
$(
uname
)
"
[
"
$OS
"
=
'Darwin'
]
&&
export
-n
LD_LIBRARY_PATH
# Setting the path for lsof on CentOS
export
PATH
=
"/usr/sbin:/sbin:
$PATH
"
# This is a reference script for backup recovery state snapshot transfer.
.
$(
dirname
"
$0
"
)
/wsrep_sst_common
MAGIC_FILE
=
"
$WSREP_SST_OPT_DATA
/backup_sst_complete"
rm
-rf
"
$MAGIC_FILE
"
MAGIC_FILE
=
"
$DATA
/backup_sst_complete"
WSREP_LOG_DIR
=
${
WSREP_LOG_DIR
:-
""
}
# if WSREP_LOG_DIR env. variable is not set, try to get it from my.cnf
if
[
-z
"
$WSREP_LOG_DIR
"
]
;
then
WSREP_LOG_DIR
=
$(
parse_cnf mysqld innodb-log-group-home-dir
''
)
fi
wait_previous_sst
if
[
-n
"
$WSREP_LOG_DIR
"
]
;
then
# handle both relative and absolute paths
WSREP_LOG_DIR
=
$(
cd
$WSREP_SST_OPT_DATA
;
mkdir
-p
"
$WSREP_LOG_DIR
"
;
cd
$WSREP_LOG_DIR
;
pwd
-P
)
else
# default to datadir
WSREP_LOG_DIR
=
$(
cd
$WSREP_SST_OPT_DATA
;
pwd
-P
)
fi
[
-f
"
$MAGIC_FILE
"
]
&&
rm
-f
"
$MAGIC_FILE
"
if
[
"
$WSREP_SST_OPT_ROLE
"
=
'donor'
]
then
[
-f
"
$MAGIC_FILE
"
]
&&
rm
-f
"
$MAGIC_FILE
"
RC
=
0
if
[
$WSREP_SST_OPT_BYPASS
-eq
0
]
;
then
FLUSHED
=
"
$
WSREP_SST_OPT_
DATA
/tables_flushed"
ERROR
=
"
$
WSREP_SST_OPT_
DATA
/sst_error"
FLUSHED
=
"
$DATA
/tables_flushed"
ERROR
=
"
$DATA
/sst_error"
[
-f
"
$FLUSHED
"
]
&&
rm
-f
"
$FLUSHED
"
[
-f
"
$ERROR
"
]
&&
rm
-f
"
$ERROR
"
echo
"flush tables"
echo
'flush tables'
# Wait for :
# (a) Tables to be flushed, AND
...
...
@@ -77,19 +55,23 @@ then
# Check whether ERROR file exists.
if
[
-f
"
$ERROR
"
]
;
then
# Flush tables operation failed.
rm
-f
"
$ERROR
"
rm
"
$ERROR
"
exit
255
fi
sleep
0.2
done
STATE
=
$(
cat
"
$FLUSHED
"
)
rm
-f
"
$FLUSHED
"
rm
"
$FLUSHED
"
else
# BYPASS
wsrep_log_info
"Bypassing state dump."
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
# (separated by a space).
STATE
=
"
$WSREP_SST_OPT_GTID
$WSREP_SST_OPT_GTID_DOMAIN_ID
"
fi
echo
'continue'
# now server can resume updating data
...
...
scripts/wsrep_sst_common.sh
View file @
f176248d
This diff is collapsed.
Click to expand it.
scripts/wsrep_sst_mariabackup.sh
View file @
f176248d
This diff is collapsed.
Click to expand it.
scripts/wsrep_sst_mysqldump.sh
View file @
f176248d
...
...
@@ -3,7 +3,7 @@
set
-ue
# Copyright (C) 2009-2015 Codership Oy
# Copyright (C) 2017-202
2
MariaDB
# Copyright (C) 2017-202
4
MariaDB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -19,10 +19,26 @@ set -ue
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
# MA 02110-1335 USA.
# This is a reference script for m
ysqldump-based state snapshot tansfer
# This is a reference script for m
ariadb-dump-based state snapshot tansfer.
.
$(
dirname
"
$0
"
)
/wsrep_sst_common
CLIENT_DIR
=
"
$SCRIPTS_DIR
/../client"
if
[
-x
"
$CLIENT_DIR
/mariadb"
]
;
then
MYSQL_CLIENT
=
"
$CLIENT_DIR
/mariadb"
else
MYSQL_CLIENT
=
$(
commandex
'mariadb'
)
fi
if
[
-x
"
$CLIENT_DIR
/mariadb-dump"
]
;
then
MYSQLDUMP
=
"
$CLIENT_DIR
/mariadb-dump"
else
MYSQLDUMP
=
$(
commandex
'mariadb-dump'
)
fi
wait_previous_sst
EINVAL
=
22
if
test
-z
"
$WSREP_SST_OPT_HOST
"
;
then
wsrep_log_error
"HOST cannot be nil"
;
exit
$EINVAL
;
fi
...
...
@@ -35,7 +51,8 @@ if is_local_ip "$WSREP_SST_OPT_HOST_UNESCAPED" && \
[
"
$WSREP_SST_OPT_PORT
"
=
"
$WSREP_SST_OPT_LPORT
"
]
then
wsrep_log_error
\
"destination address '
$WSREP_SST_OPT_HOST
:
$WSREP_SST_OPT_PORT
' matches source address."
"destination address '
$WSREP_SST_OPT_HOST
:
$WSREP_SST_OPT_PORT
'"
\
"matches source address."
exit
$EINVAL
fi
...
...
scripts/wsrep_sst_rsync.sh
View file @
f176248d
This diff is collapsed.
Click to expand it.
sql/mf_iocache_encr.cc
View file @
f176248d
...
...
@@ -175,8 +175,8 @@ static int my_b_encr_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
DBUG_RETURN
(
info
->
error
=
-
1
);
}
crypt_data
->
counter
=
0
;
IF_DBUG
(
crypt_data
->
block_length
=
0
,)
;
crypt_data
->
block_length
=
0
;
crypt_data
->
last_block_length
=
0
;
}
do
...
...
sql/sql_insert.cc
View file @
f176248d
...
...
@@ -3577,7 +3577,6 @@ pthread_handler_t handle_delayed_insert(void *arg)
DBUG_LEAVE
;
}
my_thread_end
();
pthread_exit
(
0
);
return
0
;
}
...
...
sql/wsrep_sst.cc
View file @
f176248d
...
...
@@ -1602,11 +1602,13 @@ static int sst_donate_mysqldump (const char* addr,
WSREP_SST_OPT_PORT
" '%u' "
WSREP_SST_OPT_LPORT
" '%u' "
WSREP_SST_OPT_SOCKET
" '%s' "
WSREP_SST_OPT_DATA
" '%s' "
"%s"
WSREP_SST_OPT_GTID
" '%s:%lld,%d-%d-%llu' "
WSREP_SST_OPT_GTID_DOMAIN_ID
" '%d'"
"%s"
,
addr
,
port
,
mysqld_port
,
mysqld_unix_port
,
mysql_real_data_home
,
wsrep_defaults_file
,
uuid_oss
.
str
().
c_str
(),
gtid
.
seqno
().
get
(),
wsrep_gtid_server
.
domain_id
,
wsrep_gtid_server
.
server_id
,
...
...
storage/innobase/fil/fil0fil.cc
View file @
f176248d
...
...
@@ -1485,17 +1485,18 @@ inline void mtr_t::log_file_op(mfile_type_t type, uint32_t space_id,
m_last
=
nullptr
;
const
size_t
len
=
strlen
(
path
);
const
size_t
new_len
=
type
==
FILE_RENAME
?
1
+
strlen
(
new_path
)
:
0
;
const
size_t
new_len
=
new_path
?
1
+
strlen
(
new_path
)
:
0
;
ut_ad
(
len
>
0
);
byte
*
const
log_ptr
=
m_log
.
open
(
1
+
3
/*length*/
+
5
/*space_id*/
+
1
/*page_no=0*/
);
*
log_ptr
=
type
;
byte
*
end
=
log_ptr
+
1
;
end
=
mlog_encode_varint
(
end
,
space_id
);
*
end
++=
0
;
if
(
UNIV_LIKELY
(
end
+
len
+
new_len
>=
&
log_ptr
[
16
]))
const
byte
*
const
final_end
=
end
+
len
+
new_len
;
if
(
UNIV_LIKELY
(
final_end
>=
&
log_ptr
[
16
]))
{
*
log_ptr
=
type
;
size_t
total_len
=
len
+
new_len
+
end
-
log_ptr
-
15
;
size_t
total_len
=
final_end
-
log_ptr
-
15
;
if
(
total_len
>=
MIN_3BYTE
)
total_len
+=
2
;
else
if
(
total_len
>=
MIN_2BYTE
)
...
...
@@ -1506,13 +1507,13 @@ inline void mtr_t::log_file_op(mfile_type_t type, uint32_t space_id,
}
else
{
*
log_ptr
=
static_cast
<
byte
>
(
type
|
(
end
+
len
+
new_len
-
&
log_ptr
[
1
]));
*
log_ptr
=
static_cast
<
byte
>
(
*
log_ptr
|
(
final_end
-
&
log_ptr
[
1
]));
ut_ad
(
*
log_ptr
&
15
);
}
m_log
.
close
(
end
);
if
(
type
==
FILE_RENAME
)
if
(
new_path
)
{
ut_ad
(
strchr
(
new_path
,
'/'
));
m_log
.
push
(
reinterpret_cast
<
const
byte
*>
(
path
),
uint32_t
(
len
+
1
));
...
...
unittest/mysys/stacktrace-t.c
View file @
f176248d
...
...
@@ -30,7 +30,7 @@ void test_my_safe_print_str()
memcpy
(
b_bss
,
"LEGAL"
,
6
);
#ifdef HAVE_STACKTRACE
#
ifndef __SANITIZE_ADDRESS__
#
if !defined __SANITIZE_ADDRESS__ && !__has_feature(memory_sanitizer)
fprintf
(
stderr
,
"
\n
===== stack =====
\n
"
);
my_safe_print_str
(
b_stack
,
65535
);
fprintf
(
stderr
,
"
\n
===== heap =====
\n
"
);
...
...
@@ -40,15 +40,15 @@ void test_my_safe_print_str()
fprintf
(
stderr
,
"
\n
===== data =====
\n
"
);
my_safe_print_str
(
"LEGAL"
,
65535
);
fprintf
(
stderr
,
"
\n
===== Above is a junk, but it is expected. =====
\n
"
);
#
endif
/*__SANITIZE_ADDRESS__*/
#
endif
fprintf
(
stderr
,
"
\n
===== Nornal length test =====
\n
"
);
my_safe_print_str
(
"LEGAL"
,
5
);
fprintf
(
stderr
,
"
\n
===== NULL =====
\n
"
);
my_safe_print_str
(
0
,
5
);
#ifndef __SANITIZE_ADDRESS__
#
ifndef __SANITIZE_ADDRESS__
fprintf
(
stderr
,
"
\n
===== (const char*) 1 =====
\n
"
);
my_safe_print_str
((
const
char
*
)
1
,
5
);
#endif
/*__SANITIZE_ADDRESS__*/
#
endif
/*__SANITIZE_ADDRESS__*/
#endif
/*HAVE_STACKTRACE*/
free
(
b_heap
);
...
...
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