-
Notifications
You must be signed in to change notification settings - Fork 709
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
Changes from 2 commits
8ce635d
0ac24f6
b14ce78
00139ff
5c0c9b3
d898e96
5024798
eaeee2f
fabd5a8
1257b37
66655a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -496,6 +496,84 @@ tiup br restore point --pd="${PD_IP}:2379" | |||||
| --master-key "local:///path/to/master.key" | ||||||
| ``` | ||||||
|
|
||||||
| ### Restore with filters | ||||||
|
|
||||||
| 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. | ||||||
Tristan1900 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
|
|
||||||
lilin90 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| The filter patterns follow the same syntax as [table filters](/table-filter.md) used in other BR operations: | ||||||
Tristan1900 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| - `'*.*'` - matches all databases and tables | ||||||
| - `'db1.*'` - matches all tables in database `db1` | ||||||
| - `'db1.table1'` - matches specific table `table1` in database `db1` | ||||||
| - `'db*.tbl*'` - matches databases starting with `db` and tables starting with `tbl` | ||||||
| - `'!mysql.*'` - excludes all tables in the `mysql` database | ||||||
|
|
||||||
| Usage examples: | ||||||
|
|
||||||
| ```shell | ||||||
| # restore specific databases | ||||||
| tiup br restore point --pd="${PD_IP}:2379" \ | ||||||
| --storage='s3://backup-101/logbackup?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}' \ | ||||||
| --full-backup-storage='s3://backup-101/snapshot-20250602000000?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}' \ | ||||||
| --start-ts "2025-06-02 00:00:00+0800" \ | ||||||
| --restored-ts "2025-06-03 18:00:00+0800" \ | ||||||
| --filter 'db1.*' --filter 'db2.*' | ||||||
|
|
||||||
| # restore specific tables | ||||||
| tiup br restore point --pd="${PD_IP}:2379" \ | ||||||
| --storage='s3://backup-101/logbackup?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}' \ | ||||||
| --full-backup-storage='s3://backup-101/snapshot-20250602000000?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}' \ | ||||||
| --start-ts "2025-06-02 00:00:00+0800" \ | ||||||
| --restored-ts "2025-06-03 18:00:00+0800" \ | ||||||
| --filter 'db1.users' --filter 'db1.orders' | ||||||
|
|
||||||
| # restore with pattern matching | ||||||
Tristan1900 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| tiup br restore point --pd="${PD_IP}:2379" \ | ||||||
| --storage='s3://backup-101/logbackup?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}' \ | ||||||
| --full-backup-storage='s3://backup-101/snapshot-20250602000000?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}' \ | ||||||
| --start-ts "2025-06-02 00:00:00+0800" \ | ||||||
| --restored-ts "2025-06-03 18:00:00+0800" \ | ||||||
| --filter 'db*.tbl*' | ||||||
| ``` | ||||||
|
|
||||||
| > **Note:** | ||||||
| > | ||||||
| > - When using filters, ensure that the filtered data maintains referential integrity. | ||||||
Tristan1900 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| > - 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). | ||||||
|
||||||
| > - 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
hfxsd marked this conversation as resolved.
Show resolved
Hide resolved
Tristan1900 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tristan1900 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
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.
Uh oh!
There was an error while loading. Please reload this page.