Skip to main content

Module scanner_supervisor

Module scanner_supervisor 

Source
Expand description

Postgres scanner supervisor (RFC-017 Wave 8 Stage E3).

Owns a tokio JoinSet of reconciler-tick tasks — the Postgres twin of ff-engine’s Valkey scanner supervisor. Each reconciler runs on its configured interval; ticks iterate over the partition space (for the partition-scoped reconcilers: attempt_timeout, lease_expiry, suspension_timeout) or run once per tick (for the global-scan reconcilers: dependency, edge_cancel_dispatcher, edge_cancel_reconciler). A per-tick error is logged at warn and does not abort the task — matches the Valkey scanner semantics where a bad partition does not poison the scanner.

§Shutdown

PostgresScannerHandle::shutdown flips a watch channel; running tasks observe it at the next tick boundary and exit. The grace timeout bounds the wait on the underlying JoinSet.

Structs§

PostgresScannerConfig
Subset of EngineConfig’s interval knobs that the Postgres reconcilers honour. Mirrors the Valkey engine’s per-scanner interval fields so ServerConfig::engine_config can thread the same environment values through to both backends.
PostgresScannerHandle
Spawned scanner supervisor. Holding this handle keeps the scanner tasks alive; dropping it leaves them running until shutdown. Call shutdown with a bounded grace to drain.

Functions§

spawn_scanners
Spawn all six Postgres reconcilers as long-lived tick loops.