tidb集群日志备份失败

【 TiDB 使用环境】 测试
在启动日志备份时失败,报错命令是:
tiup br log start --task-name=pitr --pd “192.168.246.128:2379” --storage ‘local:///nfs/data/log-backup’
错误提示是:

[2023/08/28 10:19:41.096 +08:00] [INFO] [collector.go:77] ["log start failed summary"] [total-ranges=1] [ranges-succeed=0] [ranges-failed=1] [unit-name="log start"] [error="failed to check gc safePoint, ts 443729366923870209: GC safepoint 443859160963219456 exceed TS 443729366923870209: [BR:Backup:ErrBackupGCSafepointExceeded]backup GC safepoint exceeded"] [errorVerbose="[BR:Backup:ErrBackupGCSafepointExceeded]backup GC safepoint exceeded\nGC safepoint 443859160963219456 exceed TS 443729366923870209\ngithub.com/pingcap/tidb/br/pkg/utils.CheckGCSafePoint\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/pkg/utils/safe_point.go:78\ngithub.com/pingcap/tidb/br/pkg/task.(*streamMgr).setGCSafePoint\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/pkg/task/stream.go:389\ngithub.com/pingcap/tidb/br/pkg/task.RunStreamStart\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/pkg/task/stream.go:596\ngithub.com/pingcap/tidb/br/pkg/task.RunStreamCommand\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/pkg/task/stream.go:529\nmain.streamCommand\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/cmd/br/stream.go:232\nmain.newStreamStartCommand.func1\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/cmd/br/stream.go:70\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:940\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992\nmain.main\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/cmd/br/main.go:58\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1598\nfailed to check gc safePoint, ts 443729366923870209"]
Error: failed to check gc safePoint, ts 443729366923870209: GC safepoint 443859160963219456 exceed TS 443729366923870209: [BR:Backup:ErrBackupGCSafepointExceeded]backup GC safepoint exceeded

暂停日志备份任务后,备份程序为了防止生成变更日志的 MVCC 数据被 GC,暂停任务程序会自动将当前备份点 checkpoint 设置为 service safepoint,允许保留最近 24 小时内的 MVCC 数据。当超过 24 小时后,备份点 checkpoint 的 MVCC 数据已经被 GC,此时程序会拒绝恢复备份任务。

此场景的处理办法是:先执行 br log stop 命令来删除当前的任务,然后执行 br log start 重新创建新的日志备份任务,同时做一个全量备份,便于后续做 PITR 恢复操作。

https://docs.pingcap.com/zh/tidb/stable/backup-and-restore-faq#执行-br-log-resume-命令恢复处于暂停状态的任务时报-errbackupgcsafepointexceeded-错误该如何处理

先把gc时间调长,比如24小时,然后做个全库备份,然后开始启动日志备份

此话题已在最后回复的 60 天后被自动关闭。不再允许新回复。