Skip to content

br: pitr filter feature release doc #21109

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
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Tristan1900
Copy link
Contributor

@Tristan1900 Tristan1900 commented Jun 3, 2025

First-time contributors' checklist

What is changed, added or deleted? (Required)

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.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 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: Wenqi Mou <[email protected]>
Copy link

ti-chi-bot bot commented Jun 3, 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 qiancai 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.

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 missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 3, 2025
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.

Hello @Tristan1900, 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!

Summary of Changes

Hello! Gemini here, providing a summary of this pull request. This PR focuses on updating the documentation for TiDB's Backup & Restore (BR) tool, specifically for Point-in-Time Recovery (PITR). The main goal is to introduce and document two new features available from TiDB v9.0.0: the ability to filter PITR restore operations by database or table, and the capability to run multiple PITR restore operations concurrently. Additionally, the documentation is updated to clarify the compatibility of ongoing log backup tasks with both snapshot and PITR restore operations.

Highlights

  • Concurrent PITR Restores: Introduces documentation for the ability to run multiple tiup br restore point operations simultaneously, provided they target non-overlapping datasets. Includes usage examples.
  • Log Backup Compatibility: Updates and adds documentation sections clarifying the compatibility of ongoing log backup tasks with both snapshot (br restore full|database|table) and PITR (br restore point) restore operations in v9.0.0, including important limitations for PITR.

Changelog

  • br/br-pitr-manual.md
    • Added a new section 'Restore with filters' explaining how to use filters with tiup br restore point, including syntax, examples, and notes (starting around line 499).
    • Added a new section 'Concurrent restore operations' documenting the ability to run multiple PITR restores concurrently, with examples (starting around line 548).
    • Slightly rephrased a sentence in the 'Compatibility between ongoing log backup and snapshot restore' section (around line 588).
    • Added a new section 'Compatibility between ongoing log backup and PITR operations' detailing how PITR interacts with ongoing log backups and noting limitations (starting around line 598).
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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 introduces documentation for new PITR (Point-in-Time Recovery) features in TiDB v9.0.0, specifically restoring with filters and concurrent restore operations. It also clarifies compatibility between ongoing log backups and PITR. The changes are well-structured and add valuable information for users. The examples provided are clear and helpful.

I have a few minor suggestions to enhance clarity and adherence to the style guide. Overall, this is a good addition to the documentation.

Summary of Findings

  • Style Guide Adherence: Minor suggestions related to using the second person ('you'), formatting (blank lines), and sentence structure for improved readability, aligning with the provided style guide.
  • Markdown Best Practices: Suggestion to add a newline at the end of the file, which is a common best practice for Markdown files.

Merge Readiness

The pull request significantly improves the documentation by adding details about new PITR features. The content is well-written and informative. The suggested changes are minor and mostly stylistic or for enhanced readability. After addressing these minor points, the documentation should be in excellent shape. As per the style guide, I am providing comments rather than requesting changes to avoid blocking the merge. I am not authorized to approve pull requests; please ensure it undergoes the standard review and approval process.

> - When using filters, ensure that the filtered data maintains referential integrity.
> - Filter options apply to both snapshot and log backup restoration phases.
> - Multiple `--filter` options can be specified to include or exclude different patterns.
> - PITR filtering does not support restoring system tables. System tables are restored according to the full backup data and cannot be selectively filtered during PITR operations. If you need to restore specific system tables, use `br restore full` with filters instead, which will restore only the snapshot backup data (not log backup data).

Choose a reason for hiding this comment

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

medium

This bullet point contains a lot of information in a single sentence, which can make it a bit dense. For improved readability 1, would you consider rephrasing it slightly or breaking it into more digestible parts within the bullet point?

Style Guide References

