skip connection pooler sync when empty
This commit is contained in:
		
							parent
							
								
									6e6cadcd25
								
							
						
					
					
						commit
						f2979e2acf
					
				| 
						 | 
					@ -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
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue