Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-21951: mariabackup SST fail if data-directory have lost+found di…
…rectory To fix this, it is necessary to add an option to exclude the database with the name "lost+found" from processing (the database name will be checked by the check_if_skip_database_by_path() or by the check_if_skip_database() function, and as a result "lost+found" will be skipped). In addition, it is necessary to slightly modify the verification logic in the check_if_skip_database() function. Also added a new test galera_sst_mariabackup_lost_found.test
- Loading branch information
Showing
5 changed files
with
127 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| connection node_1; | ||
| connection node_2; | ||
| connection node_2; | ||
| Shutting down server ... | ||
| connection node_1; | ||
| CREATE DATABASE `lost+found`; | ||
| USE `lost+found`; | ||
| CREATE TABLE t1(id INT); | ||
| INSERT INTO t1 VALUES (1), (2); | ||
| SELECT * FROM `lost+found`.t1; | ||
| id | ||
| 1 | ||
| 2 | ||
| CREATE DATABASE `#mysql50#not_lost+found`; | ||
| USE `#mysql50#not_lost+found`; | ||
| CREATE TABLE t1(id INT); | ||
| INSERT INTO t1 VALUES (1), (2); | ||
| SELECT * FROM `#mysql50#not_lost+found`.t1; | ||
| id | ||
| 1 | ||
| 2 | ||
| Cleaning var directory ... | ||
| connection node_2; | ||
| Starting server ... | ||
| SELECT * FROM `lost+found`.t1; | ||
| id | ||
| 1 | ||
| 2 | ||
| SELECT * FROM `#mysql50#not_lost+found`.t1; | ||
| id | ||
| 1 | ||
| 2 | ||
| connection node_1; | ||
| DROP DATABASE `lost+found`; | ||
| DROP DATABASE `#mysql50#not_lost+found`; | ||
| disconnect node_2; | ||
| disconnect node_1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| !include ../galera_2nodes.cnf | ||
|
|
||
| [mysqld] | ||
| wsrep_sst_method=mariabackup | ||
| wsrep_sst_auth="root:" | ||
|
|
||
| [mysqld.1] | ||
| wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' | ||
|
|
||
| [mysqld.2] | ||
| wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' | ||
|
|
||
| [sst] | ||
| transferfmt=@ENV.MTR_GALERA_TFMT | ||
| streamfmt=xbstream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| --source include/galera_cluster.inc | ||
| --source include/have_innodb.inc | ||
| --source include/have_mariabackup.inc | ||
|
|
||
| # Save original auto_increment_offset values. | ||
| --let $node_1=node_1 | ||
| --let $node_2=node_2 | ||
| --source include/auto_increment_offset_save.inc | ||
|
|
||
| --connection node_2 | ||
|
|
||
| #--connection node_2 | ||
| #--source suite/galera/include/galera_unload_provider.inc | ||
|
|
||
| --echo Shutting down server ... | ||
| --source include/shutdown_mysqld.inc | ||
|
|
||
| --connection node_1 | ||
| --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' | ||
| --source include/wait_condition.inc | ||
|
|
||
| CREATE DATABASE `lost+found`; | ||
| USE `lost+found`; | ||
| CREATE TABLE t1(id INT); | ||
| INSERT INTO t1 VALUES (1), (2); | ||
| SELECT * FROM `lost+found`.t1; | ||
|
|
||
| CREATE DATABASE `#mysql50#not_lost+found`; | ||
| USE `#mysql50#not_lost+found`; | ||
| CREATE TABLE t1(id INT); | ||
| INSERT INTO t1 VALUES (1), (2); | ||
| SELECT * FROM `#mysql50#not_lost+found`.t1; | ||
|
|
||
| # | ||
| # Force SST | ||
| # | ||
| --echo Cleaning var directory ... | ||
| --remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat | ||
| --remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mtr | ||
| --remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/performance_schema | ||
| --remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/test | ||
| --remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql | ||
| --remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data | ||
|
|
||
| --connection node_2 | ||
|
|
||
| --echo Starting server ... | ||
| let $restart_noprint=2; | ||
| --source include/start_mysqld.inc | ||
|
|
||
| --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; | ||
| --source include/wait_condition.inc | ||
|
|
||
| --let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; | ||
| --source include/wait_condition.inc | ||
|
|
||
| SELECT * FROM `lost+found`.t1; | ||
| SELECT * FROM `#mysql50#not_lost+found`.t1; | ||
|
|
||
| --connection node_1 | ||
|
|
||
| DROP DATABASE `lost+found`; | ||
| DROP DATABASE `#mysql50#not_lost+found`; | ||
|
|
||
| # rmdir $MYSQLD_DATADIR/lost+found; | ||
| # rmdir $MYSQLD_DATADIR/not_lost+found; | ||
|
|
||
| # Restore original auto_increment_offset values. | ||
| --source include/auto_increment_offset_restore.inc | ||
|
|
||
| --source include/galera_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters