Skip to content

Commit

Permalink
cluster: fix tikv not upgraded on error increasing schedule limit
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis committed Jun 3, 2021
1 parent b12ae28 commit bfacff3
Showing 1 changed file with 12 additions and 12 deletions.
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

0 comments on commit bfacff3

Please sign in to comment.