Skip to content

Commit

Permalink
Merge remote-tracking branch 10.2 into 10.3
Browse files Browse the repository at this point in the history
Conflicts:
	mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt
	mysql-test/suite/innodb/r/innodb-mdev-7513.result
	mysql-test/suite/innodb/t/innodb-mdev-7513.test
	mysql-test/suite/wsrep/disabled.def
	storage/innobase/ibuf/ibuf0ibuf.cc
  • Loading branch information
Jan Lindström committed Dec 2, 2019
2 parents 8d2a57b + c6ed37b commit 9d9a225
Show file tree
Hide file tree
Showing 108 changed files with 1,054 additions and 265 deletions.
31 changes: 20 additions & 11 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1666,6 +1666,9 @@ ibx_copy_incremental_over_full()
}
}

if (!(ret = backup_files_from_datadir(xtrabackup_incremental_dir)))
goto cleanup;

/* copy buffer pool dump */
if (innobase_buffer_pool_filename) {
const char *src_name;
Expand Down Expand Up @@ -2177,20 +2180,26 @@ static bool backup_files_from_datadir(const char *dir_path)
if (info.type != OS_FILE_TYPE_FILE)
continue;

const char *pname = strrchr(info.name, IF_WIN('\\', '/'));
const char *pname = strrchr(info.name, OS_PATH_SEPARATOR);
if (!pname)
pname = info.name;

/* Copy aria log files, and aws keys for encryption plugins.*/
const char *prefixes[] = { "aria_log", "aws-kms-key" };
for (size_t i = 0; i < array_elements(prefixes); i++) {
if (starts_with(pname, prefixes[i])) {
ret = copy_file(ds_data, info.name, info.name, 1);
if (!ret) {
break;
}
}
}
if (!starts_with(pname, "aws-kms-key") &&
!starts_with(pname, "aria_log"))
/* For ES exchange the above line with the following code:
(!xtrabackup_prepare || !xtrabackup_incremental_dir ||
!starts_with(pname, "aria_log")))
*/
continue;

if (xtrabackup_prepare && xtrabackup_incremental_dir &&
file_exists(info.name))
unlink(info.name);

std::string full_path(dir_path);
full_path.append(1, OS_PATH_SEPARATOR).append(info.name);
if (!(ret = copy_file(ds_data, full_path.c_str() , info.name, 1)))
break;
}
os_file_closedir(dir);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion libmariadb
148 changes: 144 additions & 4 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3051,15 +3051,43 @@ ($)
# Save this test case information, so next can examine it
$mysqld->{'started_tinfo'}= $tinfo;
}

# If wsrep is on, we need to wait until the first
# server starts and bootstraps the cluster before
# starting other servers. The bootsrap server in the
# configuration should always be the first which has
# wsrep_on=ON
if (wsrep_on($mysqld) && wsrep_is_bootstrap_server($mysqld))
{
mtr_verbose("Waiting for wsrep bootstrap server to start");
if ($mysqld->{WAIT}->($mysqld))
{
return 1;
}
}
}

sub mysql_server_wait {
my ($mysqld) = @_;
my ($mysqld, $tinfo) = @_;

return not sleep_until_file_created($mysqld->value('pid-file'),
if (!sleep_until_file_created($mysqld->value('pid-file'),
$opt_start_timeout,
$mysqld->{'proc'},
$warn_seconds);
$warn_seconds))
{
$tinfo->{comment}= "Failed to start ".$mysqld->name() . "\n";
return 1;
}

if (wsrep_on($mysqld))
{
mtr_verbose("Waiting for wsrep server " . $mysqld->name() . " to be ready");
if (!wait_wsrep_ready($tinfo, $mysqld))
{
return 1;
}
}
return 0;
}

sub create_config_file_for_extern {
Expand Down Expand Up @@ -5593,6 +5621,118 @@ ($$)
}
}

#
# run_query_output
#
# Run a query against a server using mysql client. The output of
# the query will be written into outfile.
#
sub run_query_output {
my ($mysqld, $query, $outfile)= @_;
my $args;

mtr_init_args(\$args);
mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
mtr_add_arg($args, "--silent");
mtr_add_arg($args, "--execute=%s", $query);

my $res= My::SafeProcess->run
(
name => "run_query_output -> ".$mysqld->name(),
path => $exe_mysql,
args => \$args,
output => $outfile,
error => $outfile
);

return $res
}


#
# wsrep_wait_ready
#
# Wait until the server has been joined to the cluster and is
# ready for operation.
#
# RETURN
# 1 Server is ready
# 0 Server didn't transition to ready state within start timeout
#
sub wait_wsrep_ready($$) {
my ($tinfo, $mysqld)= @_;

my $sleeptime= 100; # Milliseconds
my $loops= ($opt_start_timeout * 1000) / $sleeptime;

my $name= $mysqld->name();
my $outfile= "$opt_vardir/tmp/$name.wsrep_ready";
my $query= "SET SESSION wsrep_sync_wait = 0;
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME = 'wsrep_ready'";

for (my $loop= 1; $loop <= $loops; $loop++)
{
# Careful... if MTR runs with option 'verbose' then the
# file contains also SafeProcess verbose output
if (run_query_output($mysqld, $query, $outfile) == 0 &&
mtr_grab_file($outfile) =~ /WSREP_READY\s+ON/)
{
unlink($outfile);
return 1;
}
mtr_milli_sleep($sleeptime);
}

$tinfo->{logfile}= "WSREP did not transition to state READY";
return 0;
}

