Skip to content

[Improvement] tidb pitr improvements #9394

@cjc7373

Description

@cjc7373

In tidb addon, I use br tool to do backup and restore. During the development of pitr restore, there are some problems that needs improvement of kubeblocks.

Problem 1

br does full backup restore and pitr restore in one command. But they are separated jobs in kubeblocks.

I suggest add an option to merge full backup restore and pitr restore jobs. And the full backup name should be passed as an env variable to the pitr restore job.

Problem 2

The new log backup job is started before restore finished. br has a restriction that a only one log backup/restore job can be run at the same time.

I suggest check the cluster restore annotation in the backup controller, and delay backup job creation when the cluster is restoring.

Problem 3

tidb addon's restore job is issued to pd component, then pd executes restore command in all tikv nodes. So that when doing restore, tikv nodes must be all running. There's a DoReadyRestoreAfterClusterRunning option in the restore annotaion that does exactly what it says. However, this option needs to be set every in restore job. I suggest change it to an actionset-level option.

EDIT: I just found backup job will inherit target pod's env. So I could just target tidb pod to run backup script (and get pd info based on the env). This problem is no longer valid.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions