-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MDEV-39061 mariadb-backup compatible wrappers for BACKUP SERVER #5140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Thirunarayanan
wants to merge
15
commits into
MDEV-14992
Choose a base branch
from
MDEV-39061
base: MDEV-14992
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5900319
WIP MDEV-14992 BACKUP SERVER
dr-m 6c8a37f
WIP MDEV-39092: back up some non-InnoDB files
dr-m e03f94f
fixup! 5900319c43c44215eaf398291ba5caca688fe1ec
dr-m e4b6a46
Simplify the logic around max_first_lsn
dr-m c1308b8
WIP streaming backup
dr-m 7bac6a0
fixup! c1308b88463345eaf30ef92db892473ab9f275d9
dr-m 3fa3501
fixup! c1308b88463345eaf30ef92db892473ab9f275d9
dr-m 7726c04
fixup! 7bac6a0f656005d90a75f4bb0cb68d7bbab7a483
dr-m d8984aa
MDEV-39061 mariadb-backup compatible wrapper for BACKUP SERVER
Thirunarayanan 40a31a4
MDEV-39541 mem_pressure::~mem_pressure() causes a crash on bootstrap
grooverdan 796690c
MDEV-39585: Support SHUTDOWN command on Windows in bootstrap
grooverdan 647f8e3
MDEV-39585 mariadb bootstrap fails to perform plugin deinitalization
grooverdan f63689c
- Handled other maribackup commands
Thirunarayanan 1fcb44e
- Added rr trace and renamed mysqld to mariadb client
Thirunarayanan 86c9bc3
- Changing the order how --prepare resolves mariadbd
Thirunarayanan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ innodb,^ | |
| versioning,^ | ||
| plugins,^ | ||
| mariabackup,^ | ||
| backup,^ | ||
| roles,^ | ||
| auth_gssapi,^ | ||
| mysql_sha2,^ | ||
|
|
||
This file contains hidden or 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,3 @@ | ||
| [OLD] | ||
|
|
||
| [NEW] |
This file contains hidden or 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,5 @@ | ||
| if ($MTR_COMBINATION_NEW) | ||
| { | ||
| --source include/have_mariabackup_wrapper.inc | ||
| } | ||
|
|
This file contains hidden or 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,35 @@ | ||
| # Redirect `$XTRABACKUP` so existing test invocations like | ||
| # | ||
| # --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf \ | ||
| # --backup --target-dir=$targetdir | ||
| # | ||
| # run through scripts/mariabackup/mariabackup.sh — the BACKUP SERVER | ||
| # compatibility wrapper — without any change to the test body. | ||
| # | ||
| # --source include/have_mariabackup_wrapper.inc | ||
| # # ... rest of the test, using $XTRABACKUP as usual ... | ||
| # | ||
| # $XTRABACKUP — now points at mariabackup.sh | ||
|
|
||
| --source include/linux.inc | ||
|
|
||
| --let MARIABACKUP_WRAPPER=$MYSQL_TEST_DIR/../scripts/mariabackup/mariabackup.sh | ||
|
|
||
| # The wrapper shells out to the bare `mariadb` client, which mtr does not put | ||
| # on PATH. Prepend the build's client directories so it resolves. A `let` with | ||
| # no leading $ is exported to the environment of later --exec commands. | ||
| --let PATH=$MYSQL_BINDIR/client:$MYSQL_BINDIR/client_release:$MYSQL_BINDIR/client_debug:$MYSQL_BINDIR/bin:$PATH | ||
|
|
||
| --error 0,1 | ||
| perl; | ||
| my $w = $ENV{MARIABACKUP_WRAPPER}; | ||
| exit 1 unless $w && -x $w && -x "/bin/sh"; | ||
| exit 0; | ||
| EOF | ||
|
|
||
| if ($errno) | ||
| { | ||
| --skip mariabackup.sh wrapper unavailable (script or sh missing) | ||
| } | ||
|
Comment on lines
+30
to
+33
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| --let XTRABACKUP=$MARIABACKUP_WRAPPER | ||
This file contains hidden or 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,6 @@ | ||
| BACKUP SERVER TO '$datadir/some_directory'; | ||
| ERROR HY000: Incorrect arguments to BACKUP SERVER TO | ||
| BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
| BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
| ERROR HY000: Can't create directory 'MYSQLTEST_VARDIR/some_directory' (Errcode: 17 "File exists") | ||
| BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; |
This file contains hidden or 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,10 @@ | ||
| --let $datadir=`select @@datadir` | ||
| --error ER_WRONG_ARGUMENTS | ||
| evalp BACKUP SERVER TO '$datadir/some_directory'; | ||
| evalp BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
| --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
| --error 21 | ||
| evalp BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
| --rmdir $MYSQLTEST_VARDIR/some_directory | ||
| evalp BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
| --rmdir $MYSQLTEST_VARDIR/some_directory |
This file contains hidden or 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,17 @@ | ||
| BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
| ERROR HY000: Can't create directory 'MYSQLTEST_VARDIR/some_directory' (Errcode: 17 "File exists") | ||
| BACKUP STAGE START; | ||
| connect backup,localhost,root; | ||
| SET STATEMENT max_statement_time=0.1 FOR | ||
| BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
| ERROR 70100: Query was interrupted: execution time limit 0.1 sec exceeded | ||
| connection default; | ||
| BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
| ERROR HY000: Can't execute the command as you have a BACKUP STAGE active | ||
| BACKUP STAGE END; | ||
| connection backup; | ||
| SET STATEMENT max_statement_time=0.1 FOR | ||
| BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
| ERROR HY000: Can't create directory 'MYSQLTEST_VARDIR/some_directory' (Errcode: 17 "File exists") | ||
| disconnect backup; | ||
| connection default; |
This file contains hidden or 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,31 @@ | ||
| --source include/not_embedded.inc | ||
| --source include/count_sessions.inc | ||
|
|
||
| --mkdir $MYSQLTEST_VARDIR/some_directory | ||
| --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
| --error 21 | ||
| evalp BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
|
|
||
| BACKUP STAGE START; | ||
| --connect (backup,localhost,root) | ||
| --error ER_STATEMENT_TIMEOUT | ||
| evalp SET STATEMENT max_statement_time=0.1 FOR | ||
| BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
|
|
||
| --connection default | ||
|
|
||
| --error ER_BACKUP_LOCK_IS_ACTIVE | ||
| evalp BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
|
|
||
| BACKUP STAGE END; | ||
| --connection backup | ||
| --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
| --error 21 | ||
| evalp SET STATEMENT max_statement_time=0.1 FOR | ||
| BACKUP SERVER TO '$MYSQLTEST_VARDIR/some_directory'; | ||
| --disconnect backup | ||
| --connection default | ||
|
|
||
| --rmdir $MYSQLTEST_VARDIR/some_directory | ||
|
|
||
| --source include/wait_until_count_sessions.inc |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,8 +1,12 @@ | ||
| create table t1(a int) engine=innodb; | ||
| # | ||
| # MDEV-39541 mem_pressure::~mem_pressure() causes a crash on bootstrap | ||
| # | ||
| # restart | ||
| select * from t1; | ||
| a | ||
| 1 | ||
| 2 | ||
| 5 | ||
| drop table t1; | ||
| # End of 10.11 tests |
This file contains hidden or 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 hidden or 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,27 @@ | ||
| CREATE USER user1@localhost IDENTIFIED BY ''; | ||
| connect con1,localhost,user1; | ||
| BACKUP SERVER TO 'some_directory'; | ||
| ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation | ||
| disconnect con1; | ||
| connection default; | ||
| GRANT SELECT ON test.* TO user1@localhost; | ||
| connect con1,localhost,user1; | ||
| BACKUP SERVER TO 'some_directory'; | ||
| ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation | ||
| disconnect con1; | ||
| connection default; | ||
| GRANT RELOAD ON test.* TO user1@localhost; | ||
| ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES | ||
| GRANT RELOAD ON *.* TO user1@localhost; | ||
| connect con1,localhost,user1; | ||
| BACKUP SERVER TO 'some_directory'; | ||
| ERROR 42000: Access denied; you need (at least one of) the SELECT privilege(s) for this operation | ||
| disconnect con1; | ||
| connection default; | ||
| GRANT SELECT ON *.* TO user1@localhost; | ||
| connect con1,localhost,user1; | ||
| BACKUP SERVER TO '$datadir/some_directory'; | ||
| ERROR HY000: Incorrect arguments to BACKUP SERVER TO | ||
| disconnect con1; | ||
| connection default; | ||
| DROP USER user1@localhost; |
This file contains hidden or 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,29 @@ | ||
| --source include/not_embedded.inc | ||
| CREATE USER user1@localhost IDENTIFIED BY ''; | ||
| --connect con1,localhost,user1 | ||
| --error ER_SPECIFIC_ACCESS_DENIED_ERROR | ||
| BACKUP SERVER TO 'some_directory'; | ||
| --disconnect con1 | ||
| --connection default | ||
| GRANT SELECT ON test.* TO user1@localhost; | ||
| --connect con1,localhost,user1 | ||
| --error ER_SPECIFIC_ACCESS_DENIED_ERROR | ||
| BACKUP SERVER TO 'some_directory'; | ||
| --disconnect con1 | ||
| --connection default | ||
| --error ER_WRONG_USAGE | ||
| GRANT RELOAD ON test.* TO user1@localhost; | ||
| GRANT RELOAD ON *.* TO user1@localhost; | ||
| --connect con1,localhost,user1 | ||
| --error ER_SPECIFIC_ACCESS_DENIED_ERROR | ||
| BACKUP SERVER TO 'some_directory'; | ||
| --disconnect con1 | ||
| --connection default | ||
| GRANT SELECT ON *.* TO user1@localhost; | ||
| --connect con1,localhost,user1 | ||
| --let $datadir=`select @@datadir` | ||
| --error ER_WRONG_ARGUMENTS | ||
| evalp BACKUP SERVER TO '$datadir/some_directory'; | ||
| --disconnect con1 | ||
| --connection default | ||
| DROP USER user1@localhost; |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -180,6 +180,7 @@ END | |
| main- | ||
| archive- | ||
| atomic- | ||
| backup- | ||
| binlog- | ||
| binlog_encryption- | ||
| binlog_in_engine- | ||
|
|
||
This file contains hidden or 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,16 @@ | ||
| --- backup_innodb.result | ||
| +++ backup_innodb,debug.result | ||
| @@ -22,7 +22,13 @@ | ||
| BEGIN; | ||
| DELETE FROM t; | ||
| connect backup,localhost,root; | ||
| +SET DEBUG_SYNC='innodb_backup_start SIGNAL start WAIT_FOR resume'; | ||
| BACKUP SERVER TO 'target_directory' 4 CONCURRENT; | ||
| +connection default; | ||
| +SET DEBUG_SYNC='now WAIT_FOR start'; | ||
| +INSERT INTO t(a) SELECT * FROM seq_1_to_30000; | ||
| +SET DEBUG_SYNC='now SIGNAL resume'; | ||
| +connection backup; | ||
| disconnect backup; | ||
| connection default; | ||
| ROLLBACK; |
This file contains hidden or 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,4 @@ | ||
| [archived] | ||
| innodb_log_archive=ON | ||
| [circular] | ||
| innodb_log_archive=OFF |
This file contains hidden or 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,62 @@ | ||
| CREATE TABLE t(a INT PRIMARY KEY, b CHAR(255) DEFAULT '' NOT NULL, INDEX(b)) | ||
| ENGINE=INNODB; | ||
| BEGIN; | ||
| INSERT INTO t SET a=1; | ||
| CREATE TABLE at1(i INTEGER) ENGINE=Aria TRANSACTIONAL=1; | ||
| INSERT INTO at1 VALUES (2), (3), (5), (7); | ||
| CREATE TABLE at0 (i INTEGER) ENGINE=Aria TRANSACTIONAL=0; | ||
| INSERT INTO at0 VALUES (1), (1), (2), (3), (5); | ||
| BACKUP SERVER TO '$target_directory'; | ||
| BACKUP SERVER TO '$target_directory' WITH '/bin/false'; | ||
| ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH '/bin/false'' at line 1 | ||
| BACKUP SERVER TO '$target_directory' WITH 4 CONCURRENT '/bin/false'; | ||
| ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH 4 CONCURRENT '/bin/false'' at line 1 | ||
| BACKUP SERVER WITH '/bin/false'; | ||
| ERROR HY000: IO Write error: (...) BACKUP SERVER | ||
| BACKUP SERVER WITH 4 CONCURRENT '/bin/false'; | ||
| ERROR HY000: IO Write error: (...) BACKUP SERVER | ||
| ROLLBACK; | ||
| SELECT * FROM t; | ||
| a b | ||
| 1 | ||
| BEGIN; | ||
| DELETE FROM t; | ||
| connect backup,localhost,root; | ||
| BACKUP SERVER TO 'target_directory' 4 CONCURRENT; | ||
| disconnect backup; | ||
| connection default; | ||
| ROLLBACK; | ||
| SELECT * FROM t; | ||
| a b | ||
| 1 | ||
| DELETE FROM t; | ||
| DROP TABLE at0, at1; | ||
| # restart: --defaults-file=MYSQLTEST_VARDIR/some_directory/backup.cnf --datadir=MYSQLTEST_VARDIR/some_directory | ||
| SELECT * FROM t; | ||
| a b | ||
| 1 | ||
| DELETE FROM t; | ||
| ERROR HY000: Table 't' is read only | ||
| SELECT * FROM at0; | ||
| i | ||
| 1 | ||
| 1 | ||
| 2 | ||
| 3 | ||
| 5 | ||
| SELECT * FROM at1; | ||
| i | ||
| 2 | ||
| 3 | ||
| 5 | ||
| 7 | ||
| DROP TABLE t, at0, at1; | ||
| ERROR HY000: Table 't' is read only | ||
| SELECT * FROM at0; | ||
| ERROR 42S02: Table 'test.at0' doesn't exist | ||
| SELECT * FROM at1; | ||
| ERROR 42S02: Table 'test.at1' doesn't exist | ||
| # restart | ||
| SELECT * FROM t; | ||
| a b | ||
| DROP TABLE t; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we only want to exclude non-POSIX environments, more specifically, Microsoft Windows. For that, I would suggest the following:
--source include/not_windows.incor if it cannot be used for some reason: