You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
br: clarify how statistics backup and restore are controlled - #24705
Clarify that BR statistics backup and restore are controlled separately from --with-sys-table.
Clarify in br/br-snapshot-manual.md that --with-sys-table restores selected system-table data such as privilege data and SQL bindings, while statistics are backed up only when --ignore-stats=false and restored according to --load-stats.
Replace the incorrect wildcard mysql.stat_* with mysql.stats_*.
Align the same clarification in br/br-snapshot-guide.md and faq/backup-and-restore-faq.md to keep the BR docs consistent.
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign lilin90 for approval. For more information see the Code Review Process. Please ensure that each of them provides their approval before proceeding.
The full list of commands accepted by this bot can be found here.
Details
Needs approval from an approver in each of these files:
The BR snapshot guide, manual, and backup-and-restore FAQ update the statistics-table pattern and clarify that backup and restore use separate controls.
Changes: Statistics backup and restore documentation
Layer / File(s)
Summary
Document statistics backup and restore controls br/br-snapshot-guide.md, br/br-snapshot-manual.md, faq/backup-and-restore-faq.md
The documents identify statistics tables as mysql.stats_*. They state that BR backs up statistics only when --ignore-stats=false and restores them according to --load-stats. The manual also clarifies that --with-sys-table does not restore these statistics tables, mysql.tidb, or mysql.global_variables.
The documentation clarification is accurate for the current branch. The guide and FAQ lists still say BR never restores statistics tables, without noting that --fast-load-sys-tables can restore them physically on an eligible restore. Readers could be misled, but nothing breaks, and the fix is a small wording change. The v7.5 backport needs its own version qualifier for --load-stats.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: clarifying how BR statistics backup and restore are controlled. The changeset updates the BR snapshot manual, guide, and FAQ to describe the --ignore-stats and --load-…
Description check
The description fills the required sections: it states what changed and why, lists the affected files, and ticks the target versions (master, v8.5, v8.1, v7.5). It also includes a reference link and t…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: clarifying how BR statistics backup and restore are controlled. The changeset updates the BR snapshot manual, guide, and FAQ to describe the --ignore-stats and --load-stats controls for statistics and to fix mysql.stat_* to mysql.stats_*. The title is specific and matches the primary change.
Full details: Description check
Explanation
The description fills the required sections: it states what changed and why, lists the affected files, and ticks the target versions (master, v8.5, v8.1, v7.5). It also includes a reference link and the AI agent involvement checkbox. The template's CLA checkbox is not ticked and the first-time contributor section is left as template text. The 'What is the related PR or file link(s)' section has no code PR link, which is acceptable because the change is docs-only. The description is mostly complete.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between db26e52 and 3e71bc6.
Files selected for processing: 3
br/br-snapshot-guide.md
br/br-snapshot-manual.md
faq/backup-and-restore-faq.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
**BR does not restore the following system tables:**
- Statistics tables (`mysql.stat_*`). But statistics can be restored. See [Back up statistics](/br/br-snapshot-manual.md#back-up-statistics).
- Statistics tables (`mysql.stats_*`). However, statistics can still be restored separately. BR backs up statistics only when `--ignore-stats=false` and restores them according to `--load-stats`. See [Back up statistics](/br/br-snapshot-manual.md#back-up-statistics).
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Scope the statistics-table exclusion to the logical restore path.
The "BR does not restore" list states that statistics tables are never restored. The guide and manual also say that --fast-load-sys-tables restores them physically on an eligible restore to a new cluster. Add that condition to the list item, and keep the separate-restore note.
The FAQ list at faq/backup-and-restore-faq.md:285 has the same unqualified statement. Apply the same wording there.
Suggested wording for br/br-snapshot-guide.md
--- "a/br/br-snapshot-guide.md"+++ "b/br/br-snapshot-guide.md"@@ -173,7 +173,7 @@
**BR does not restore the following system tables:**
-- Statistics tables (`mysql.stats_*`). However, statistics can still be restored separately. BR backs up statistics only when `--ignore-stats=false` and restores them according to `--load-stats`. See [Back up statistics](/br/br-snapshot-manual.md#back-up-statistics).+- Statistics tables (`mysql.stats_*`), unless `--fast-load-sys-tables` restores them physically on an eligible restore to a new cluster. Statistics can also be restored separately: BR backs up statistics only when `--ignore-stats=false` and restores them according to `--load-stats`. See [Back up statistics](/br/br-snapshot-manual.md#back-up-statistics).
- System variable tables (`mysql.tidb` and `mysql.global_variables`)
- Other system tables
Committable suggestion
IMPORTANT
Review the replacement and indentation, then test before committing.
Suggested change
- Statistics tables (`mysql.stats_*`). However, statistics can still be restored separately. BR backs up statistics only when `--ignore-stats=false` and restores them according to `--load-stats`. See [Back up statistics](/br/br-snapshot-manual.md#back-up-statistics).
- Statistics tables (`mysql.stats_*`), unless `--fast-load-sys-tables` restores them physically on an eligible restore to a new cluster. Statistics can also be restored separately: BR backs up statistics only when `--ignore-stats=false` and restores them according to `--load-stats`. See [Back up statistics](/br/br-snapshot-manual.md#back-up-statistics).
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
area/brIndicates that the Issue or PR belongs to the area of BR (Backup & Restore).contributionThis PR is from a community contributor.needs-cherry-pick-release-7.5Should cherry pick this PR to release-7.5 branch.needs-cherry-pick-release-8.1Should cherry pick this PR to release-8.1 branch.needs-cherry-pick-release-8.5Should cherry pick this PR to release-8.5 branch.ONCALLRelates to documentation oncall.requires-version-specific-changesAfter cherry-picked, the cherry-picked PR requires further changes.size/XSDenotes a PR that changes 0-9 lines, ignoring generated files.translation/doneThis PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR.type/bugfixThis PR fixes a bug.
1 participant
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.
What is changed, added, or deleted? (Required)
Clarify that BR statistics backup and restore are controlled separately from
--with-sys-table.br/br-snapshot-manual.mdthat--with-sys-tablerestores selected system-table data such as privilege data and SQL bindings, while statistics are backed up only when--ignore-stats=falseand restored according to--load-stats.mysql.stat_*withmysql.stats_*.br/br-snapshot-guide.mdandfaq/backup-and-restore-faq.mdto keep the BR docs consistent.Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
AI agent involvement
Do your changes match any of the following descriptions?
Summary by CodeRabbit
--with-sys-table.