Minor updates
- Remove extra warning message while creating standby - Limit the number of pods to 1 for standby cluster
This commit is contained in:
		
							parent
							
								
									14570dbc02
								
							
						
					
					
						commit
						9af13ed0df
					
				|  | @ -268,6 +268,7 @@ spec: | ||||||
| Things to note: | Things to note: | ||||||
| 
 | 
 | ||||||
| - An empty string is provided in s3_wal_path of the standby cluster will result in error and no statefulset will be created. | - An empty string is provided in s3_wal_path of the standby cluster will result in error and no statefulset will be created. | ||||||
|  | - Only one pod can be deployed for stand-by cluster. | ||||||
| - To manually promote the standby_cluster, use patronictl and remove config entry. | - To manually promote the standby_cluster, use patronictl and remove config entry. | ||||||
| - There is no way to transform a non-standby cluster to standby cluster through operator. Hence, if a cluster is created without standby section in YAML and later modified  by adding that section, there will be no effect on the cluster. However, it can be done through Patroni by adding the standby_cluster section using patronictl edit-config. Note that the transformed standby cluster will not be doing any streaming, rather will just be in standby mode and allow read-only transactions only. | - There is no way to transform a non-standby cluster to standby cluster through operator. Hence, if a cluster is created without standby section in YAML and later modified  by adding that section, there will be no effect on the cluster. However, it can be done through Patroni by adding the standby_cluster section using patronictl edit-config. Note that the transformed standby cluster will not be doing any streaming, rather will just be in standby mode and allow read-only transactions only. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -66,7 +66,7 @@ spec: | ||||||
|   #  cluster: "acid-batman" |   #  cluster: "acid-batman" | ||||||
|   #  timestamp: "2017-12-19T12:40:33+01:00" # timezone required (offset relative to UTC, see RFC 3339 section 5.6) |   #  timestamp: "2017-12-19T12:40:33+01:00" # timezone required (offset relative to UTC, see RFC 3339 section 5.6) | ||||||
|   #  s3_wal_path: "s3://custom/path/to/bucket" |   #  s3_wal_path: "s3://custom/path/to/bucket" | ||||||
|   # Make this a standby cluster and provide the s3 bucket path of source cluster for continuous streaming. |   # Make this a standby cluster and provide the s3 bucket path of source cluster for continuous streaming. Also change the above mentioned numberOfInstances to 1 for this cluster. | ||||||
|   # standby: |   # standby: | ||||||
|   #   s3_wal_path: "s3://path/to/bucket/containing/wal/of/source/cluster/" |   #   s3_wal_path: "s3://path/to/bucket/containing/wal/of/source/cluster/" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -977,6 +977,11 @@ func (c *Cluster) getNumberOfInstances(spec *acidv1.PostgresSpec) int32 { | ||||||
| 	cur := spec.NumberOfInstances | 	cur := spec.NumberOfInstances | ||||||
| 	newcur := cur | 	newcur := cur | ||||||
| 
 | 
 | ||||||
|  | 	/* Limit the max number of pods to one, if this is standby-cluster */ | ||||||
|  | 	if spec.StandbyCluster != nil { | ||||||
|  | 		c.logger.Infof("Standby cluster can have maximum of 1 pod") | ||||||
|  | 		max = 1 | ||||||
|  | 	} | ||||||
| 	if max >= 0 && newcur > max { | 	if max >= 0 && newcur > max { | ||||||
| 		newcur = max | 		newcur = max | ||||||
| 	} | 	} | ||||||
|  | @ -1285,12 +1290,9 @@ func (c *Cluster) generateStandbyEnvironment(description *acidv1.StandbyDescript | ||||||
| 		return nil | 		return nil | ||||||
| 	} | 	} | ||||||
| 	// standby with S3, find out the bucket to setup standby
 | 	// standby with S3, find out the bucket to setup standby
 | ||||||
| 	msg := "Standby from S3 bucket" | 	msg := "Standby from S3 bucket using custom parsed S3WalPath %s from the manifest" | ||||||
| 	c.logger.Info(msg, description.S3WalPath) | 	c.logger.Info(msg, description.S3WalPath) | ||||||
| 
 | 
 | ||||||
| 	msg = "Use custom parsed S3WalPath %s from the manifest" |  | ||||||
| 	c.logger.Warningf(msg, description.S3WalPath) |  | ||||||
| 
 |  | ||||||
| 	result = append(result, v1.EnvVar{ | 	result = append(result, v1.EnvVar{ | ||||||
| 		Name:  "STANDBY_WALE_S3_PREFIX", | 		Name:  "STANDBY_WALE_S3_PREFIX", | ||||||
| 		Value: description.S3WalPath, | 		Value: description.S3WalPath, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue