Skip to content

Commit

Permalink
br: make inc + log restore compatible (#18557)
Browse files Browse the repository at this point in the history
  • Loading branch information
hfxsd authored Aug 15, 2024
1 parent f597bb7 commit 2d19dec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions br/br-incremental-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ Because restoring the incremental backup relies on the snapshot of the database

The incremental backup does not support batch renaming of tables. If batch renaming of tables occurs during the incremental backup process, the data restore might fail. It is recommended to perform a full backup after batch renaming tables, and use the latest full backup to replace the incremental data during restore.

Starting from v8.3.0, the `--allow-pitr-from-incremental` configuration parameter is introduced to control whether incremental backups and subsequent log backups are compatible. The default value is `true`, which means that incremental backups are compatible with subsequent log backups.

- When you keep the default value `true`, the DDLs that need to be replayed are strictly checked before the incremental restore begins. This mode does not yet support `ADD INDEX`, `MODIFY COLUMN`, or `REORG PARTITION`. If you want to use incremental backups together with log backups, make sure that none of the preceding DDLs exist during the incremental backup process. Otherwise, these three DDLs cannot be replayed correctly.

- If you want to use incremental restores without log backups during the whole recovery process, you can set `--allow-pitr-from-incremental` to `false` to skip the checks in the incremental recovery phase.

## Back up incremental data

To back up incremental data, run the `tiup br backup` command with **the last backup timestamp** `--lastbackupts` specified. In this way, br command-line tool automatically backs up incremental data generated between `lastbackupts` and the current time. To get `--lastbackupts`, run the `validate` command. The following is an example:
Expand Down
4 changes: 4 additions & 0 deletions br/br-pitr-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ Expected output:
## Restore to a specified point in time (PITR)
> **Note:**
>
> If you specify `--full-backup-storage` as the incremental backup address for `restore point`, for restores of this backup and any previous incremental backups, you need to set the parameter `--allow-pitr-from-incremental` to `true` to make the incremental backups compatible with the subsequent log backups.
You can run the `tiup br restore point` command to perform a PITR on a new cluster or just restore the log backup data.
Run `tiup br restore point --help` to see the help information:
Expand Down

0 comments on commit 2d19dec

Please sign in to comment.