Skip to content

v2.0.2 – Robust PgConnector health checks & lazy pool init

Choose a tag to compare

@g2px1 g2px1 released this 09 Nov 10:17
· 75 commits to main since this release

Release notes:
This update strengthens the reliability of the PostgreSQL routing and health-monitoring subsystem.

Changes & Fixes:

  • Fixed a runtime crash in health_tick() when a health probe accessed an uninitialized PgPool.
  • Added lazy pool initialization (ensure_pool) — pools are now created on demand or recreated automatically after failures.
  • Hardened all routing paths (route, route_for_tx, pin, pick_primary, pick_best_replica) to safely skip nodes without pools.
  • Health probes now tolerate transient connection issues instead of crashing.
  • Circuit-breaker logic made configuration-driven instead of hardcoded.

New Config Fields (HealthCfg):

  • cb_quiet_ms — cooldown after the first failure.
  • cb_backoff_ms — cooldown after repeated failures.
  • cb_max_ms — maximum cooldown for persistent errors.

Behavioral Improvements:

  • PgConnector automatically recovers nodes as soon as connections become available again.
  • Health loop and routing now remain stable even if all nodes temporarily fail.
  • Default circuit-breaker timings can be tuned through config, allowing smoother recovery control.

Impact:
The connector is now fault-tolerant, self-healing, and fully safe to run continuous health checks in production environments.