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 {
836
836
c .logger .Infof ("Storage resize is disabled (storage_resize_mode is off). Skipping volume sync." )
837
837
}
838
838
839
+ // streams configuration
840
+ if len (oldSpec .Spec .Streams ) == 0 && len (newSpec .Spec .Streams ) > 0 {
841
+ syncStatefulSet = true
842
+ }
843
+
839
844
// Statefulset
840
845
func () {
841
846
oldSs , err := c .generateStatefulSet (& oldSpec .Spec )
@@ -851,6 +856,7 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error {
851
856
updateFailed = true
852
857
return
853
858
}
859
+
854
860
if syncStatefulSet || ! reflect .DeepEqual (oldSs , newSs ) {
855
861
c .logger .Debugf ("syncing statefulsets" )
856
862
syncStatefulSet = false
@@ -942,6 +948,7 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error {
942
948
updateFailed = true
943
949
}
944
950
951
+ // streams
945
952
if len (newSpec .Spec .Streams ) > 0 {
946
953
if err := c .syncStreams (); err != nil {
947
954
c .logger .Errorf ("could not sync streams: %v" , err )
@@ -1034,7 +1041,7 @@ func (c *Cluster) Delete() {
1034
1041
1035
1042
}
1036
1043
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).
1038
1045
func (c * Cluster ) NeedsRepair () (bool , acidv1.PostgresStatus ) {
1039
1046
c .specMu .RLock ()
1040
1047
defer c .specMu .RUnlock ()
Original file line number Diff line number Diff line change @@ -403,7 +403,10 @@ func (c *Cluster) syncStatefulSet() error {
403
403
c .logger .Warnf ("could not get list of pods to apply PostgreSQL parameters only to be set via Patroni API: %v" , err )
404
404
}
405
405
406
- requiredPgParameters := c .Spec .Parameters
406
+ requiredPgParameters := make (map [string ]string )
407
+ for k , v := range c .Spec .Parameters {
408
+ requiredPgParameters [k ] = v
409
+ }
407
410
// if streams are defined wal_level must be switched to logical
408
411
if len (c .Spec .Streams ) > 0 {
409
412
requiredPgParameters ["wal_level" ] = "logical"
You can’t perform that action at this time.
0 commit comments