-
Notifications
You must be signed in to change notification settings - Fork 1.2k
restore: update the definition of the parameter --load-stats
and the usage of pitr id map
#20346
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
Leavrth
wants to merge
8
commits into
pingcap:master
Choose a base branch
from
Leavrth:load_stats_and_pitr_id_map
base: master
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
8 commits
Select commit
Hold shift + click to select a range
6dee38c
draft
Leavrth f93d5a6
fix typos
Leavrth dd8aa2b
commit some suggestions
Leavrth f6d7401
Update br/br-snapshot-manual.md
Leavrth d72d971
update the parameter
Leavrth 0a92267
Merge branch 'load_stats_and_pitr_id_map' of github.com:Leavrth/docs-…
Leavrth 44dd7c0
add notice
Leavrth adf4a3d
add notice
Leavrth 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 | ||||
---|---|---|---|---|---|---|
|
@@ -132,8 +132,19 @@ tiup br restore full \ | |||||
--storage local:///br_data/ --pd "${PD_IP}:2379" --log-file restore.log | ||||||
``` | ||||||
|
||||||
> **注意:** | ||||||
> | ||||||
> 从 v9.0.0 起,当设置参数 `--load-stats` 为 false 时,br 将不会在表 `mysql.stats_meta` 中更新恢复的表的相关信息。你可以在恢复完成后手动执行 analyze table,更新相关统计信息。 | ||||||
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.
Suggested change
|
||||||
|
||||||
备份恢复功能在备份时,将统计信息通过 JSON 格式存储在 `backupmeta` 文件中。在恢复时,将 JSON 格式的统计信息导入到集群中。详情请参考 [LOAD STATS](/sql-statements/sql-statement-load-stats.md)。 | ||||||
|
||||||
从 9.0.0 起,BR 引入参数 `--fast-load-sys-tables`,默认开启。当 br 命令行工具恢复在全新集群并且上下游表和分区的 ID 都能被复用时(否则,将自动回退为逻辑导入统计信息数据),通过设置 `--fast-load-sys-tables` 会将统计信息相关表恢复到临时系统库 `__TiDB_BR_Temporary_mysql` 中,再通过 `RENAME TABLE` DDL 将恢复的统计信息表和 `mysql` 库下的表进行原子交换。示例如下: | ||||||
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.
Suggested change
|
||||||
|
||||||
```shell | ||||||
tiup br restore full \ | ||||||
--storage local:///br_data/ --pd "${PD_IP}:2379" --log-file restore.log --load-stats --fast-load-sys-tables | ||||||
``` | ||||||
|
||||||
## 备份数据加密 | ||||||
|
||||||
br 命令行工具支持在备份端,或备份到 Amazon S3 的时候在[存储服务端进行备份数据加密](/br/backup-and-restore-storages.md#amazon-s3-存储服务端加密备份数据),你可以根据自己情况选择其中一种使用。 | ||||||
|
@@ -186,6 +197,22 @@ Download&Ingest SST <----------------------------------------------------------- | |||||
Restore Pipeline <-------------------------/...............................................> 17.12% | ||||||
``` | ||||||
|
||||||
自 TiDB v9.0.0 起,你可以通过指定参数 `--fast-load-sys-tables` 在全新的集群上进行物理恢复系统表: | ||||||
|
||||||
```shell | ||||||
tiup br restore full \ | ||||||
--pd "${PD_IP}:2379" \ | ||||||
--with-sys-table \ | ||||||
--fast-load-sys-tables \ | ||||||
--storage "s3://${backup_collection_addr}/snapshot-${date}?access-key=${access-key}&secret-access-key=${secret-access-key}" \ | ||||||
--ratelimit 128 \ | ||||||
--log-file restorefull.log | ||||||
``` | ||||||
|
||||||
> **注意:** | ||||||
> | ||||||
> 与通过 `REPLACE INTO` SQL 写入的逻辑恢复系统表方式不同,物理恢复系统表将会完全覆盖系统表中原有的数据。 | ||||||
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.
Suggested change
|
||||||
|
||||||
## 恢复备份数据中指定库表的数据 | ||||||
|
||||||
br 命令行工具支持只恢复备份数据中指定库/表的局部数据。该功能在恢复过程中过滤掉不需要的数据,可以用于往 TiDB 集群上恢复指定库/表的数据。 | ||||||
|
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.