Watch and Observe
Waiting without polling
A trigger on fleet_revisions calls pg_notify('robotelos_fleet_revision', '<fleet>:<revision>'). Each coordinator holds one LISTEN connection and wakes the fleets waiting on that revision. A waiter is registered before the database is read, so a change cannot slip between the read and the wait. A safety read every 15 seconds, and plain polling while the listener is down, cover a lost notification.
FleetWatch
A server stream. The agent sends the revision it has; the coordinator answers with a bookmark when something newer exists, and the agent then fetches the snapshot. Where a transport cannot stream, the agent falls back to a long poll.
FleetObserve
A bidirectional stream from the agent. The first message is a hello with an epoch; the agent then sends the full state of the world, followed by only the changes (upsert and delete) and heartbeats. Messages carry a sequence number; a new epoch replaces the previous set. A second stream for the same fleet supersedes the first, which ends with FailedPrecondition. The reports land in the existing status tables, so the console reads them as before. Without a stream the agent sends unary reports.
Measured
On a laptop, with PostgreSQL 17 in Docker (one run each, not a benchmark of a deployment):
| Before | After | |
|---|---|---|
| Database transactions a second, 100 idle fleets | 501 | 0.6 |
| Database transactions a second, 400 idle fleets | 2,001 | 0.6 |
| Time for a change to reach waiting fleets | baseline | about three times faster |
| Pool readiness reaching the control plane | a poll interval | milliseconds |
They come from a laptop run with one database container, so read them as a comparison, not as capacity.
Next steps
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.