1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# HeliosProxy Configuration — Failover Demo with Transaction Replay
#
# Key differences from the basic cluster example:
# - TR mode set to "transaction" for full replay capability
# - Aggressive health check intervals (2s) to detect failure quickly
# - Low failure threshold (2) so failover triggers after ~4 seconds
# - Write timeout of 15s to allow time for re-routing during failover
= "0.0.0.0:6432"
= "0.0.0.0:9090"
# ── Transaction Replay (TR) ─────────────────────────────────────────
# Modes:
# "none" — no replay
# "session" — re-establish session state (SET commands, search_path)
# "select" — replay read-only queries on new backend
# "transaction" — full replay of in-flight transactions after failover
= true
= "transaction"
# How long to wait for writes to succeed during a failover window
= 15
# ── Connection Pool ──────────────────────────────────────────────────
[]
= 2
= 30
= 300
= 1800
= 10
= true
# ── Pool Mode ────────────────────────────────────────────────────────
[]
= "transaction"
= 30
= 2
= 300
= 1800
= 5
= "DISCARD ALL"
= "track"
# ── Load Balancer ────────────────────────────────────────────────────
[]
= "least_connections"
= true
= 50
# ── Health Checks (aggressive for demo) ──────────────────────────────
# - Check every 2 seconds
# - Timeout after 2 seconds
# - Mark unhealthy after 2 consecutive failures (~4s detection)
# - Mark healthy again after 2 consecutive successes
[]
= 2
= 2
= 2
= 2
= "SELECT 1"
# ── Backend Nodes ────────────────────────────────────────────────────
[[]]
= "pg-primary"
= 5432
= "primary"
= 100
= true
= "primary"
[[]]
= "pg-standby1"
= 5432
= "standby"
= 100
= true
= "standby-1"
[[]]
= "pg-standby2"
= 5432
= "standby"
= 100
= true
= "standby-2"