Skip to content

Commit

Permalink
Recheck version from Patroni IP.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-M committed Feb 6, 2024
1 parent bf5db67 commit cff0f69
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/cluster/majorversionupgrade.go
Expand Up @@ -17,6 +17,7 @@ var VersionMap = map[string]int{
"13": 130000,
"14": 140000,
"15": 150000,
"16": 160000,
}

// IsBiggerPostgresVersion Compare two Postgres version numbers
Expand Down Expand Up @@ -97,6 +98,12 @@ func (c *Cluster) majorVersionUpgrade() error {
}
}

// Recheck version with newest data from Patroni
if c.currentMajorVersion >= desiredVersion {
c.logger.Infof("recheck cluster version is already up to date. current: %d, min desired: %d", c.currentMajorVersion, desiredVersion)
return nil
}

numberOfPods := len(pods)
if allRunning && masterPod != nil {
c.logger.Infof("healthy cluster ready to upgrade, current: %d desired: %d", c.currentMajorVersion, desiredVersion)
Expand Down

0 comments on commit cff0f69

Please sign in to comment.