From decff435794b8339dfb053f752b08fefdf063f3e Mon Sep 17 00:00:00 2001 From: Jianjun Liao Date: Wed, 7 Aug 2024 17:06:48 +0800 Subject: [PATCH 1/2] fix checkpoint path Signed-off-by: Jianjun Liao --- br/pkg/checkpoint/checkpoint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/br/pkg/checkpoint/checkpoint.go b/br/pkg/checkpoint/checkpoint.go index a7707afda2e04..e1c86dd3cb686 100644 --- a/br/pkg/checkpoint/checkpoint.go +++ b/br/pkg/checkpoint/checkpoint.go @@ -41,7 +41,7 @@ import ( "golang.org/x/sync/errgroup" ) -const CheckpointDir = "/checkpoints" +const CheckpointDir = "checkpoints" type flushPosition struct { CheckpointDataDir string From 6bbb200d077f8341e76b82ca37279d22f36795b1 Mon Sep 17 00:00:00 2001 From: Jianjun Liao Date: Wed, 25 Sep 2024 16:46:57 +0800 Subject: [PATCH 2/2] resolve conflicts Signed-off-by: Jianjun Liao --- br/pkg/checkpoint/checkpoint.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/br/pkg/checkpoint/checkpoint.go b/br/pkg/checkpoint/checkpoint.go index e1c86dd3cb686..eac317ca0a5f3 100644 --- a/br/pkg/checkpoint/checkpoint.go +++ b/br/pkg/checkpoint/checkpoint.go @@ -22,6 +22,7 @@ import ( "encoding/json" "fmt" "math/rand" + "path" "strings" "sync" "time" @@ -641,8 +642,8 @@ func (r *CheckpointRunner[K, V]) checkLockFile(ctx context.Context, now int64) e } else if lock.LockId != r.lockId { return errors.Errorf("The existing lock will expire in %d seconds. "+ "There may be another BR(%d) running. If not, you can wait for the lock to expire, "+ - "or delete the file `%s%s` manually.", - (lock.ExpireAt-now)/1000, lock.LockId, strings.TrimRight(r.storage.URI(), "/"), r.CheckpointLockPath) + "or delete the file `%s` manually.", + (lock.ExpireAt-now)/1000, lock.LockId, path.Join(r.storage.URI(), r.CheckpointLockPath)) } return nil