Expand description
Discover a partition bound by running a source once (#479).
An id range is frequently open-ended: you know where to start but not where
the data ends. Rather than invent a probe protocol, the bound comes from an
ordinary source config — so SELECT MAX(id), a ?sort=-id&limit=1
request, or a count endpoint all work through the existing connector
registry, auth catalog, and secrets. Discovery stays as source-agnostic as
the substitution it feeds.
§The probe/plan race
Rows inserted between the probe and the last chunk’s execution sit above the
discovered maximum and would never be read. to_unbounded: true closes that
by dropping the final chunk’s upper bound, so it is defaulted on whenever
to is discovered — the same reason plan_pk_shards marks its last shard
hi_unbounded. An explicit to_unbounded: false still wins, for a range the
user knows is closed.
§Injection
A probed value comes from outside faucet, so it is parsed into a typed i64 /
u64 here and re-rendered from that. The raw string a source returned is
never substituted into a config — which is what keeps the “every token value
is faucet-generated” argument true once discovery is in play.
Functions§
- needs_
probe - Whether
specneeds a probe — letsfaucet validatereport that it cannot fully plan offline without pretending it can. - probe_
implies_ unbounded - Whether a probed integer bound should default
to_unboundedon. - resolve_
bounds - Resolve every discoverable bound in
spec, returning a spec whose bounds are literals. A spec with no probes is returned unchanged and costs nothing.