Skip to content
This repository was archived by the owner on Feb 14, 2024. It is now read-only.

Commit 9973262

Browse files
authored
sync stateful set when syncing streams during ADD event (zalando#2245)
1 parent 645fcc0 commit 9973262

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

pkg/cluster/cluster.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,16 +370,22 @@ func (c *Cluster) Create() error {
370370
// something fails, report warning
371371
c.createConnectionPooler(c.installLookupFunction)
372372

373+
// remember slots to detect deletion from manifest
374+
for slotName, desiredSlot := range c.Spec.Patroni.Slots {
375+
c.replicationSlots[slotName] = desiredSlot
376+
}
377+
373378
if len(c.Spec.Streams) > 0 {
379+
// creating streams requires syncing the statefulset first
380+
err = c.syncStatefulSet()
381+
if err != nil {
382+
return fmt.Errorf("could not sync statefulset: %v", err)
383+
}
374384
if err = c.syncStreams(); err != nil {
375385
c.logger.Errorf("could not create streams: %v", err)
376386
}
377387
}
378388

379-
for slotName, desiredSlot := range c.Spec.Patroni.Slots {
380-
c.replicationSlots[slotName] = desiredSlot
381-
}
382-
383389
return nil
384390
}
385391

0 commit comments

Comments
 (0)