Hi,
During yesterday there was a dns issue that affected postgres. It seems to have been fixed now but a question about how our app handles these situations is not clear to me.
The problem for us was that our 2 node cluster didn’t have a leader selected for a while.
I didnt save the logs but there were log messages about this. During this time our app was still working but when I try to connect using the proxy with flyctl proxy -a <pg-appname>
I wasnt able to login. And this would be the preferred thing to happen, to not be able to connect and run queries if the postgres cluster is having issues.
And this is said also in the docs
If the leader becomes unhealthy (e.g. network or hardware issues), the proxy drops all connections until a new leader is elected.
But during this time the app was still doing reads and writes.
When i first attached the app to the postgres app it automatically added the DATABASE_URL
secret as postgres://xxx:xxx@top2.nearest.of.<pg-appname>.internal:5432/xxx
.
Other hostnames for the postgres cluster I see in docs and website are
<pg-appname>.fly.dev
top2.nearest.of.<pg-appname>.internal
<pg-appname>.internal
My question is. Are these hostnames identical in practice. Or what hostname should I use to go through the stolon proxy that would drop connections if postgres cluster is having issues?
Or is there some other reason what could explain what i see, app was able to connect to postgres but i had to ssh and issue pg-failover
to be able to connect through ´flyctl proxy´ again to the postgres cluster?