Can data be fully restored when all TiKV data is lost with full backup and log backup enabled? How many minutes of data will be lost?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 请问一下 在开启全备和日志备份的下 能不能在tikv数据全没的时候把数据完全恢复过来。会丢几分钟数据?

| username: tidb狂热爱好者

Could you please tell me if it is possible to fully restore the data when all TiKV data is lost with full backup and log backup enabled? How many minutes of data will be lost?
*tiup br log start --task-name=pitr --send-credentials-to-tikv=false --pd=“${IP}:2379” *

–storage=‘s3://test-tidb/backup-data/log-backup’

| username: WalterWj | Original post link

Sure, you can check the checkpoint to see how much is lost. The incremental PITR (Point-in-Time Recovery) has progress.

| username: tidb狂热爱好者 | Original post link

That means some data might be lost, depending on the progress?

| username: 有猫万事足 | Original post link

After enabling log backup, you can use the following command to check the status of the log backup:

tiup br log status

The output will include:

checkpoint[global]: 2022-05-13 11:31:47.2 +0800; gap=4m53s

gap=4m53s indicates how far behind the current log backup is.

The duration of data loss during br’s PITR recovery depends on this gap.

| username: yiduoyunQ | Original post link

| username: 小于同学 | Original post link

Sure.

| username: 友利奈绪 | Original post link

I feel that a dual backup strategy with full backups and log backups should ensure no data loss.

| username: zhaokede | Original post link

Check the time difference in the log recording progress; the difference indicates how much data is lost.

| username: jiayou64 | Original post link

The checkpoint [global] will have the last successful entry in the output log, and you can compare it with your current time to verify. Without testing, it’s hard to estimate the time needed for recovery.
Reference: TiDB 日志备份与 PITR 使用指南 | PingCAP 文档中心