skip connection pooler sync when empty

This commit is contained in:
Felix Kunde 2021-03-30 21:54:22 +02:00
parent 6e6cadcd25
commit f2979e2acf
2 changed files with 4 additions and 3 deletions

View File

@ -714,8 +714,9 @@ func (c *Cluster) syncConnectionPooler(oldSpec, newSpec *acidv1.Postgresql, Look
// Handling the case when connectionPooler is not there but it is required // Handling the case when connectionPooler is not there but it is required
// as per spec, hence do not skip syncing in that case, even though there // as per spec, hence do not skip syncing in that case, even though there
// is no diff in specs // is no diff in specs
if (!needSync && len(masterChanges) <= 0 && len(replicaChanges) <= 0) && if (!needSync && len(masterChanges) <= 0 && len(replicaChanges) <= 0 &&
(c.ConnectionPooler != nil && (needConnectionPooler(&newSpec.Spec))) { c.ConnectionPooler != nil && (needConnectionPooler(&newSpec.Spec))) ||
(c.ConnectionPooler == nil && !(needConnectionPooler(&newSpec.Spec))) {
c.logger.Debugln("syncing pooler is not required") c.logger.Debugln("syncing pooler is not required")
return nil, nil return nil, nil
} }

View File

@ -52,7 +52,7 @@ func (c *Cluster) majorVersionUpgrade() error {
desiredVersion := c.GetDesiredMajorVersionAsInt() desiredVersion := c.GetDesiredMajorVersionAsInt()
if c.currentMajorVersion >= desiredVersion { if c.currentMajorVersion >= desiredVersion {
c.logger.Infof("cluster version up to date. current: %d desired: %d", c.currentMajorVersion, desiredVersion) c.logger.Infof("cluster version up to date. current: %d min desired: %d", c.currentMajorVersion, desiredVersion)
return nil return nil
} }