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

Feature request: register "sync" or "async" services with Consul #1637

Open
victor-sudakov opened this issue Aug 4, 2020 · 4 comments
Open

Comments

@victor-sudakov
Copy link
Contributor

Feature request: could you please make Patroni register "sync" or "async" services with Consul, depending upon the synchronous or asynchronous standby status?

Sometimes it's important for an application to know to work with a sync replica (needed for OLTP) vs async replica (good enough for OLAP).

@CyberDem0n
Copy link
Collaborator

It won't disconnect you if the node stopped be synchronous, therefore there is no value in such a feature.

@victor-sudakov
Copy link
Contributor Author

I beg to disagree. Web connections usually don't last more than 1 SQL transaction, so there is value in such a feature. Each request from a PHP application will resolve the service name anew.

@CyberDem0n
Copy link
Collaborator

Web connections usually don't last more than 1 SQL transaction

And this is a really bad practice. One should always use the connection pool, either application side or external, like pgbouncer.

If the pgbouncer is running on every host, indeed it could be useful (maybe), but in any case I have neither time nor wish for implementing all feature requests.
If somebody else will do it - I can review it.

@victor-sudakov
Copy link
Contributor Author

Web connections usually don't last more than 1 SQL transaction

And this is a really bad practice. One should always use the connection pool, either application side or external, like pgbouncer.

Using pgbouncer does not contradict the statement that each request from a PHP application will resolve the service name anew.

If the pgbouncer is running on every host,

Isn't that the usual practice? Why would one create additional points of failure by NOT running pgbouncer on every PostgreSQL host? A connection pooler is not a load balancer or some kind of HA proxy.

in any case I have neither time nor wish for implementing all feature requests. If somebody else will do it - I can review it.

That is another question. Sorry about your lack of time and wish. I just thought once you have already implemented GET /sync and GET /async in the REST API, probably it would have been possible to register that with Consul.

I'll just have to use HAProxy's option httpchk GET /sync to find synchronous replicas.

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

No branches or pull requests

2 participants