Skip to content

Commit

Permalink
fix bug of removing manifest slots in syncStreams
Browse files Browse the repository at this point in the history
Co-authored-by: Ida Novindasari idanovinda@gmail.com
  • Loading branch information
FxKu committed Jul 12, 2024
1 parent 3d60260 commit 5418d89
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions pkg/cluster/streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,9 @@ func (c *Cluster) syncStreams() error {
slotsToSync := make(map[string]map[string]string)
requiredPatroniConfig := c.Spec.Patroni

// skip this for now
// if len(requiredPatroniConfig.Slots) > 0 {
// slots = requiredPatroniConfig.Slots
// }
if len(requiredPatroniConfig.Slots) > 0 {
slotsToSync = requiredPatroniConfig.Slots
}

if err := c.initDbConn(); err != nil {
return fmt.Errorf("could not init database connection")
Expand Down Expand Up @@ -375,11 +374,6 @@ func (c *Cluster) syncStreams() error {
}
}

// no slots to sync = no streams defined or publications created
if len(slotsToSync) > 0 {
requiredPatroniConfig.Slots = slotsToSync
}

c.logger.Debug("syncing logical replication slots")
pods, err := c.listPods()
if err != nil {
Expand Down

0 comments on commit 5418d89

Please sign in to comment.