Skip to content

Commit ae95c2d

Browse files
authored
Recheck version from Patroni IP. (#2533)
1 parent 23f4fdb commit ae95c2d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/cluster/majorversionupgrade.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var VersionMap = map[string]int{
1717
"13": 130000,
1818
"14": 140000,
1919
"15": 150000,
20+
"16": 160000,
2021
}
2122

2223
// IsBiggerPostgresVersion Compare two Postgres version numbers
@@ -97,6 +98,12 @@ func (c *Cluster) majorVersionUpgrade() error {
9798
}
9899
}
99100

101+
// Recheck version with newest data from Patroni
102+
if c.currentMajorVersion >= desiredVersion {
103+
c.logger.Infof("recheck cluster version is already up to date. current: %d, min desired: %d", c.currentMajorVersion, desiredVersion)
104+
return nil
105+
}
106+
100107
numberOfPods := len(pods)
101108
if allRunning && masterPod != nil {
102109
c.logger.Infof("healthy cluster ready to upgrade, current: %d desired: %d", c.currentMajorVersion, desiredVersion)

0 commit comments

Comments
 (0)