Skip to content

Commit 89de573

Browse files
authored
BR: add lock with ttl for checkpoint backup (#40563)
close #40561
1 parent 6b752fe commit 89de573

File tree

6 files changed

+254
-28
lines changed

6 files changed

+254
-28
lines changed

br/pkg/backup/client.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,13 @@ func (bc *Client) StartCheckpointRunner(
312312
}
313313
}
314314

315-
bc.checkpointRunner = checkpoint.StartCheckpointRunner(ctx, bc.storage, bc.cipher)
316-
return nil
315+
bc.checkpointRunner, err = checkpoint.StartCheckpointRunner(ctx, bc.storage, bc.cipher, bc.mgr.GetPDClient())
316+
return errors.Trace(err)
317317
}
318318

319-
func (bc *Client) WaitForFinishCheckpoint() {
319+
func (bc *Client) WaitForFinishCheckpoint(ctx context.Context) {
320320
if bc.checkpointRunner != nil {
321-
bc.checkpointRunner.WaitForFinish()
321+
bc.checkpointRunner.WaitForFinish(ctx)
322322
}
323323
}
324324

br/pkg/checkpoint/BUILD.bazel

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ go_library(
1515
"@com_github_pingcap_errors//:errors",
1616
"@com_github_pingcap_kvproto//pkg/brpb",
1717
"@com_github_pingcap_log//:log",
18+
"@com_github_tikv_client_go_v2//oracle",
1819
"@org_uber_go_zap//:zap",
1920
],
2021
)
@@ -29,5 +30,6 @@ go_test(
2930
"@com_github_pingcap_kvproto//pkg/brpb",
3031
"@com_github_pingcap_kvproto//pkg/encryptionpb",
3132
"@com_github_stretchr_testify//require",
33+
"@com_github_tikv_client_go_v2//oracle",
3234
],
3335
)

0 commit comments

Comments
 (0)