#
# wsrep_is_bootstrap_server
#
# Check if the server is the first one to be started in the
# cluster.
#
# RETURN
# 1 The server is a bootstrap server
# 0 The server is not a bootstrap server
#
sub wsrep_is_bootstrap_server($) {
my $mysqld= shift;

my $cluster_address= $mysqld->if_exist('wsrep-cluster-address') ||
$mysqld->if_exist('wsrep_cluster_address');
if (defined $cluster_address)
{
return $cluster_address eq "gcomm://" || $cluster_address eq "'gcomm://'";
}
return 0;
}

#
# wsrep_on
#
# Check if wsrep has been enabled for a server.
#
# RETURN
# 1 Wsrep has been enabled
# 0 Wsrep is not enabled
#
sub wsrep_on($) {
my $mysqld= shift;
#check if wsrep_on= is set in configuration
if ($mysqld->if_exist('wsrep-on')) {
my $on= "".$mysqld->value('wsrep-on');
if ($on eq "1" || $on eq "ON") {
return 1;
}
}
return 0;
}


#
# start_servers
Expand All @@ -5612,7 +5752,7 @@ ($)

for (all_servers()) {
next unless $_->{WAIT} and started($_);
if ($_->{WAIT}->($_)) {
if ($_->{WAIT}->($_, $tinfo)) {
$tinfo->{comment}= "Failed to start ".$_->name() . "\n";
return 1;
}
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/galera/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
#
##############################################################################

MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently with Galera/replication victim kill
MW-329 : MDEV-19962 Galera test failure on MW-329
MW-388: MDEV-19803 Long semaphore wait error on galera.MW-388
galera_account_management : MariaDB 10.0 does not support ALTER USER
galera_as_master_gtid : Requires MySQL GTID
galera_as_master_gtid_change_master : Requires MySQL GTID
galera_as_slave_preordered : wsrep-preordered feature not merged to MariaDB
galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event()
galera_autoinc_sst_mariabackup : Known issue, may require porting MDEV-17458 from later versions
galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_log_events
galera_binlog_stmt_autoinc: MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc
galera_flush : MariaDB does not have global.thread_statistics
Expand Down
11 changes: 9 additions & 2 deletions mysql-test/suite/galera/galera_2nodes.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!include include/default_mysqld.cnf

[mysqld]
wsrep-on=1
loose-innodb
binlog-format=row
innodb-autoinc-lock-mode=2
default-storage-engine=innodb
Expand All @@ -12,18 +12,26 @@ wsrep_node_address=127.0.0.1
wsrep-sync-wait=15

[mysqld.1]
loose-innodb
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-on=1
wsrep-cluster-address=gcomm://
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'

# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 15

[mysqld.2]
loose-innodb
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'

Expand All @@ -36,7 +44,6 @@ wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'


[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
Expand Down
11 changes: 5 additions & 6 deletions mysql-test/suite/galera/r/MW-284.result
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
call mtr.add_suppression("\\[ERROR\\] Error reading packet from server: WSREP has not yet prepared node for application use .*");
call mtr.add_suppression("WSREP has not yet prepared node for application use");
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
SET SESSION wsrep_on = OFF;
SET SESSION wsrep_on = ON;
SET global wsrep_sync_wait=0;
connection node_3;
SELECT @@wsrep_on;
@@wsrep_on
0
START SLAVE;
include/wait_for_slave_param.inc [Slave_IO_Running]
connection node_1;
Expand All @@ -22,9 +27,3 @@ connection node_3;
STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('failed registering on master');
CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
connection node_1;
RESET MASTER;
CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');
connection node_2;
CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');
23 changes: 0 additions & 23 deletions mysql-test/suite/galera/r/MW-328C.result

This file was deleted.

13 changes: 0 additions & 13 deletions mysql-test/suite/galera/r/MW-44.result
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
connection node_1;
TRUNCATE TABLE mysql.general_log;
connection node_2;
TRUNCATE TABLE mysql.general_log;
connection node_1;
SELECT Argument FROM mysql.general_log;
Argument
SET GLOBAL general_log='ON';
SET SESSION wsrep_osu_method=TOI;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET SESSION wsrep_osu_method=RSU;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
SET SESSION wsrep_osu_method=TOI;
SELECT argument FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
argument
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
ALTER TABLE t1 ADD COLUMN f2 INTEGER
connection node_2;
SELECT Argument FROM mysql.general_log;
Argument
DROP TABLE t1;
SET GLOBAL general_log='OFF';
connection node_1;
SET GLOBAL general_log='OFF';
6 changes: 2 additions & 4 deletions mysql-test/suite/galera/r/galera_forced_binlog_format.result
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
connection node_1;
SET SESSION wsrep_on=OFF;
RESET MASTER;
SET SESSION wsrep_on=ON;
SET SESSION binlog_format = 'STATEMENT';
Warnings:
Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET SESSION binlog_format = 'MIXED';
Warnings:
Warning 1105 MariaDB Galera and flashback do not support binlog format: MIXED
INSERT INTO t1 VALUES (2);
SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 256;
Log_name Pos Event_type Server_id End_log_pos Info
Expand Down
10 changes: 4 additions & 6 deletions mysql-test/suite/galera/r/galera_gtid.result
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
CREATE TABLE t1 (f1 INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
UPDATE t1 SET f1 = 2;
connection node_1;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
COUNT(*) = 1
1
SET SESSION wsrep_sync_wait = 15;
SELECT * from t1;
f1
2
gtid_binlog_state_equal
1
DROP TABLE t1;
Loading

0 comments on commit 9d9a225

Please sign in to comment.