Skip to content

Commit

Permalink
session: fix wrong etcd mutex key (#56371)
Browse files Browse the repository at this point in the history
close #56375
  • Loading branch information
wjhuang2016 authored Sep 29, 2024
1 parent 9f11e6f commit 8bacf9c
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 8bacf9c

Please sign in to comment.