Repository navigation
MDEV-14992 BACKUP SERVER #4817
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
dr-m
wants to merge
61
commits into
main
Choose a base branch
from
MDEV-14992
base: main
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.
+7,238
−500
Open
MDEV-14992 BACKUP SERVER #4817
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
4b4f4ba
MDEV-40756 Incorrect multi-batch recovery of file size
dr-m b387a4a
MDEV-14992/MDEV-38362/MDEV-39092 BACKUP SERVER
dr-m 69dad73
squash! b387a4a6f9f9b3194a29c1a80c39c983d5dc4fd5
dr-m a77b37c
fixup! 69dad73b01a4706718bf7e078f3c861a341110fe
dr-m 035883e
fixup! a77b37c49cf47284580e507303d538a5daa2ea79
dr-m 81b2d10
fixup! 69dad73b01a4706718bf7e078f3c861a341110fe
dr-m 402fa7c
squash! b387a4a6f9f9b3194a29c1a80c39c983d5dc4fd5
dr-m 73e0505
Address some review comments
dr-m dfb8980
fixup! b387a4a6f9f9b3194a29c1a80c39c983d5dc4fd5
dr-m f4f84df
fixup! b387a4a6f9f9b3194a29c1a80c39c983d5dc4fd5
dr-m 2c0d729
fixup! 73e050520f5d14f04bd3d80ac49907804571c6f6
dr-m 494a753
fixup! 402fa7c537e298b3abc652d311baa7e2ed742e78
dr-m 74ee251
fixup! b387a4a6f9f9b3194a29c1a80c39c983d5dc4fd5
dr-m 7e37580
fixup! b387a4a6f9f9b3194a29c1a80c39c983d5dc4fd5
dr-m f54138b
fixup! b387a4a6f9f9b3194a29c1a80c39c983d5dc4fd5
dr-m b4d543f
fixup! 7e375803bb8a7dcb46c96f4a5727620ff0a6d0bb
dr-m a318e74
squash! 402fa7c537e298b3abc652d311baa7e2ed742e78
dr-m 204b63b
fixup! b387a4a6f9f9b3194a29c1a80c39c983d5dc4fd5
dr-m 0b96ab7
fixup! 204b63badbe6ef38b3a57a4bd0c429b76ac48c63
dr-m 46b25c3
MDEV-41166 --backup --innodb-log-checkpoint-now may copy too much
dr-m d5027ae
MDEV-41152: Fix FILE_CREATE recovery
dr-m 6404824
fixup! 7e375803bb8a7dcb46c96f4a5727620ff0a6d0bb
dr-m 33a015a
fixup! 402fa7c537e298b3abc652d311baa7e2ed742e78
dr-m 127f814
fixup! 33a015af79f0fa37134d295be5d328ec9d4da69a
dr-m 01c664c
fixup! 33a015af79f0fa37134d295be5d328ec9d4da69a
dr-m 2174506
fixup! 7e375803bb8a7dcb46c96f4a5727620ff0a6d0bb
dr-m e8bd7e1
fixup! 69dad73b01a4706718bf7e078f3c861a341110fe
dr-m 70e0e69
fixup! dfb898029d8d
dr-m 989fc84
fixup! b387a4a6f9f9b3194a29c1a80c39c983d5dc4fd5
dr-m c637ace
fixup! b387a4a6f9f9b3194a29c1a80c39c983d5dc4fd5
dr-m 5d6b8a3
Fix a race between DROP TABLE and BACKUP SERVER
dr-m b6e3bf0
MDEV-41318 Incorrect recovery of FILE_CREATE after FILE_RENAME
dr-m 157f216
fixup! b387a4a6f9f9b3194a29c1a80c39c983d5dc4fd5
dr-m 57925c1
fixup! 5d6b8a3178e12a53af30842560fcec22d51d9275
dr-m 92d9175
Fix a race between IMPORT TABLESPACE and BACKUP SERVER
dr-m 33ec544
MDEV-41040 BACKUP SERVER TO is slower than mariadb-backup
dr-m c579764
fixup! 92d9175305639ea3e0e9d817540fa3d1d1ebde82
dr-m 3736e0c
MDEV-41359 fix
dr-m 3bca599
fixup! 33ec54440d8b0ebd6fb4a2286c1167b851b1cdce
dr-m 99c95db
fixup! 33ec54440d8b0ebd6fb4a2286c1167b851b1cdce
dr-m 5cd0cb3
Fix multi-file system tablespace
dr-m ea087a3
fixup! 33ec54440d8b0ebd6fb4a2286c1167b851b1cdce
dr-m f02da92
Stream DATA DIRECTORY for ENGINE=InnoDB
dr-m 8a4a138
fixup! f02da92fc678477845bf6f541772975e2d49130e
dr-m 035eaef
fixup! ea087a30f0b81dbf674d7b1fa2ddb852117818ea
dr-m e45cb76
fixup! f02da92fc678477845bf6f541772975e2d49130e
dr-m d93536a
fixup! ea087a30f0b81dbf674d7b1fa2ddb852117818ea
dr-m 947752d
fixup! e45cb76bcf6177358d1443bf59db69ca1cb91611
dr-m b1cd96c
MDEV-41395 fil_space_t::create() may release fil_system.mutex
dr-m 7d9aaeb
fixup! b6e3bf05917d3dcb6868df2773e230b512ae4190
dr-m 1c909f0
Test backup with some concurrent DDL and encryption activity
dr-m ef562c3
fixup! 1c909f0247c4c18b009be9fa507b71ea7ed60f86
dr-m 90498e0
Write Galera information (untested)
dr-m 1479bb3
squash! 33ec54440d8b0ebd6fb4a2286c1167b851b1cdce
dr-m fbf02b2
fixup! ea087a30f0b81dbf674d7b1fa2ddb852117818ea
dr-m 33b7468
fixup! 1479bb3f7422efce56b225e607bc7cfdf028141e
dr-m 1b60442
fixup! 33b746888e75892654df7ffa3a696512656a631d
dr-m 276b6dd
fixup! 1b60442fec1e7c5dfa25915d0fa7fd8aa6c4ea88
dr-m a91c9cb
fixup! 276b6dd3a08fec92e474963e8defecd22bc092ad
dr-m e0ae58b
fixup! 33b746888e75892654df7ffa3a696512656a631d
dr-m 02feb97
fixup! fbf02b2bd3ffaff146602c102a0d5badd6e5b5b
dr-m 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/sh | ||
| exec cat > "$MARIADB_DATADIR/$1.tar" | ||
| # This is for use by mysql-test/mtr backup.backup_stream | ||
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,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,12 @@ | ||
| --let $datadir=`select @@datadir` | ||
| --error ER_WRONG_ARGUMENTS | ||
| evalp BACKUP SERVER TO '$datadir/some_directory'; | ||
| --error 0,1 | ||
| --rmdir $MYSQLTEST_VARDIR/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'; | ||
|
dr-m marked this conversation as resolved.
|
||
|
|
||
| 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 |
|---|---|---|
| @@ -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- | ||
|
|
||
53 changes: 53 additions & 0 deletions
53
mysql-test/suite/backup/backup_ddl_concurrent_verify.result
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,53 @@ | ||
| CREATE TABLE t_myisam (a INT) ENGINE=MyISAM; | ||
| INSERT INTO t_myisam VALUES (1), (2), (3); | ||
| CREATE TABLE t_aria (a INT) ENGINE=Aria TRANSACTIONAL=0; | ||
| INSERT INTO t_aria VALUES (1), (2), (3); | ||
| CREATE TABLE t_arch (a INT) ENGINE=ARCHIVE; | ||
| INSERT INTO t_arch VALUES (1), (2), (3); | ||
| CREATE PROCEDURE reader_churn(IN iterations INT) | ||
| BEGIN | ||
| DECLARE i INT DEFAULT 0; | ||
| WHILE i < iterations DO | ||
| SELECT SLEEP(0.002) INTO @discard | ||
| FROM t_myisam, t_aria, t_arch LIMIT 1; | ||
| SET i = i + 1; | ||
| END WHILE; | ||
| END| | ||
| CREATE PROCEDURE ddl_churn(IN iterations INT) | ||
| BEGIN | ||
| DECLARE i INT DEFAULT 0; | ||
| WHILE i < iterations DO | ||
| ALTER TABLE t_myisam ADD INDEX ix (a); | ||
| ALTER TABLE t_myisam DROP INDEX ix; | ||
| ALTER TABLE t_myisam FORCE, ALGORITHM=COPY; | ||
| SET i = i + 1; | ||
| END WHILE; | ||
| END| | ||
| connect r1,localhost,root,,; | ||
| CALL reader_churn(800); | ||
| connect r2,localhost,root,,; | ||
| CALL reader_churn(800); | ||
| connect d1,localhost,root,,; | ||
| CALL ddl_churn(400); | ||
| connection default; | ||
| connection r1; | ||
| connection r2; | ||
| connection d1; | ||
| connection default; | ||
| disconnect r1; | ||
| disconnect r2; | ||
| disconnect d1; | ||
| # restart: --datadir=MYSQLTEST_VARDIR/backup_ddl_concurrent_verify | ||
| SELECT COUNT(*) FROM t_myisam; | ||
| COUNT(*) | ||
| 3 | ||
| SELECT COUNT(*) FROM t_aria; | ||
| COUNT(*) | ||
| 3 | ||
| SELECT COUNT(*) FROM t_arch; | ||
| COUNT(*) | ||
| 3 | ||
| # restart | ||
| DROP PROCEDURE reader_churn; | ||
| DROP PROCEDURE ddl_churn; | ||
| DROP TABLE t_myisam, t_aria, t_arch; |
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.
Uh oh!
There was an error while loading. Please reload this page.