Skip to content

Commit

Permalink
cherry pick pingcap#33536 to release-5.4
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <[email protected]>
  • Loading branch information
xuyifangreeneyes authored and ti-srebot committed Apr 26, 2022
1 parent 20de896 commit 7883dcf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,25 @@ func (do *Domain) Init(ddlLease time.Duration, sysExecutorFactory func(*Domain)
do.ddl = d
}
})

if config.GetGlobalConfig().Experimental.EnableGlobalKill {
if do.etcdClient != nil {
err := do.acquireServerID(ctx)
if err != nil {
logutil.BgLogger().Error("acquire serverID failed", zap.Error(err))
do.isLostConnectionToPD.Store(1) // will retry in `do.serverIDKeeper`
} else {
do.isLostConnectionToPD.Store(0)
}

do.wg.Add(1)
go do.serverIDKeeper()
} else {
// set serverID for standalone deployment to enable 'KILL'.
atomic.StoreUint64(&do.serverID, serverIDForStandalone)
}
}

// step 1: prepare the info/schema syncer which domain reload needed.
skipRegisterToDashboard := config.GetGlobalConfig().SkipRegisterToDashboard
do.info, err = infosync.GlobalInfoSyncerInit(ctx, do.ddl.GetID(), do.ServerID, do.etcdClient, skipRegisterToDashboard)
Expand All @@ -833,6 +852,7 @@ func (do *Domain) Init(ddlLease time.Duration, sysExecutorFactory func(*Domain)
return err
}

<<<<<<< HEAD
if config.GetGlobalConfig().Experimental.EnableGlobalKill {
if do.etcdClient != nil {
err := do.acquireServerID(ctx)
Expand All @@ -851,6 +871,8 @@ func (do *Domain) Init(ddlLease time.Duration, sysExecutorFactory func(*Domain)
}
}

=======
>>>>>>> 4e708d1ec... domain: adjust the order of acquireServerID and GlobalInfoSyncerInit to fix global kill test (#33536)
// Only when the store is local that the lease value is 0.
// If the store is local, it doesn't need loadSchemaInLoop.
if ddlLease > 0 {
Expand Down

0 comments on commit 7883dcf

Please sign in to comment.