Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster: increase default timeout transfer leader in upgrade progress #1434

Merged
merged 3 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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