Suggested change
> - PITR filtering does not support restoring system tables. System tables are restored according to the full backup data and cannot be selectively filtered during PITR operations. If you need to restore specific system tables, use `br restore full` with filters instead, which will restore only the snapshot backup data (not log backup data).
PITR filtering does not support restoring system tables. System tables are restored based on the full backup data and cannot be selectively filtered during PITR operations. If you need to restore specific system tables, use `br restore full` with filters. This command restores only the snapshot backup data, not the log backup data.

Footnotes

  1. The style guide emphasizes clarity, simplicity, and readability. (link)


Starting from TiDB v9.0.0, you can use filters during PITR to selectively restore specific databases or tables. This allows for more granular control over what data gets restored during point-in-time recovery operations.


Choose a reason for hiding this comment

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

low

There appears to be an extra blank line here (line 503, following line 502 which is also blank). Typically, one blank line is sufficient to separate paragraphs in Markdown. Could you remove one of them for conciseness and standard formatting? 1

Style Guide References

Footnotes

  1. Style guide advises avoiding unnecessary words and repetition, which can be extended to unnecessary spacing for conciseness. (link)


> **Note:**
>
> - When using filters, ensure that the filtered data maintains referential integrity.

Choose a reason for hiding this comment

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

low

To align with the style guide's preference for addressing users in the second person 1, consider rephrasing this sentence.

Style Guide References

Suggested change
> - When using filters, ensure that the filtered data maintains referential integrity.
When you use filters, ensure that the filtered data maintains referential integrity.

Footnotes

  1. The style guide recommends writing in the second person ('you') when addressing users. (link)

>
> - Each concurrent restore operation must target different databases or non-overlapping table sets. Attempting to restore overlapping datasets concurrently will result in an error.


Choose a reason for hiding this comment

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

low

There seems to be an extra blank line here before the next section heading. To maintain consistent formatting and conciseness 1, could you please remove it?

Style Guide References

Footnotes

  1. The style guide specifies adding a blank line before and after headings and lists, implying that excessive blank lines should be avoided. (link)

#### Important limitation for PITR with ongoing log backup

When performing PITR operations while log backup is running, the restored data will be recorded in the log backup. However, during the restore time window, the data may not be consistent due to the nature of log restore operations. 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

To maintain consistency with the style guide's recommendation to use the second person ('you') 1, could the beginning of this sentence be rephrased?

Style Guide References

Suggested change
When performing PITR operations while log backup is running, the restored data will be recorded in the log backup. However, during the restore time window, the data may not be consistent due to the nature of log restore operations. 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 log backup is running, the restored data will be recorded in the log backup. However, during the restore time window, the data may not be consistent due to the nature of log restore operations. The system writes metadata to external storage to mark both the time range and data range where consistency cannot be guaranteed.

Footnotes

  1. The style guide recommends writing in the second person ('you') when addressing users. (link)


- Restore data up to `t1` (before the inconsistent period), or
- Take a new snapshot backup after `t2` and use that for future PITR operations

Choose a reason for hiding this comment

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

low

It's a common best practice for Markdown files (and text files in general) to end with a newline character. This can prevent potential issues with some tools or systems that process these files and improves diff readability. Could you please add a newline at the very end of this file?

Copy link

ti-chi-bot bot commented Jun 3, 2025

@Tristan1900: 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 00139ff link true /test pull-verify

Full PR test history. Your PR dashboard.

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.

@lilin90 lilin90 added the translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. label Jun 4, 2025
@ti-chi-bot ti-chi-bot bot removed the missing-translation-status This PR does not have translation status info. label Jun 4, 2025
@lilin90 lilin90 added missing-translation-status This PR does not have translation status info. v9.0-beta.2 This PR/issue applies to TiDB v9.0-beta.2. labels Jun 4, 2025
@lilin90 lilin90 self-assigned this Jun 4, 2025
@lilin90 lilin90 self-requested a review June 4, 2025 02:44
@lilin90 lilin90 removed the missing-translation-status This PR does not have translation status info. label Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a 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