userver: uPg: Cluster topology discovery
No Matches
uPg: Cluster topology discovery
Principles of PgaaS role determination
PgaaS sync slaves lag
By default, PgaaS synchronous slaves are working with 'synchronous_commit' set to 'remote_apply'. Therefore, sync slave may be lagging behind the master and thus is not truly 'synchronous' from the reader's POV, but things may change with time.
Topology update runs every second.

Every host is assigned a connection with special ID (4100200300). Using this connection we check for host availability, writability (master detection) and perform RTT measurements.

After the initial check we know about master presence and RTT for each host. Master host is queried about synchronous replication status. We use this info to identify synchronous slaves and to detect "quorum commit" presence.