Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgreslet possibly uses several IPs #221

Open
eberlep opened this issue Jun 10, 2021 · 2 comments · Fixed by #241
Open

Postgreslet possibly uses several IPs #221

eberlep opened this issue Jun 10, 2021 · 2 comments · Fixed by #241

Comments

@eberlep
Copy link
Collaborator

eberlep commented Jun 10, 2021

When no prior load balance ip exists and several databases are created simultaniously, there is no previous ip to re-use and hence every database creates a new load balance.

Here is an example where all databases where re-created (due to ID changes implemented #205, not due to a bug) at the same time:

NAME                                                                TENANT   VERSION   REPLICAS   IP             PORT    STATUS
postgres.database.fits.cloud/064cf825-c4ce-45e2-a112-c84672c20d34   fits     12        1          XXX.XX.XX.42   32001   Running
postgres.database.fits.cloud/1c625623-17d0-49c7-9058-7cb20fb374ff   fits     12        1          XXX.XX.XX.75   32006   Running
postgres.database.fits.cloud/5b61f5b8-153a-4b0b-ace6-e99125c2b997   fits     12        1          XXX.XX.XX.74   32005   Running
postgres.database.fits.cloud/8c4974ad-876e-4348-93ce-03800069d4ea   fits     12        1                         32000   SyncFailed
postgres.database.fits.cloud/b379f7ac-97f7-4aa5-ab9c-3d9fa0887a02   fits     12        2          XXX.XX.XX.76   32007   Running

In this example, one example failed to start at all, but I do not think this is relevant for this issue.

As long as there is already one load balancer active everything works as expected.

Update: The failed database seems to be relevant indeed:

postgres.database.fits.cloud/064cf825-c4ce-45e2-a112-c84672c20d34   fits     12        1          XXX.XX.XX.42   32001   Running
postgres.database.fits.cloud/1c625623-17d0-49c7-9058-7cb20fb374ff   fits     12        1          XXX.XX.XX.75   32006   Running
postgres.database.fits.cloud/5b61f5b8-153a-4b0b-ace6-e99125c2b997   fits     12        1          XXX.XX.XX.74   32005   Running
postgres.database.fits.cloud/8c4974ad-876e-4348-93ce-03800069d4ea   fits     12        1                         32000   SyncFailed
postgres.database.fits.cloud/b379f7ac-97f7-4aa5-ab9c-3d9fa0887a02   fits     12        2          XXX.XX.XX.76   32007   Running
postgres.database.fits.cloud/f59a65f7-d8d8-4f22-89c9-0abc80387614   fits     12        1          XXX.XX.XX.77   32002   Running

As we can see, a new load balancer was created, probably because we use the IP of the first service we find, which in this case probably was the one without an ip. We should probably skip services with empty ips just to be safe.

@eberlep
Copy link
Collaborator Author

eberlep commented Jun 23, 2021

#241

the nextFreeSocket code got mixed up, hence a new IP was used for each db.

@eberlep eberlep closed this as completed Jun 23, 2021
@eberlep eberlep reopened this Jun 23, 2021
@eberlep
Copy link
Collaborator Author

eberlep commented Jun 23, 2021

But we might still have concurrency issues.

@eberlep eberlep linked a pull request Jun 23, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant