Skip to content

Commit

Permalink
session: fix wrong etcd mutex key (pingcap#56371)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjhuang2016 authored and EricZequan committed Sep 29, 2024
1 parent e6a96b2 commit c1117da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/session/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ func acquireLock(s sessiontypes.Session) (func(), bool) {
// do nothing
}, true
}
releaseFn, err := owner.AcquireDistributedLock(context.Background(), cli, ddl.DDLOwnerKey, 10)
releaseFn, err := owner.AcquireDistributedLock(context.Background(), cli, bootstrapOwnerKey, 10)
if err != nil {
return nil, false
}
Expand All @@ -1447,6 +1447,7 @@ func forceToLeader(ctx context.Context, s sessiontypes.Session) error {
for !dom.DDL().OwnerManager().IsOwner() {
ownerID, err := dom.DDL().OwnerManager().GetOwnerID(ctx)
if err != nil && (errors.ErrorEqual(err, concurrency.ErrElectionNoLeader) || strings.Contains(err.Error(), "no owner")) {
logutil.BgLogger().Info("ddl owner not found", zap.Error(err))
time.Sleep(50 * time.Millisecond)
continue
} else if err != nil {
Expand Down

0 comments on commit c1117da

Please sign in to comment.