Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 请问一下 在开启全备和日志备份的下 能不能在tikv数据全没的时候把数据完全恢复过来。会丢几分钟数据?
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’
Sure, you can check the checkpoint to see how much is lost. The incremental PITR (Point-in-Time Recovery) has progress.
That means some data might be lost, depending on the progress?
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.
I feel that a dual backup strategy with full backups and log backups should ensure no data loss.
Check the time difference in the log recording progress; the difference indicates how much data is lost.
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 文档中心