Skip to content

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #21835

What is changed, added or deleted? (Required)

Updates notes about PITR filter and concurrent restore.

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 (in Chinese).

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. v9.0-beta.2 This PR/issue applies to TiDB v9.0-beta.2. labels Dec 18, 2025
@ti-chi-bot
Copy link
Member Author

@lilin90 This PR has conflicts, I have hold it.
Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 18, 2025

@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 18, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign icemap 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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 18, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @ti-chi-bot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the documentation for TiDB's Point-in-Time Recovery (PITR) features. It introduces comprehensive guides on how to leverage data filtering for selective restores, perform concurrent restore operations for improved efficiency, and navigate the complexities of compatibility between ongoing log backups and various restore types. Additionally, it provides crucial information on aborting failed restore tasks, ensuring users have the necessary tools and knowledge for robust data management.

Highlights

  • PITR Data Filtering: Documentation has been added for using filters during Point-in-Time Recovery (PITR) to restore specific databases or tables, offering fine-grained control over restored data. This feature is available from TiDB v9.0.0.
  • Concurrent PITR Restores: New guidance is available for running multiple PITR restore tasks concurrently, which can improve efficiency for large-scale restore scenarios. This functionality is supported from TiDB v9.0.0.
  • Log Backup Compatibility: The documentation now includes detailed information on the compatibility between ongoing log backup tasks and both snapshot and PITR restore operations, outlining conditions and limitations for TiDB v9.0.0 and later.
  • Abort Restore Operations: Instructions and examples for using the tiup br abort command to clean up metadata for failed restore operations have been added, covering various restore types.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds documentation for PITR filter and concurrent restore features. The changes are well-written and provide useful information for users. I have a few minor suggestions to improve clarity and conciseness, mainly related to grammar and phrasing, in line with the documentation style guide.

Comment on lines +550 to +553
> - The regular expression in the restore task matches the table name at the `restored-ts` time point, with the following three possible cases:
> - Table A (table id = 1): the table name always matches the `--filter` regular expression at and before the `restored-ts` time point. In this case, PITR restores the table.
> - Table B (table id = 2): the table name does not match the `--filter` regular expression at some point before `restored-ts`, but matches at the `restored-ts` time point. In this case, PITR restores the table.
> - Table C (table id = 3): the table name matches the `--filter` regular expression at some point before `restored-ts`, but does **not** match at the `restored-ts` time point. In this case, PITR does **not** restore the table.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

This explanation of how filters work with table renames is a bit verbose. For better readability, you can simplify it to focus on the core logic that the filter is evaluated against the table name at restored-ts.

Suggested change
> - The regular expression in the restore task matches the table name at the `restored-ts` time point, with the following three possible cases:
> - Table A (table id = 1): the table name always matches the `--filter` regular expression at and before the `restored-ts` time point. In this case, PITR restores the table.
> - Table B (table id = 2): the table name does not match the `--filter` regular expression at some point before `restored-ts`, but matches at the `restored-ts` time point. In this case, PITR restores the table.
> - Table C (table id = 3): the table name matches the `--filter` regular expression at some point before `restored-ts`, but does **not** match at the `restored-ts` time point. In this case, PITR does **not** restore the table.
- The filter matches against the table name as it exists at the `restored-ts` timestamp. This means:
- If a table's name matches the filter at `restored-ts`, PITR restores the table, even if its name did not match at an earlier time.
- If a table's name does not match the filter at `restored-ts`, PITR does **not** restore the table, even if its name did match at an earlier time.

### Compatibility between ongoing log backup and snapshot restore
Starting from v9.0.0, when a log backup task is running, if all of the following conditions are met, you can still perform snapshot restore (`br restore [full|database|table]`) and allow the restored data to be properly recorded by the ongoing log backup (hereinafter referred to as "log backup"):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The term 'log backup' is used consistently in this document. To improve readability, you can remove the parenthetical phrase '(hereinafter referred to as "log backup")'.

Suggested change
Starting from v9.0.0, when a log backup task is running, if all of the following conditions are met, you can still perform snapshot restore (`br restore [full|database|table]`) and allow the restored data to be properly recorded by the ongoing log backup (hereinafter referred to as "log backup"):
Starting from v9.0.0, when a log backup task is running, if all of the following conditions are met, you can still perform snapshot restore (`br restore [full|database|table]`) and allow the restored data to be properly recorded by the ongoing log backup:

#### Important limitation for PITR with ongoing log backup
When you perform the PITR operations while a log backup is running, the restored data will also be recorded in the ongoing log backup. However, due to the nature of log restore operations, data inconsistencies might occur within the restore window. The system writes metadata to external storage to mark both the time range and data range where consistency cannot be guaranteed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

For better readability, you can remove the definite article 'the' before 'PITR operations'.

Suggested change
When you perform the PITR operations while a log backup is running, the restored data will also be recorded in the ongoing log backup. However, due to the nature of log restore operations, data inconsistencies might occur within the restore window. The system writes metadata to external storage to mark both the time range and data range where consistency cannot be guaranteed.
When you perform PITR operations while a log backup is running, the restored data will also be recorded in the ongoing log backup. However, due to the nature of log restore operations, data inconsistencies might occur within the restore window. The system writes metadata to external storage to mark both the time range and data range where consistency cannot be guaranteed.

>
> The `abort` command only cleans up metadata. You need to manually delete any actual restored data from the cluster.
The examples of aborting restore operations using the same parameters as the original restore command are as follows:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

For conciseness, you can rephrase this sentence to be more direct.

Suggested change
The examples of aborting restore operations using the same parameters as the original restore command are as follows:
Examples of aborting restore operations using the same parameters as the original restore command are as follows:

@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 18, 2025

@ti-chi-bot: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-verify ce1bbe3 link true /test pull-verify

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. v9.0-beta.2 This PR/issue applies to TiDB v9.0-beta.2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants