File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -836,6 +836,11 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error {
836836 c .logger .Infof ("Storage resize is disabled (storage_resize_mode is off). Skipping volume sync." )
837837 }
838838
839+ // streams configuration
840+ if len (oldSpec .Spec .Streams ) == 0 && len (newSpec .Spec .Streams ) > 0 {
841+ syncStatefulSet = true
842+ }
843+
839844 // Statefulset
840845 func () {
841846 oldSs , err := c .generateStatefulSet (& oldSpec .Spec )
@@ -851,6 +856,7 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error {
851856 updateFailed = true
852857 return
853858 }
859+
854860 if syncStatefulSet || ! reflect .DeepEqual (oldSs , newSs ) {
855861 c .logger .Debugf ("syncing statefulsets" )
856862 syncStatefulSet = false
@@ -942,6 +948,7 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error {
942948 updateFailed = true
943949 }
944950
951+ // streams
945952 if len (newSpec .Spec .Streams ) > 0 {
946953 if err := c .syncStreams (); err != nil {
947954 c .logger .Errorf ("could not sync streams: %v" , err )
@@ -1034,7 +1041,7 @@ func (c *Cluster) Delete() {
10341041
10351042}
10361043
1037- //NeedsRepair returns true if the cluster should be included in the repair scan (based on its in-memory status).
1044+ // NeedsRepair returns true if the cluster should be included in the repair scan (based on its in-memory status).
10381045func (c * Cluster ) NeedsRepair () (bool , acidv1.PostgresStatus ) {
10391046 c .specMu .RLock ()
10401047 defer c .specMu .RUnlock ()
Original file line number Diff line number Diff line change @@ -403,7 +403,10 @@ func (c *Cluster) syncStatefulSet() error {
403403 c .logger .Warnf ("could not get list of pods to apply PostgreSQL parameters only to be set via Patroni API: %v" , err )
404404 }
405405
406- requiredPgParameters := c .Spec .Parameters
406+ requiredPgParameters := make (map [string ]string )
407+ for k , v := range c .Spec .Parameters {
408+ requiredPgParameters [k ] = v
409+ }
407410 // if streams are defined wal_level must be switched to logical
408411 if len (c .Spec .Streams ) > 0 {
409412 requiredPgParameters ["wal_level" ] = "logical"
You can’t perform that action at this time.
0 commit comments