You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I deployed [git-3b2cc672](https://hub.docker.com/layers/pomerium/pomerium/git-3b2cc672/images/sha256-45f01a6e2777a902c78aba439185e0ffcb30d12ff0e058e4ddf1b38b58a2622d?context=explore) today. Things looked good - all 3 PSQL nodes came online (using basically the config I posted), pomerium connected to the PSQL backend, and it served traffic. I successfully took down the primary PSQL node and the databroker survived, switching over to the new primary.
## WORKING# Use HA PSQL databroker backenddatabroker_storage_type: postgresdatabroker_storage_connection_string: postgres:https://pomerium:pomerium@pg-0,pg-1,pg-2/pomerium?sslmode=disable&target_session_attrs=read-write
===
However, a word of caution! target_session_attrs=read-write is absolutely critical. Without it libpq correctly switches to a second node, but has a chance to end up on a read-only replica. When I tested this, the constant write attempts eventually took down repmgr and even the entire PSQL container.
## BROKEN# Use HA PSQL databroker backenddatabroker_storage_type: postgresdatabroker_storage_connection_string: postgres:https://customuser:custompassword@pg-0,pg-1,pg-2/pomerium?sslmode=disable
I'm not sure how the databroker works under the hood; perhaps on large installs it can make use of read-only replicas for load balancing? However, attempting to write on a read-only connection makes no sense to me. Arguably this behavior should be changed, or at the least the docs can be clarified in the docs to stress using target_session_attrs=read-write when using HA.
===
However, a word of caution!
target_session_attrs=read-write
is absolutely critical. Without itlibpq
correctly switches to a second node, but has a chance to end up on a read-only replica. When I tested this, the constant write attempts eventually took downrepmgr
and even the entire PSQL container.I'm not sure how the databroker works under the hood; perhaps on large installs it can make use of read-only replicas for load balancing? However, attempting to write on a read-only connection makes no sense to me. Arguably this behavior should be changed, or at the least the docs can be clarified in the docs to stress using
target_session_attrs=read-write
when using HA.Originally posted by @alexrudd2 in pomerium/pomerium#3634 (comment)
The text was updated successfully, but these errors were encountered: