github ozontech/pg_doorman v3.5.2

6 hours ago

Pool grows to full capacity under load

Pools stabilized at 3-4 backend connections out of 40 under sustained traffic: servers=3, wait=50, avg_wait=800ms. Each direct handoff between clients permanently consumed one semaphore permit. After 40 handoffs the pool stopped accepting checkout requests and could not create connections.

Permits are now restored on every return path. Cold start reaches full pool_size within seconds.

Other fixes

  • Burst gate: connection silently dropped when tokio::select picked a timer branch over a ready oneshot. Fixed with biased polling.
  • Session mode: query_time and xact_time showed session duration (100+ seconds) instead of individual query/transaction time. Now reset per-query.
  • Migration: client ID collision after binary upgrade (counter started at 0). SCRAM passthrough ClientKey now preserved in migration payload (v2 format).
  • Anticipation budget scales with xact_p99 instead of fixed 300-500ms.
  • Slow checkout warnings (>500ms) include pool state, scaling counters, and per-phase diagnostics.

Full changelog: https://ozontech.github.io/pg_doorman/changelog.html


Пул растёт до полного размера под нагрузкой

Пулы стабилизировались на 3-4 backend-соединениях из 40 при постоянном трафике: servers=3, wait=50, avg_wait=800ms. Каждая прямая передача соединения между клиентами безвозвратно расходовала одно разрешение семафора. После 40 передач пул переставал принимать запросы на checkout и не мог создавать соединения.

Разрешение теперь возвращается при любом пути возврата. Пул достигает полного pool_size за секунды после холодного старта.

Прочие исправления

  • Ограничитель всплесков (burst gate): соединение терялось, когда таймер выигрывал гонку у готового канала доставки. Исправлено приоритетным опросом.
  • Session mode: query_time и xact_time показывали длительность сессии (100+ секунд) вместо отдельного запроса/транзакции. Сброс по каждому запросу.
  • Миграция: коллизия client ID после binary upgrade (счётчик стартовал с нуля). SCRAM passthrough ClientKey сохраняется в payload миграции (формат v2).
  • Бюджет упреждающего ожидания масштабируется по xact_p99 вместо фиксированных 300-500ms.
  • Предупреждения о медленных checkout'ах (>500ms) включают состояние пула, счётчики scaling и пофазовую диагностику.

Полный changelog: https://ozontech.github.io/pg_doorman/changelog.html

Don't miss a new pg_doorman release

NewReleases is sending notifications on new releases.