CrunchyData / crunchy-proxy

PostgreSQL Connection Proxy by Crunchy Data (beta)
Apache License 2.0
414 stars 61 forks source link

Feature: live edit of list of backends #59

Open jberkus opened 7 years ago

jberkus commented 7 years ago

To support an infrastructure where the list of PostgreSQL backends is being maintained by Kubernetes/Openshift, we need to support "hot" changes to the list of backends. That is, we need to be able to add new backends and remove old ones with proxy running, and only have it drop connections for the affected backends.

There's three primary cases we want to support here. All of these need to work via external commands, not just healthcheck, due to a need to support a system where there may be multiple proxies in the infra and an external service is controlling the list of nodes:

  1. Pool growth: I increase the number of PostgreSQL replicas from 3 to 7. I should be able to add the additional 4 replicas to proxy without restarting, and have them receive (new) load-balanced connections as they are added.

  2. Node removal: if I am removing nodes, either for pool shrinkage or because replicas have failed, I need to be able to do it without restarting proxy and without waiting for proxy itself to healthcheck out those nodes. Existing connections to other nodes should not be interrupted.

  3. Master Failover: I need to be able to change which node is the master without restarting proxy. Only connections to the old master should be interrupted by this.

jmccormick2001 commented 7 years ago

thanks Josh, good stuff, we are about to fire up another dev round on the proxy and this is great input.

jberkus commented 7 years ago

BTW, note that part of my use case involves disabling the proxy healthcheck, since I'll be using the Patroni healthcheck.

eni23 commented 7 years ago

Is there any progress here? I would be interested in this feauture as well.

filipmnowak commented 11 months ago

looking for a Postgres proxy with such option too, would be super useful.