@@ -413,6 +413,7 @@ func (c *Cluster) syncStatefulSet() error {
413
413
}
414
414
415
415
// sync Patroni config
416
+ c .logger .Debug ("syncing Patroni config" )
416
417
if configPatched , restartPrimaryFirst , restartWait , err = c .syncPatroniConfig (pods , c .Spec .Patroni , requiredPgParameters ); err != nil {
417
418
c .logger .Warningf ("Patroni config updated? %v - errors during config sync: %v" , configPatched , err )
418
419
isSafeToRecreatePods = false
@@ -641,18 +642,18 @@ func (c *Cluster) checkAndSetGlobalPostgreSQLConfiguration(pod *v1.Pod, effectiv
641
642
}
642
643
// check if specified slots exist in config and if they differ
643
644
for slotName , desiredSlot := range desiredPatroniConfig .Slots {
644
- if effectiveSlot , exists := effectivePatroniConfig .Slots [slotName ]; exists {
645
- if reflect .DeepEqual (desiredSlot , effectiveSlot ) {
646
- continue
647
- }
648
- }
649
- slotsToSet [slotName ] = desiredSlot
650
645
// only add slots specified in manifest to c.replicationSlots
651
646
for manifestSlotName , _ := range c .Spec .Patroni .Slots {
652
647
if manifestSlotName == slotName {
653
648
c .replicationSlots [slotName ] = desiredSlot
654
649
}
655
650
}
651
+ if effectiveSlot , exists := effectivePatroniConfig .Slots [slotName ]; exists {
652
+ if reflect .DeepEqual (desiredSlot , effectiveSlot ) {
653
+ continue
654
+ }
655
+ }
656
+ slotsToSet [slotName ] = desiredSlot
656
657
}
657
658
if len (slotsToSet ) > 0 {
658
659
configToSet ["slots" ] = slotsToSet
0 commit comments