Skip to content

Commit

Permalink
cluster: increase default timeout transfer leader in upgrade progress (
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis committed Jun 24, 2021
1 parent 875bfd6 commit b21b24b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/cluster/command/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func newUpgradeCmd() *cobra.Command {
},
}
cmd.Flags().BoolVar(&gOpt.Force, "force", false, "Force upgrade without transferring PD leader")
cmd.Flags().Uint64Var(&gOpt.APITimeout, "transfer-timeout", 300, "Timeout in seconds when transferring PD and TiKV store leaders")
cmd.Flags().Uint64Var(&gOpt.APITimeout, "transfer-timeout", 600, "Timeout in seconds when transferring PD and TiKV store leaders")
cmd.Flags().BoolVarP(&gOpt.IgnoreConfigCheck, "ignore-config-check", "", false, "Ignore the config check result")
cmd.Flags().BoolVarP(&offlineMode, "offline", "", false, "Upgrade a stopped cluster")

Expand Down
5 changes: 5 additions & 0 deletions pkg/cluster/module/systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type SystemdModuleConfig struct {
ReloadDaemon bool // run daemon-reload before other actions
Scope string // user, system or global
Force bool // add the `--force` arg to systemctl command
Signal string // specify the signal to send to process
Timeout time.Duration // timeout to execute the command
}

Expand All @@ -56,6 +57,10 @@ func NewSystemdModule(config SystemdModuleConfig) *SystemdModule {
systemctl = fmt.Sprintf("%s --force", systemctl)
}

if config.Signal != "" {
systemctl = fmt.Sprintf("%s --signal %s", systemctl, config.Signal)
}

switch config.Scope {
case SystemdScopeUser:
sudo = false // `--user` scope does not need root privilege
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/operation/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func Upgrade(
}

log.Infof("Upgrading component %s", component.Name())

// perform pre-upgrade actions of component
var origLeaderScheduleLimit int
var origRegionScheduleLimit int
Expand Down

0 comments on commit b21b24b

Please sign in to comment.