From bfacff3f8fc61e261891e2b0fc6f8f5f722c2d2b Mon Sep 17 00:00:00 2001 From: Allen Zhong Date: Thu, 3 Jun 2021 16:59:55 +0800 Subject: [PATCH] cluster: fix tikv not upgraded on error increasing schedule limit --- pkg/cluster/operation/upgrade.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/cluster/operation/upgrade.go b/pkg/cluster/operation/upgrade.go index 51940e8cc9..b11ee42406 100644 --- a/pkg/cluster/operation/upgrade.go +++ b/pkg/cluster/operation/upgrade.go @@ -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 }