Skip to content

Conversation

FxKu
Copy link
Member

@FxKu FxKu commented Feb 28, 2022

Continuation from #943.
Closes #943
Fixes #1774

Adding LB support for pooler pods. Required implementing update logic for pooler services.

Sergey Shatunov and others added 3 commits April 28, 2020 15:01
@FxKu FxKu added this to the 1.8 milestone Feb 28, 2022
@FxKu FxKu added the zalando label Feb 28, 2022

c.setProcessName("updating %v service", role)

if c.Services[role] == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this check removed ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remove all the c.Service[role] mentions in this function, hence the new oldService argument. If you look at the place where updateService is called c.Services[role] / c.ConnectionPooler[role].Service = svc is set just before. So this check is not needed - actually it was never really needed 😃 .

}

func (c *Cluster) servicePort(role PostgresRole) string {
func (c *Cluster) servicePort(role PostgresRole) int32 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is better renamed generateServicePort - otherwise the logic of returning 5432 when a service does not exist is vauge

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes something like getServicePort would be better. But, now it's also in line with the other functions like serviceName, serviceAddress. I think, I would keep the name.

c.logger.Warningf("No service for role %s", role)
return ""
c.logger.Warningf("No service for role %s - defaulting to port 5432", role)
return 5432
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jopadi
Copy link
Member

jopadi commented Mar 4, 2022

👍

1 similar comment
@FxKu
Copy link
Member Author

FxKu commented Mar 4, 2022

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

annotation change is not taken by connectionPooler pod

3 participants