Skip to content

Commit

Permalink
docs: add --with-sys-table detail description (#14919)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oreoxmt authored Oct 7, 2023
1 parent c970044 commit 4d638de
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 24 additions & 1 deletion br/br-snapshot-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,38 @@ Starting from BR v5.1.0, when you back up snapshots, BR backs up the **system ta
| mysql.role_edges |
| mysql.tables_priv |
| mysql.user |
| mysql.bind_info |
+----------------------------------+
```

**BR does not restore the following system tables:**

- Statistics tables (`mysql.stats_*`)
- Statistics tables (`mysql.stat_*`)
- System variable tables (`mysql.tidb` and `mysql.global_variables`)
- [Other system tables](https://github.com/pingcap/tidb/blob/master/br/pkg/restore/systable_restore.go#L31)

```
+-----------------------------------------------------+
| capture_plan_baselines_blacklist |
| column_stats_usage |
| gc_delete_range |
| gc_delete_range_done |
| global_variables |
| schema_index_usage |
| stats_buckets |
| stats_extended |
| stats_feedback |
| stats_fm_sketch |
| stats_histograms |
| stats_history |
| stats_meta |
| stats_meta_history |
| stats_table_locked |
| stats_top_n |
| tidb |
+-----------------------------------------------------+
```

When you restore data related to system privilege, note the following:

- BR does not restore user data with `user` as `cloud_admin` and `host` as `'%'`. This user is reserved for TiDB Cloud. Do not create a user or role named `cloud_admin` in your cluster, because the user privileges related to `cloud_admin` cannot be restored correctly.
Expand Down
2 changes: 2 additions & 0 deletions br/br-snapshot-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ You can restore a TiDB cluster snapshot by running the `br restore full` command
```shell
br restore full \
--pd "${PD_IP}:2379" \
--with-sys-table \
--storage "s3://${backup_collection_addr}/snapshot-${date}?access-key=${access-key}&secret-access-key=${secret-access-key}" \
--ratelimit 128 \
--log-file restorefull.log
```

In the preceding command:

- `--with-sys-table`: BR restores **data in some system tables**, including account permission data and SQL bindings. However, it does not restore statistics tables (`mysql.stat_*`) and system variable tables (`mysql.tidb` and `mysql.global_variables`). For more information, see [Restore tables in the `mysql` schema](/br/br-snapshot-guide.md#restore-tables-in-the-mysql-schema).
- `--ratelimit`: The maximum speed **per TiKV** performing backup tasks. The unit is in MiB/s.
- `--log-file`: The target file where the `br` log is written.

Expand Down

0 comments on commit 4d638de

Please sign in to comment.