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: fix tikv not upgraded on error increasing schedule limit #1401

Merged
merged 1 commit into from
Jun 4, 2021
Merged
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
24 changes: 12 additions & 12 deletions pkg/cluster/operation/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ func Upgrade(
// the config modifing error should be able to be safely ignored, as it will
// be processed with current settings anyway.
log.Warnf("failed increasing schedule limit: %s, ignore", err)
continue
} else {
defer func() {
upgErr := decreaseScheduleLimit(pdClient, origLeaderScheduleLimit, origRegionScheduleLimit)
if upgErr != nil {
log.Warnf(
"failed decreasing schedule limit (original values should be: %s, %s), please check if their current values are reasonable: %s",
fmt.Sprintf("leader-schedule-limit=%d", origLeaderScheduleLimit),
fmt.Sprintf("region-schedule-limit=%d", origRegionScheduleLimit),
upgErr,
)
}
}()
}
defer func() {
upgErr := decreaseScheduleLimit(pdClient, origLeaderScheduleLimit, origRegionScheduleLimit)
if upgErr != nil {
log.Warnf(
"failed decreasing schedule limit (original values should be: %s, %s), please check if their current values are reasonable: %s",
fmt.Sprintf("leader-schedule-limit=%d", origLeaderScheduleLimit),
fmt.Sprintf("region-schedule-limit=%d", origRegionScheduleLimit),
upgErr,
)
}
}()
default:
// do nothing, kept for future usage with other components
}
Expand Down