This repository was archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
restore: support online restore #114
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
e47560d
*: update tidb
disksing 7148fa4
Merge branch 'master' into disksing/update-tidb
disksing b36fd13
fix test
disksing 4f19e9e
fix deprecated config
disksing cd14fec
Merge branch 'master' into disksing/update-tidb
disksing e0aad97
fix panic
disksing 8ce26ac
restore: support online restore
disksing 9b6c4b6
Merge branch 'master' into disksing/online-restore
disksing af99c96
add logs
disksing d64e9e2
Merge branch 'master' into disksing/online-restore
disksing 1a1e755
fix key codec and log
disksing de6de8f
Merge branch 'master' into disksing/online-restore
disksing b4aefb9
Merge branch 'master' into disksing/online-restore
disksing 2e9f38d
merge master
disksing ff52237
resolve conflicts
disksing 8539fb9
Merge branch 'master' into disksing/online-restore
disksing 5f12413
fix import
disksing b884609
add online restore tests
disksing ee4217e
add log
disksing 0da88b3
add log
disksing e317849
fix path
disksing c8fe26d
update pd-ctl usage
disksing cb95c14
cleanup log
disksing dd272d3
update restore_util dependency
disksing 23dc3ec
Merge branch 'master' into disksing/online-restore
disksing b18f7e1
fix compile
disksing 8b8290f
go mod tidy
disksing ed6c35d
Merge branch 'master' into disksing/online-restore
disksing 32e6f40
Merge branch 'master' into disksing/online-restore
disksing 8c54b53
address comment
disksing c03aa62
Merge branch 'master' into disksing/online-restore
disksing 2db0475
fix compile
disksing 317b145
Merge branch 'master' into disksing/online-restore
disksing 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 |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| #!/bin/sh | ||
| # | ||
| # Copyright 2020 PingCAP, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -eu | ||
| DB="$TEST_NAME" | ||
|
|
||
| run_sql "CREATE DATABASE $DB;" | ||
|
|
||
| run_sql "CREATE TABLE $DB.usertable1 ( \ | ||
| YCSB_KEY varchar(64) NOT NULL, \ | ||
| FIELD0 varchar(1) DEFAULT NULL, \ | ||
| PRIMARY KEY (YCSB_KEY) \ | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;" | ||
|
|
||
| run_sql "INSERT INTO $DB.usertable1 VALUES (\"a\", \"b\");" | ||
| run_sql "INSERT INTO $DB.usertable1 VALUES (\"aa\", \"b\");" | ||
|
|
||
| run_sql "CREATE TABLE $DB.usertable2 ( \ | ||
| YCSB_KEY varchar(64) NOT NULL, \ | ||
| FIELD0 varchar(1) DEFAULT NULL, \ | ||
| PRIMARY KEY (YCSB_KEY) \ | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;" | ||
|
|
||
| run_sql "INSERT INTO $DB.usertable2 VALUES (\"c\", \"d\");" | ||
|
|
||
| # backup db | ||
| echo "backup start..." | ||
| run_br --pd $PD_ADDR backup db --db "$DB" -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4 | ||
|
|
||
| run_sql "DROP DATABASE $DB;" | ||
|
|
||
| # restore db | ||
| echo "restore start..." | ||
| run_br restore db --db $DB -s "local://$TEST_DIR/$DB" --pd $PD_ADDR --online | ||
|
|
||
| table_count=$(run_sql "use $DB; show tables;" | grep "Tables_in" | wc -l) | ||
| if [ "$table_count" -ne "2" ];then | ||
| echo "TEST: [$TEST_NAME] failed!" | ||
| exit 1 | ||
| fi | ||
|
|
||
| run_sql "DROP DATABASE $DB;" |
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.