postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Create k8s Service pointing to synchronous replicas

Open agrevtsev opened this issue 3 years ago • 2 comments

  • Which image of the operator are you using? registry.opensource.zalan.do/acid/postgres-operator:v1.8.2
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? Bare Metal K8s
  • Are you running Postgres Operator in production? yes
  • Type of issue? feature request

Hi team! The operator is creating foo-test-cluster-repl Service pointing to all replicas. When one wants to use synchronous replication, could the operator create the Service pointing only to synchronous replicas? E.g. foo-test-cluster-sync-repl pointing to replicas with Sync Standby role (patroni notation), foo-test-cluster-repl pointing to all replicas (it seems to me it's a valid case when total_replicas > sync_replicas).

agrevtsev avatar Jan 11 '23 17:01 agrevtsev

We have also seen cases where data needs to be read from synchronous replica / synchronous replicas. Reading from asynchronous replica was not ok (obsolete data was read).

"No stale reads": Synchronous replicas allow load balancing of consistent and up-to-date reads.

It would be great, if data could be written and read through same IP and port --> pgpool-ii?? ( I have not tested such a pgpool-ii setup. )

Samusername avatar Jan 12 '23 07:01 Samusername

Was already asked here #1711, but will leave this one here open.

FxKu avatar Oct 27 '25 09:10 FxKu