For the technical audience
Decisions ADR-221 to ADR-230
Every architecture decision record (ADR) behind TelltaleDNS: what we knew, what we chose, and what it costs. This page is built from the specification on every change, so it's always the current record.
ADR-221 The cluster port gives connections without a member certificate their own limits, time and placesThe cluster port (CLU-001) serves members, which present a cluster certificate, and nodes that can't present one yet: a node joining with a join token or the bootstrap secret, and one asking for the CA.
Context
The cluster port (CLU-001) serves members, which present a cluster certificate, and nodes that can't present one yet: a node joining with a join token or the bootstrap secret, and one asking for the CA. Client certificates therefore stay optional on the port. ADR-212 set the port's two HTTP/2 reset limits; its other HTTP/2 limits were the library's, and it set no limit on how many connections it held or for how long, unlike the DNS listeners (DNS-003, ADR-215).
Decision
- Two kinds of connection, fixed after the TLS handshake: a member connection, whose client certificate is a cluster certificate naming a node that wasn't removed (the removed list is read once per connection), and a connection without a member certificate: anything else, a removed node included (it is still told why its stream is refused, ADR-155).
- HTTP/2 limits per kind:
- a member connection keeps the values the port had, written out: 200 streams, 1 MiB stream and connection windows, 16 KiB header lists, 16 KiB frames, a 400 KiB send buffer;
- a connection without a member certificate gets 2 streams, a 64 KiB stream and a 128 KiB connection window, 4 KiB header lists, 16 KiB frames, a 64 KiB send buffer;
- both: a keep-alive PING after 10 s without a frame and 20 s for its answer, and ADR-212's reset limits.
- Time and requests:
- every connection has 5 s from its accept to send its whole TLS ClientHello and 10 s to finish its handshake;
- a connection without a member certificate has 5 s from the end of its handshake to send its first request and 10 s in all, a request body still coming in included. It is then sent GOAWAY, a request whose answer is still being made gets 2 s more, and the connection is closed whatever the client does;
- such a connection may make 2 requests: when the second comes in it is sent GOAWAY, and at a further request it is closed at once, without that request being handled or answered.
- Places:
- Every connection holds a place in the TLS pool from its accept until its handshake is done (256 places, 32 for one address group), a member's too.
- A connection without a member certificate then holds one in the unauthenticated pool for the rest of its life (64 places, 16 for one address group). A member's connection gives its place back after its handshake and holds none.
- An address group is an IPv4 address (an IPv4-mapped IPv6 address counts as its IPv4 address) or an IPv6 /64, as for the DNS listeners' per-address limit.
- Which place ends: when a pool has no room, the new connection is admitted and an older one is closed at once, with no grace.
- The per-address check comes first: when the new connection's address group already holds its share, that group's oldest place ends.
- Otherwise, when the pool is full, the oldest place of the address group that holds the most places ends (of groups that hold as many, the oldest of their places).
- The rule is the same in both pools, whatever a connection has sent so far.
- The count of a closed connection: it keeps its place until its socket is closed and isn't chosen again. Only when the places that could make room are all closing already is the new connection closed instead.
- Counters:
telltale_cluster_port_connections{kind="handshake|unauthenticated|member"}andtelltale_cluster_port_ended_total{reason="handshake|unauthenticated_lifetime|request_budget|unauthenticated_limit"}. A connection counts once, for the first reason, and a close for lack of room counts as that. One log line per reason at most once a minute, with a count (handshakeat info, the others at warn). - No keys: the values are constants, not configuration keys.
[cluster]refuses unknown keys, so a key would stop an older node from reading a newer file, and no operator has needed one. - Clients: the cluster's own clients send their small writes at once (
TCP_NODELAY). - ADR-212's cluster bullet and its consequences point here.
Planned (stage B), intentions only:
- the chart and the docs on where the cluster port should be reachable;
- liveness on the client side for blob fetches, joins and CA requests;
- bounds on what one member connection may hold and ask for;
- liveness of long-lived cluster streams.
Alternatives considered
- Client certificates required on the port: a joining node and a CA request have none yet. Not chosen.
- A separate port for joins: join tokens and the Helm chart name one port, and older joining nodes would stop working. Not chosen.
- Refusing a new connection when a pool is full: a full pool would keep members from reconnecting. Not chosen.
- Closing the oldest connection by arrival alone: every address would share one order. Not chosen: the address holding the most places goes first.
- Ranking connections by how far they have come (a ClientHello read, a handshake under way, a request made): a newcomer would rank lowest until each of its steps is done, whatever its address. Not chosen: one rule, address weight and then age, in both pools.
- A grace period for a connection closed to make room: it would keep its socket past the limit. Not chosen.
- Answering requests past the budget until the lifetime: each would still take a request task. Not chosen: the connection is closed at the first.
- Counting members by address: members behind one address would share one limit. Not chosen: a member holds a place only during its handshake.
- A per-address rate limit on joins and CA requests: clients behind one address would share it, and a refused join costs little. Not chosen.
- Configuration keys: not chosen.
Consequences
- Fit:
- A join or a CA request (one request, well under a second) and a member's reconnect fit well within the limits.
- Established member connections are never counted or closed by the places.
- Nodes on older versions keep working both ways: their clients make one request per join or CA connection, and their member connections are served as before.
- Bounds:
- The port's sockets for connections without a member certificate, and their memory, are bounded: at most twice the places while closed connections finish closing.
- Per connection: two timers and a few atomics; nothing changes on the DNS path.
- Residuals:
- An address that holds more places than the others loses its oldest place first. That address may be a NAT, a load balancer that hides client addresses, or a /64 that clients share (some pod networks). Its members' and joining nodes' handshakes are among those places.
- Behind a load balancer that hides client addresses, all connections without a member certificate share one address group per balancer address.
- Many address groups: an IPv6 prefix wider than a /64 against a listener on
[::], or a large pool of IPv4 sources, gives many groups holding a place or two each. Their weights tie and the oldest place goes.- A member's or a joining node's handshake then lasts only as long as it takes as many newer connections to arrive as the pool holds: over a link with a 0.8 s round trip, 256 TLS places outlast about 320 new connections a second.
- Those newer connections need not send anything.
- Each connection that sends a TLS ClientHello costs the port a key exchange and a signature, even when the same bytes are sent again. The places bound how many handshakes are held at once, not how many are made.
- When as many places as a pool holds are closing at once (which takes a runtime so busy that closed connections aren't put away), every new connection is closed at its accept, a member's included, and counted; it is retried with the usual backoff.
Verification
crates/telltale-cluster/src/net_port_tests.rs:clu_001_the_listener_announces_each_kinds_h2_limits,clu_001_a_connection_without_a_member_certificate_that_sends_nothing_ends_at_its_first_request_limit,clu_001_a_slow_join_body_ends_at_the_unauthenticated_lifetime,clu_001_a_connection_without_a_member_certificate_gets_two_requests,clu_001_rapid_resets_without_a_member_certificate_reach_the_handler_at_most_twice,clu_001_a_client_that_ignores_goaway_is_closed_at_its_lifetime,clu_001_a_removed_node_gets_the_limits_without_a_member_certificate_and_its_403,clu_001_joins_and_member_streams_work_under_the_port_limits,clu_001_a_request_a_round_trip_after_tls_is_answered_while_the_places_are_full,clu_001_a_connection_before_its_client_hello_outlives_handshakes_of_heavier_addresses.crates/telltale-cluster/src/admission_tests.rs: address weight, then age, in both pools; address groups; closing places; the pools under races.crates/telltale-cluster/src/net_port_churn_tests.rs(run with--ignored --test-threads 1and a raised descriptor limit):clu_001_a_join_and_a_member_get_through_a_connection_churn,clu_001_connections_that_finish_tls_stay_within_the_ports_places.crates/telltale/src/server_cluster_port_tests.rs(run with--ignored):clu_004_dns_answers_while_the_cluster_port_is_busy.crates/telltale/src/http_tests.rs:clu_001_cluster_port_connections_and_endings_are_exported.
REQ: CLU-001, CLU-004.
Requirements CLU-001 CLU-004 DNS-003
Builds on ADR-155 ADR-212 ADR-215
Referenced by ADR-212
ADR-222 Every forwarded query asks for the AD bit; each client gets AD only if it set DO or AD, whichever client asked firstGitHub issue #155 (cbernha986): with [dnssec] mode = "off", a client that sets AD without DO (dig +adflag +nodnssec) got no AD from TelltaleDNS, while the same query sent straight to the upstream (a validating resolver) got it.
Context
GitHub issue #155 (cbernha986): with [dnssec] mode = "off", a client that sets AD without DO (dig +adflag +nodnssec) got no AD from TelltaleDNS, while the same query sent straight to the upstream (a validating resolver) got it. A query forwarded upstream copied the client's DO and CD bits but never set AD. RFC 6840 §5.7 makes AD in a query the requester's signal that it understands and wants the AD bit, without asking for DNSSEC records (RFC 4035 §4.6 had said to clear it in queries), and §5.8 says a validating resolver sets AD on an answer only when the query had DO or AD. So the upstream answered without AD and there was nothing to pass on; the answer side already treated DO or AD as a request (Client::ad_ok). The same with validation on: the validator set AD on a secure answer only if the client whose query missed set DO or AD, and the cache key separates DO and CD but not AD, so a secure answer cached for a client that set neither reached later AD-only clients without AD until it expired.
Decision
- Every query sent to an upstream sets AD in its header, next to CD (
encode_query_with): client misses, prefetches, DNS64's A lookups, the validator's own lookups, health checks, synthetic probes, the draft upstream check, second opinions, and the lookups of an upstream's host name through bootstrap servers (its own or the system's). Every transport sends those bytes as built: UDP and TCP, DoT, DoH (POST and GET), DoH3, DoQ, DNSCrypt, and plugins (unix://,exec://). Arecursive://upstream gets them too and ignores AD (its own queries to authoritative servers are unchanged). The DNSCrypt certificate fetch, which forwards no question, is unchanged. - The cache keeps the AD bit an answer came with: the upstream's with validation off; with validation on, the validator's, which now sets AD on every secure answer (the pipeline asks for it whatever the client set). Each client's copy keeps AD only if that client set DO or AD (RFC 6840 §5.8): from the cache, as a stale answer, and as the miss's own answer, as before.
- Unchanged: with validation on, an answer not validated here never carries AD (ADR-098, note of 2026-11-28); answers built here (blocks, rewrites, local data, safe search, DNS64's AAAA) never set it; the cache key and the cache dump format; client EDNS options are still never forwarded; each answer still gets TelltaleDNS's own OPT record, so an upstream's Extended DNS Error isn't passed on (not decided here).
Alternatives considered
- Copy the client's AD bit into the query forwarded: the cache key doesn't separate AD, so the first client to ask would decide what every client sharing the entry gets. Not chosen.
- Add AD to the cache key: one more entry per name for AD-only clients and a new cache dump format, for nothing the rule above doesn't give. Not chosen.
- Take
client_adout of the validator's API: the pipeline passingtruedoes the same with the validator and its offline tests unchanged. Not chosen.
Consequences
- Every outbound query's header has one more bit set, which dnstap's forwarder messages and an upstream's own logs show. An upstream that ignores AD in queries answers as before.
- With validation off, the AD bit a client sees is the upstream's own claim, passed on to clients that set DO or AD, and only as trustworthy as the upstream and the path to it (an encrypted upstream protects the path). An upstream, or a device on the path, that copies a query's header bits into its answers (the case for which RFC 4035 §4.6 had queries clear AD) now answers with AD every time, and clients that set DO or AD see it; before, such a copy came back without AD. With validation on, the upstream's AD is never used.
docs/running.mdsays so next to the AD bit and for plugin upstreams, and theoffmode's description in the configuration schema says so too; where it matters, validation is the way to have AD decided here. - With validation off, a cache entry's AD bit (the cache inspection's
authentic, the cache makeup'svalidatedcount) now carries the upstream's word for entries of every client shape, not only for those of clients that set DO; with validation on, every cached secure answer has it, whoever asked first.docs/running.mdsays what the Cache page's "validated" count and an entry'sauthenticmean with validation off; the page and the API are unchanged. - A cache dump taken by an earlier build loads unchanged: its entries keep the AD bit they were stored with until they expire; no answer gains an AD bit it wasn't given.
- The golden bytes of ADR-192's test change by that bit.
- No cost on a cache hit; a miss sets one more bit in a header it already writes.
Verification
dns_011_forwarded_queries_ask_for_ad (every encoding, with and without DO, CD, the loop tag and an ECS option: RD and AD, CD as asked, nothing else); ups_009_default_query_bytes_are_unchanged (the golden bytes with AD); through the pipeline with validation off, in front of an upstream that sets AD only when the query has DO or AD: dns_011_dnssec_off_asks_the_upstream_for_ad (clients that set AD only, with and without an OPT record, DO, DO and AD, CD and DO, AD and CD get AD, one that set neither and one that set CD only don't; the upstream sees AD on every query, and DO and CD as before) and dns_011_dnssec_off_ad_does_not_depend_on_who_asked_first; with validation on, dns_011_with_validation_on_unvalidated_answers_never_carry_ad_for_ad_only_clients (a zone proven unsigned, nothing to serve, an answer that isn't secure served in permissive, CD, a negative trust anchor, a dnssec_nta route: no AD for a client that set AD only, served or from the cache); dns_006_ad_reaches_only_clients_that_ask (the cache: fresh, stale and rendered); dns_011_offline_ad_asked_for_marks_secure_answers_only (the validator with AD asked for, with and without DO: secure answers carry AD, insecure and bogus ones don't). Unchanged and green: the existing dns_011_* AD tests and dnssec_offline.
Not done
a test through the pipeline of a secure answer cached for a client that set neither DO nor AD and then served to one that set AD: the signed test zone lives in telltale-upstream's offline tests, which the pipeline's tests can't reach.
REQ: DNS-011, DNS-006, UPS-001.
Requirements DNS-006 DNS-011 UPS-001
ADR-224 MikroTik routers: DHCP leases over the RouterOS REST API, on their own schedule, backing off after a refused read, within size limitsT8.2, API-010, FLT-006.
Context
T8.2, API-010, FLT-006. A contributor's pull request (#68) adds MikroTik routers. A MikroTik router runs its own DHCP server, so its devices show up in TelltaleDNS by address only. RouterOS 7.1 and later serve a REST API (/rest/…) with the same data as the terminal: over the www-ssl service, and over the plain www service from RouterOS 7.9. It signs in a RouterOS user with HTTP Basic: every request sends the password, and RouterOS logs a sign-in when it opens a session (about every 10 minutes while the password works) and each one it refuses. RouterOS v6 has only the binary API (port 8728), which would need a protocol implementation of its own. The other routers follow ADR-166 (offline clients), ADR-181 (keys from the UI), ADR-183 (MAC bindings) and ADR-207 and ADR-208 (a FRITZ!Box's own schedule, size limits and backoff).
Decision
type = "mikrotik", RouterOS 7.1 or later: oneGET /rest/ip/dhcp-server/leasea read, with.proplist(only the fields used), as theusernamewith the password inpassword_file(a password pasted in the UI is saved like a key, ADR-181). No new dependency: the fetch client and the TLS options the other routers use (tls_ca,tls_server_name,tls_insecure_skip_verify).http://loads with ADR-207's warning: the password then travels in clear on every read. As for a FRITZ!Box (ADR-207, ADR-208), theurlis the scheme, host and port only (the REST path is appended to it, and a user in it would be sent and shown in errors), andapi_key_fileandapi_secret_fileare refused rather than ignored; so is ausernamewith:, which HTTP Basic can't carry.- Connected and offline, as UniFi's (ADR-166). A lease with
status = boundis a connected device, at itsactive-addressandactive-mac-address. A static lease (dynamic = false) that isn't bound now is an offline device: kept when it has a name and itslast-seenis withinoffline_days(one never seen, or whoselast-seenisn't a time, stays, ordered last), the most recently seen first, at most 1,024, and never over a connected device's address (the UniFi merge, now shared). Disabled leases and dynamic leases that aren't bound are skipped. Leases from every DHCP server on the router are read. - ADR-183's conservative rule. A bound lease reported without its
active-addressoractive-mac-addresstakes the lease's ownaddressormac-address: where the device was given an address, not necessarily where it is. Its MAC goes innot_current, so the row names the address and identifies no device there, as UniFi's last-known address. - Names: the lease's comment (its first line), else the host name the device sent, without control characters. A comment line or a host name over 253 bytes isn't used (a long comment falls back to the host name, a long host name to no name), as a FRITZ!Box's host names (ADR-207).
- Its own read interval, as a FRITZ!Box's (ADR-207). A MikroTik router keeps its own
interval_secs(at most 600 s while the routers feed identification, ADR-183): another router's failure or shorter interval doesn't make it read more often. A round reads it with the FRITZ!Boxes, after UniFi and OPNsense, the failing ones first. - A refused read backs off whatever the interval (ADR-208's ladder). Once the router answered (it checked the password), every failure backs off: a 401, a 403, a 500 or another status, a 200 that isn't a lease list, an answer over the limits below, an answer cut short or not finished in time. The router is then asked again after 15, 30, 60 and 120 s, then every 240 s, not cut to its
interval_secs: a wrong password is tried at most 19 times in the first hour by each node that holds it, then every 240 s. A read that got no answer at all (no address, no connection, a TLS failure, no answer within 15 s) backs off on the same ladder cut to the router's interval, as a FRITZ!Box whose read failed in its host entries. Which of the two a failure is comes from whether an HTTP answer came, never from an error's text. A failure before any request (no password file) is asked again in every round. A newusernameorpassword_fileends the wait (ADR-208). - Size limits. An answer over 4 MiB fails the read. It is read as UTF-8 (a byte that isn't becomes U+FFFD, as in a FRITZ!Box's host list), and it must be a list of objects, or the read fails ("the answer isn't a lease list"). Its rows are parsed one at a time into typed lease rows: the
.proplistfields as text (a string as it is, a boolean or a number as its text,null, a list or an object as nothing, so an odd value affects only its own lease; RouterOS sends every value as a string), any other field skipped unread; and they are counted while they are parsed: more than 4,096 rows of any status fail the read before the rest is built. More than 1,024 bound leases fail it too (ADR-207's count for a box's hosts). A failed read keeps the router's last list. 1,024 bound leases with every field at a realistic length are about 0.3 MiB of answer, so the count of bound leases is the limit that binds. - Within the cluster's answer limit. Both lists ride in every full member's answer to
devices.names(JSON), against the cluster channel's limit on an answer (1 MiB less 1 KiB): up to 1,024 bound and 1,024 offline leases, 2,048 rows. Control characters are dropped from names, so a name takes at most twice its bytes there ("and\are escaped), at most 506 bytes; a row's other fields take at most 208 bytes (its address twice, a 17-byte MAC field at up to 6 bytes a byte, the field names and every flag), 2,048 rows at most 425,984 bytes. A router's rows and names may take 500 KiB of that answer: its names are kept in order, connected leases first, then offline ones, most recently seen first, while they fit; past that a name is left out (its row stays, named by nothing, and its MAC identifies as before). So one router at every cap takes at most 500 KiB, and two fit the limit with the answer's own fields. Measured byt8_2_mikrotik_names_fit_the_cluster_frame: 441,165 bytes for one router with every cap at its worst (names of", MACs of control characters; 165 of its 2,048 names kept), 882,293 bytes for two, and 285,733 bytes for 2,048 leases with realistic names and MACs, every one named. UniFi's, OPNsense's and FRITZ!Box's names aren't cleaned or budgeted this way: a name cleaner shared by every router is a follow-up. - Errors say what to check, by the REST status (RouterOS's manual): 401, the username, the password, the group's
rest-apiandapipolicies, or the user'saddress; 403, the REST API turned off for the service; 500, a group without theapiorreadpolicy; 404, a RouterOS before 7.1; a 200 that isn't a list, "the answer isn't a lease list". No error of a request names the username, the password or the password file; a password file that can't be read is named by its path, as for every router (a path isn't a secret). - In a cluster. Every node that holds the password reads the router, and the RouterOS user's
addressmust list each of them: the router refuses the others (HTTP 401), which then back off. Keep the password on the primary and, for a failover, on the node that would take over. Helm resolver pods don't read it, as they don't read a FRITZ!Box (ADR-207, CLU-009): every read sends the password, which would have to be in every pod; they get its names from the primary overdevices.names. - Mixed versions.
[[router]]is shared andRouterConfigrefuses unknown values: a node on an earlier version refuses a shared configuration withtype = "mikrotik"and keeps the one it had, and an older node with it in its own file doesn't start. Upgrade every node before adding a MikroTik router; remove it before going back to an earlier version.
Consequences
- A MikroTik router names devices from Clients → Discovered → Routers or
[[router]], with a read-only user (policy=read,api,rest-api), and its bound leases identify devices named by their MAC under ADR-183's rules. - One request a read. RouterOS v6 isn't supported. A lease's DHCP
serverisn't used to filter. - Nothing on the query path changes, and no dependency is added. UniFi and OPNsense keep their schedule and limits.
Verification
in routers/mikrotik_tests.rs, against a fake RouterOS on loopback: t8_2_mikrotik_a_refused_sign_in_backs_off (a 401 on the routers' schedule: 15, 30, 60, 120, then 240 s at interval_secs 30 and 300, 19 tries in the first hour; no answer backs off up to the interval; a new password file is tried at once), t8_2_mikrotik_keeps_its_interval_while_another_router_fails, t8_2_mikrotik_an_answer_over_4_mib_fails, t8_2_mikrotik_more_than_4096_leases_fail_the_read, t8_2_mikrotik_reads_1024_bound_leases_and_fails_on_1025, t8_2_mikrotik_a_name_over_253_bytes_is_not_used, t8_2_mikrotik_reads_1024_real_shaped_leases, flt_006_a_mikrotik_lease_without_an_active_address_is_unsure, t8_2_mikrotik_errors_follow_the_rest_status, t8_2_mikrotik_an_odd_value_affects_only_its_row (a host name that isn't UTF-8, a boolean, a number, null, a list and an object each affect only their lease; an answer that isn't a list of objects fails), t8_2_mikrotik_names_drop_control_characters, t8_2_mikrotik_names_fit_the_cluster_frame (the real devices::Names answer as devices::own writes it: at most 512 KiB for one router at every cap with the most escaping, at most the limit for two, every realistic name kept), t8_2_mikrotik_a_read_with_no_answer_times_out (on tokio's paused clock: a request that gets no answer fails after 15 s as one with no answer, tried again after 15 s and then every 30 s at interval_secs = 30); in routers.rs, t8_2_routeros_durations (both spellings; never, sometime, an overflow, a sign and a mixed spelling are no date), t8_2_mikrotik_leases_bound_and_static and clu_009_resolver_pod_does_not_read_a_mikrotik; api_002_the_api_takes_a_mikrotik_router_signed_in (refused without the password, by the name to paste, and over plain http://; saved as secrets/router-<name>.password.<16 hex> and never returned); in telltale-config's tests, t8_2_mikrotik_router_is_validated, t8_2_mikrotik_url_is_an_origin, t8_2_mikrotik_signs_in_with_a_user_not_an_api_key, t8_2_mikrotik_username_has_no_colon; deploy/routers-e2e.sh (a fake RouterOS: a bound lease and an offline static lease are named, one outside offline_days isn't; a bound lease's MAC identifies the [[client]] that lists it, identifiedBy = router_mac; a router whose password is refused is logged without the password); Playwright t8_2 a MikroTik router is added in the UI.
REQ: T8.2, API-010, FLT-006, API-002, CLU-009, CLU-002.
Requirements API-002 API-010 CLU-002 CLU-009 FLT-006
Builds on ADR-166 ADR-181 ADR-183 ADR-207 ADR-208
Referenced by ADR-183
ADR-225 A Service health page from one overview read, with no health model of its own and nothing on the query pathThe signals an operator needs at a glance are spread over the Dashboard, the Cluster, Upstreams, Alerts and Settings pages, the health popover, and Prometheus, and some have no history at all: distinct clients over time, node reachability over time, per-upstream exchanges, a history store that fails.
Context
The signals an operator needs at a glance are spread over the Dashboard, the Cluster, Upstreams, Alerts and Settings pages, the health popover, and Prometheus, and some have no history at all: distinct clients over time, node reachability over time, per-upstream exchanges, a history store that fails. The page and its API must not change resolver performance (02 §3), DNS must never depend on them (02 §8, CLU-004), and a Pi must afford them. What the page records and how a recording becomes a verdict follow from the ways this resolver is known to fail. This ADR records the decisions, and the conditions each later part must meet.
Decision
- One read, one page.
GET /api/v1/health/overview?range=1h|6h|24h|7d&detail=full|summary&scope=…(OBS-040, OBS-045). Buckets: a minute for 1 h, 5 minutes for 6 h and 24 h, an hour for 7 d (at most 300). Viewers, agents withanalytics:read(as/system/healthand/cluster), and wall displays read it. The page is "Service health" in the Monitor section (Phase 1, T33.4). - No second health model. The level and the reasons are OBS-015's, rebuilt from the overview's own read exactly as
GET /system/healthbuilds them (health::cluster_health, shared by both). The resolution signal applies OBS-015's SERVFAIL thresholds (degraded from 5 %, severe from 25 %, judged from 50 queries) to the last 5 minutes with answers served stale counted against it, is at least degraded while the availability objective burns (slo_burn), and is never healthier than the level: OBS-015 judges SERVFAIL per node, so a node's ownservfail_rateraises the signal even when every node together is under the thresholds; the latency signal is degraded only while the latency objective burns, and shows p95 against[slo] latency_ms. No new threshold constants. - One cluster read. Each node in scope is asked once (
Read::MonitoringParts), with the federated reads' 2 s deadline and the bridge's bounds (ADR-174); this node makes its own part meanwhile, on the same blocking thread. A part is what the node has already summed into the overview's buckets, never its time buckets: answers, SERVFAIL by status class, stale, a 17-count latency histogram per bucket; its upstreams by name (32 at most, the 8 busiest with answers per bucket, the rest with totals; the quietest past 32 summed asother); its last 5 minutes; 6 hours of SLO counts per minute; its own OBS-015 reasons (48 at most, the most serious kept first); its change markers (50 at most, cut to the fields the overview uses); what its heartbeats say about its peers (64 at most); its checks. Every list and text has a cap (texts in characters: a note of 200 characters comes out whole in any script), applied by the sender and again by the receiver, and a part is then held to 256 KiB as JSON whatever its texts hold (a character can take 4 bytes, a control character 6 once escaped; that bound is the only byte guard): the oldest markers go first, then the least serious reasons (the most serious stays), then the peers, then the upstreams' answers per bucket, then the quietest upstreams. At every cap in plain text a part is about 240 KiB (a node answering 10,000 queries a second, 300 buckets); a peer is never trusted to be small. A node answers a peer's part only for a plan the overview itself makes (one of the four ranges: a minute a bucket over an hour, 5 minutes over 6 or 24 hours, an hour over 7 days, so at most 300 buckets and never 7 days of minute rows; ending at most a bucket, and a minute of clock difference, after now), checked before a row is read. For the whole cluster (noscope), the serving node adds the minutes other nodes shipped to it (CLU-007) that no node answering now holds, as one more part without a node: in the series, the last 5 minutes, and the SLO counts, as the Dashboard's timeseries andGET /system/healthcount them. - Missing nodes say why, in fixed words, never the peer's own:
not_connected,timeout,refused(this node had too many cluster reads waiting),too_large,older_version(it doesn't know the read: "older version: no history", not "history missing"),error. Their DNS state still shows, from heartbeats: DNS state comes from heartbeats, history from storage, and they are kept apart. - A node's DNS state is what was measured. Its own report (ready, listener probes failing, answers in the last minute) comes with its part, or with the freshest heartbeat any node that answered heard from it. States:
answering,not_answering(it says it can't: not ready, or its probes fail),unreachable(no node that answered hears it: nothing says whether it answers DNS),no_contact(linked to this node and not heard here, heard by another: a link problem, not a node problem),maintenance,reachable(a witness),left(reserved for resolver pods that went away). Reachability alone never makesnot_answering. Each row says whose observation it is (observer): this node when it hears the node or the node's part arrived over its link (a part that arrived is contact, whatever the age of the last heartbeat), else the node that heard it most recently. A member this node has no link to by design (link: none, known from the registry only, as other replicas are to a replica in a star) isn't judged by this node: another's observation counts. A node whose part arrived shows 0 forseenAgoSeconds(the part's age), not its heartbeat's. Nodes are named by one label (pod, else site, else ID) in events, reasons,missingNodes, andobserver: a page joins them on the row'sname. Thenode_downreason itself is unchanged here, so the nodes signal's level (from the reasons) and the rows can differ: a member that only the registry knows and another node hears keepsnode_downwhile its row saysanswering; the page shows both. - SERVFAIL causes from what is stored. The minute rollups already split SERVFAIL by status:
forwarded(an upstream answered SERVFAIL and it was passed on) andservfail(this resolver's own: no upstream answered in time, a DNSSEC failure, overload, an unusable answer). The overview showsupstream,resolver, andother(from the cache, or stored without the split). A finer split needs a counter in the pipeline's failure branches and a benchmark first; it isn't made here. - Estimates say so. Latency percentiles are the upper edge of the latency bucket they fall in (5 s means 5 s or more), so the page shows them with "≈" and never with more digits than a bucket has.
- Upstreams by name only. No address or URL is in an answer: the transport comes from the URL's scheme, nothing else of it (
dnscrypt://andsdns://arednscrypt). Answers per bucket are null where no node has data and are left out of a row when a node that counted the upstream didn't send them per bucket (each node sends them for its 8 busiest; the total holds every answer): never a 0 that wasn't counted. The quietest upstreams past a cap are summed into a row namedotherand markedfolded, so an upstream really namedotherstays its own row. An upstream no node is configured with any more, that still has answers in the range, shows with its breakerunknownand isn't counted in the upstreams signal. - Events are change markers, checked. Known kinds only, a summary no longer than a note, a link only when it starts with
#/; each labelled with its node. "Earlier:" (the newest problem that cleared within the range) comes only from what is stored: a stretch whose share of queries answered SERVFAIL or served stale (the resolution signal's measure) passed OBS-015's thresholds over its 5-minute window (an hour per bucket over 7 days), every node together; or an upstream benched and answering again by its markers. A stretch on one node alone that stayed under the thresholds for every node together isn't an "Earlier:" (the level judged it per node while it was on). - Checks only where a source exists: certificates (listeners, the web UI, the cluster), blocklists, storage (the fullest data disk, the history store's errors), listeners (probes), telemetry (query events the analytics dropped), alerts (counts, where they are evaluated), configuration (pins, stuck rollouts, nodes behind, the Git source), clocks (the largest heartbeat offset), Kubernetes when it is stale. A check's level comes from the OBS-015 reasons it covers, else
info(the configuration check's two Git words, the newest commit refused and the source unreadable, have no reason of their own:info, neverhealthy); its words come from those same reasons ("2 node(s) behind the primary's configuration", "pinned", "no canary is online"), never a sentence its level contradicts. Every OBS-015 reason carries the numbers and names its summary is made of (params, at most 4), so the page can say any of them in the reader's language (one table of every code's parameters is in the running guide, and a test fails when a code or a parameter is missing from it); a failing list's error stays in its summary only. - History errors are counted and named.
telltale_rollup_errors_total{op="open|write|read"}counts the history store's failures at the writer, at the API's read sites, and where minutes other nodes ship are stored (a write that doesn't count toward this node's own failed flushes). The degraded reasonhistory_unavailable(never severe) is set on a node while its store couldn't be opened, after three minute flushes fail in a row (until one works), or for 5 minutes after a read fails. A store that couldn't be opened counts as unavailable for as long as it stays off: no history is kept past the 48 hours in memory. - Bounded cost. An answer is worked out at most once every 10 s per range, detail, and the nodes the scope resolves to (two spellings of the same nodes share one): the first caller starts it on a task of its own and everyone who asks meanwhile waits for that one (a single flight; at most 16 kept), with
Cache-Control: private, max-age=10. The 10 s count from the moment the answer arrives: a read that is still running is waited for, however long it takes (up to the limit below), never started a second time. A caller that goes away doesn't stop it, and the next caller waits for it rather than starting another; at most two are worked out at once on a node, whatever the keys, and one that nobody waits for any more is not started. Waiting for a turn and working the answer out take at most 20 s together: then the callers get a 503, and the next question tries again; a read that stalls (a blocking thread can't be stopped) keeps its turn until it ends, so stalled reads never pile up past two. The reads run on a blocking thread (blocking, ADR-174), never on a runtime worker, and the answer is serialized there once (as a user reads it, and as an agent does), so a kept answer costs a request a reference count. A summary is at most 4 KB and says each thing once: nodetail(it repeatsreasons), and each event as its kind, level, node, time in milliseconds, and English sentence, in a type of its own (HealthSummarywithSummaryEvents), so that nothing in the schema is optional that is never there: the full answer's events keep their RFC 3339 time and every sentence itscode; then, if it is still over, the oldest events go first, then the least serious reasons; the level and the headline stay. A two-node cluster's summary isn't cut. - Mixed versions during a staged rollout. A node on an older build answers no part: it is listed
older_version, and its own reasons aren't in the overview's level (the headline says the level is from the nodes that answered:healthy_partialwhen they found nothing). The health icon (GET /system/health) still includes them, with a read older builds know, so the two can differ until every node is upgraded. Asking the older nodes for their health with that read too was left for later. - One MCP tool,
health_overview(read-only): the summary, for a range. No WAN route or tool until something consumes them. - Distinct clients (OBS-041, T33.2): a set per 5-minute slot, built on the telemetry thread when the slot closes, hashed with a key derived from the cluster's privacy key, kept in the minute rows only (an hour or day row keeps no set), absent at query-log privacy level 2 and above, counts only through the API, and a slot at the analytics' cap shown as "4,096 or more". Until it exists the series is null and the signal says why.
- Node and primary markers, and health reasons (OBS-042, T33.3), written by the primary (or a standalone node) only, at most one per node every 5 minutes, through
spawn_blocking; markers from other nodes checked like local ones. - Phase 2 (T33.6 to T33.8): a 10 s health sampler off the query path and a
health_minutetable kept 7 days (no hour table until something reads it); per-upstream strips; the WAN read, computed and recorded in shadow mode until the owner has signed off on 14 days of it on the edge nodes, never raising the level by itself, with no new egress by default.
Conditions on the later parts (each a test or a measurement before the part ships):
- Distinct clients (T33.2): counted only after the privacy transform, absent at query-log privacy level 2 and above (
obs_041_no_client_series_at_privacy_2); the hash key derived from the cluster's privacy key with a context of its own (no new secret, never sent); at most 1 KiB a slot (a HyperLogLog, p = 10, or a capped encoding); minute rows only, an hour or day row keeps a count and no set (a test decodes an hour row after a flush); never inTimeBucketor an existing cluster read; counts only through the API; a slot at the analytics' cap shown as "4,096 or more";make bench-smokewith a same-binary control. - Storage (T33.2, T33.6): a new rollup section goes after the last known tag (older readers stop at an unknown tag);
health_minutekept 7 days by the existing hourly purge; nohealth_hourtable until something reads it; a downgrade test: an older build opens arollups.dbthat holds the new table and section. - Sampler (T33.6): it reads only the upstreams' health snapshots, the metrics slots, the cluster view and the host collector's numbers (no file or
/procreads of its own on a runtime worker); its rows go through the existing rollup writer (no new channel);make bench-smoke. - Markers (T33.3):
node.*andprimary.changedwritten by the primary or a standalone node only and taken from the primary's own file only (wan.changedby each node for itself); at most one line per node every 5 minutes; throughspawn_blocking; a unit test for each rule. - Nodes (T33.3):
leftfor resolver pods that left (a scale-down, a drained rollout), never "down"; a cluster end-to-end test that blocks the cluster port while DNS answers and expectsunreachable, nevernot_answering. - The WAN read (T33.8), before it is shown: (a) two or more providers failing or slow is "several providers failing", never normal (tests with 3 providers and 2 failing, 4 and 2); (b) the round trip from successful exchanges only (the per-upstream latency histograms already stored, or a success-only average with a benchmark); (c) the "measured" rule matches the real idle check cadence (about 60 s), tested with paused time and the real check loop; (d) a window is discarded after a sampler tick more than twice late (a paused machine) or a wall-clock jump; (e) IPv4 and IPv6 count as transport classes ("IPv6 fails at every provider"); (f) a provider from the preset,
provider =, the TLS server name, or the host name's registrable domain, an address prefix alone capping the confidence at low (a DoH upstream by name and a DoT upstream by address of the same provider failing together is not "the WAN"); (g) no shared-WAN inference from[cluster] site: agreement names the nodes that agree; (h) "the WAN link is the likely cause" only at medium confidence or higher, else the alternatives (a firewall or captive portal, a VPN, the upstreams); (i) each reason states its threshold; (j) table-driven tests for every verdict the read can give, at each side of each of its thresholds, and for a captive portal, a dropped VPN, DoT-only upstreams with port 853 blocked, IPv6-only breakage, a paused machine, a clock step without a hardware clock, two of four providers failing, and two sites. Shadow mode first for at least 14 days on the edge nodes, the owner's sign-off recorded here; a switch turns it off; thewan_suspectalert rule is off by default. - The page (T33.4): every string through the translation layer, server words as codes with parameters; no raw HTML; names marked
translate="no"; the banner announced only when the level changes; each "Look" link with an accessible name; the core bundle measured on the real page against current main and kept at or under 400 KiB (a lazy chunk counts as core), the change stated in the pull request; changes to the shared chart pass the Dashboard's end-to-end tests. - Footprint (Phase 1 and 2): a Pi soak with the page open on 7 days records the RSS high-water against the unit's 256 MiB
MemoryMax, and a 128 MiB resolver pod is measured;rollups.dbgrows by at most 4 MiB a week.
Alternatives considered
- Grafana dashboards only: they need Prometheus and Grafana, scrape each node on its own, and know nothing of the cluster's change markers. Kept for those who run them.
- Assembling the page in the browser from the existing routes: about ten calls every 30 s and several cluster reads each, heavy on a Pi, not agent-ready. Not chosen.
- Sending each node's time buckets and summing them on the serving node: a week of minutes is megabytes per node, over the cluster channel's frame. Not chosen: each node sums its own.
- A health model of the page's own (99.5 %, 97 %, 1 s): the page would say "severe" under a "healthy" banner. Not chosen.
- An exact client list per slot: up to 4 KiB a slot, and rolled into the hour and day rows it would be kept for 400 days and forever. Not chosen.
Consequences
- Nothing new runs per query. The overview's work runs on blocking threads at most once every 10 s per question; a node's part is a few reads of what it already keeps (its time buckets from memory or
rollups.db, its markers file, its probes, its heartbeat table). - One cluster read per overview: at most 256 KiB per node at every cap, a few KiB for a home network.
HealthReasongainsparamsbesidesummary, so a page can put any reason in the reader's language.- An older peer doesn't know the read: it shows as "older version: no history" until it is upgraded.
- The
upstream.breakermarkers stay sampled every 5 s; changes faster than that are not seen until Phase 2. - The per-upstream series is exact for the 8 busiest upstreams of each node; the others show in their row's totals, and a row that holds one of them draws no line per bucket.
- During a staged rollout the overview's level and the health icon can differ (decision 13).
Amended 2026-12-01 (the page, T33.4; amendment Proposed): a name that stands alone on the page (a node, an upstream, a version, the node of a change, a name in a legend, a tooltip or a table) is marked translate="no"; a name inside a coded sentence is not, because the sentence is one string of the translation layer and a mark inside it would need markup written per sentence. The condition on the page above is read that way.
Verification
each test once, by what it shows. The API crate, unit: obs_045_range_detail_and_buckets, obs_040_coded_sentences_carry_numbers_and_names, obs_040_signal_levels_follow_obs_015, obs_040_the_tile_is_never_healthier_than_the_banner, obs_040_percentiles_are_bucket_edges, obs_040_nodes_say_what_was_measured, obs_040_the_nodes_level_comes_from_the_reasons_not_the_rows, obs_045_upstreams_by_name_never_by_address, obs_011_the_transport_comes_from_the_scheme, obs_040_series_are_summed_and_start_with_the_data, obs_040_events_from_parts_are_checked, obs_040_an_earlier_problem_comes_from_what_is_stored, obs_040_the_config_check_says_what_sets_its_level, obs_040_the_git_words_of_the_config_check_are_info, obs_045_a_part_at_the_caps_is_small, obs_045_the_part_bound_holds_for_any_text, obs_045_a_note_and_a_name_in_any_script_come_out_whole, clu_004_a_part_is_answered_only_for_a_plan_the_overview_makes, obs_045_slo_counts_rebuild_what_the_burn_rates_read, obs_045_a_summary_fits_4_kb, obs_045_a_small_clusters_summary_isnt_cut; the single flight and its limits: obs_045_a_computation_nobody_waits_for_is_not_started, obs_045_a_computation_past_its_limit_answers_503, obs_045_a_computation_that_stops_without_an_answer_is_tried_again, obs_045_an_answer_is_serialized_once_and_shared. The API crate over HTTP and MCP: obs_045_overview_route_and_parameters, obs_045_overview_answer_and_cache_header, obs_045_overview_access_viewer_agent_display, obs_045_a_wall_display_reads_the_overview, obs_045_the_mcp_tool_reads_the_summary, obs_045_a_summary_is_sent_as_its_own_type, obs_045_the_schema_says_what_an_event_and_a_summary_have, obs_045_ten_requests_at_once_are_one_cluster_read, obs_045_callers_that_go_away_start_no_second_read, obs_045_at_most_two_overviews_are_worked_out_at_once, obs_045_an_overview_past_its_limit_answers_503_and_keeps_its_turn, obs_045_a_read_still_running_is_waited_for_past_the_time_an_answer_is_kept. The server: obs_040_every_reason_carries_its_parameters, obs_040_the_reason_parameters_are_in_the_docs, obs_040_a_failing_history_store_is_a_node_reason, obs_040_a_standalone_node_answers_its_overview, obs_040_the_tile_and_the_banner_come_from_the_same_data, obs_040_minutes_shipped_by_a_node_that_is_gone_still_count, obs_040_shipped_minutes_join_the_overview_for_the_nodes_that_didnt_answer, obs_040_only_the_whole_clusters_overview_counts_shipped_minutes, obs_045_no_upstream_address_reaches_a_part_or_the_overview, obs_040_a_peer_without_the_read_is_an_older_version, clu_004_a_peers_part_read_is_checked_before_a_row_is_read, obs_040_rollup_errors_are_counted_by_operation, obs_040_history_unavailable_after_three_failed_flushes_or_a_read_error, obs_040_history_unavailable_degrades_never_severe, obs_040_a_shipped_minute_that_cant_be_stored_is_a_write_error, obs_040_the_rollup_error_counter_is_exported, and clu_004_every_federating_backend_call_sits_behind_blocking (the new read is derived as federating). The cluster end-to-end script (deploy/cluster/e2e.sh) reads the overview from both nodes and with the replica stopped, and checks the summary's size and shape; deploy/cluster/upgrade-e2e.sh checks that the newer primary names the older replica older_version. The page (T33.4), in Playwright (ui/tests/e2e/12-health-*.spec.ts and 8-i18n-pseudo.spec.ts; 12-health-shape, 12-health-says, 12-health-poll, 12-health-links and 12-health-tokens need no server): api_005 obs_040 rebucket of plain numbers: one bucket each, the newest (filling) one left out, api_005 obs_040 rebucket of plain numbers: wider buckets are sums, grouped from the newest end, api_005 obs_040 rebucket of plain numbers: a ratio is a share of its denominators, 0 where there are none, api_005 obs_040 rebucket of plain numbers: an array shorter than the times counts the missing buckets as 0, as before, api_005 obs_040 rebucket keeps a bucket with no data as no data and leaves it out of the total, api_005 obs_040 rebucket: a wider bucket is no data only when every bucket in it has none, and a sum counts the others, api_005 obs_040 rebucket: a series with no data at all is no data in every bucket, with a total of 0, api_005 obs_040 rebucket: a share is no data where its numerators or its denominators are, and a zero where there were no answers, api_005 obs_040 rebucket keeps each series apart and leaves the input alone, obs_040 the range is one of four, and anything else is 6 h, obs_040 an answer is a full overview, or a summary of its verdict; anything else is no answer, obs_040 the changes of a full answer and of a summary come out in one shape, and only a link into the web UI is kept, obs_040 a series is padded with no data, cut where data begins, and summed without counting a gap as 0, obs_040 what a screen reader hears of a chart: the newest closed bucket with data, and the highest with its time, obs_040 a node and a level are drawn as the server says, and a word this build does not know is the neutral circle, never the octagon, obs_040 up to four rows are four coloured series, in row order, obs_040 more than four rows: the first four are coloured and the rest are one grey series, summed without counting no data as 0, obs_040 with more than four nodes the resolver pods of a site are summed first, where the first of them was, obs_040 an upstream really named other is its own row beside the folded one, obs_040 the estimate keeps no more digits than a latency bucket edge has, obs_040 the strings of an answer lose the characters that reorder text, and nothing else, obs_040 api_012 every health reason of the running guide has its sentence, in English from its parameters, obs_040 api_012 a reason that names a node says on which node, except the two that name it themselves, obs_040 api_012 the headline and the earlier problem are written from their codes, obs_040 api_012 the changes with parameters are written from them, and every other kind shows the server English as given, obs_040 api_012 every supporting check is written from its code, obs_040 api_012 the notes, the node states and roles, and the reasons a node is missing are in words, obs_040 api_012 a code the page does not know, and a sentence without its parameters, are the server English as given, obs_040 api_012 a percentile is an estimate, with no more digits than a bucket edge has, obs_040 api_012 the running guide and the page agree on every health reason: each code has a sentence and reads only the parameters of its row, obs_040 the table of the running guide is read as it is written (a changed table cannot make the guard vacuous), obs_040 api_012 the page, its files and the chart write no markup, run no text and build no address from data, obs_040 api_012 the chart follows a marker link only through the one rule for links, obs_045 opening asks once, and again every 30 s, not before, obs_045 a hidden tab asks for nothing, and showing it asks once, and not at all when the last start is under 30 s old, obs_045 a tab opened hidden asks when it is first shown, not before, obs_045 a tab flipped every 2 s for 2 minutes asks at most 5 times, obs_045 three failures, then a success: the gaps are 30, 30, 60 and 30 s, never sooner, obs_045 a request slower than the gap is never joined by a second, and the next starts a gap after the last START, obs_045 leaving the page leaves no timer and nothing starts again, obs_045 whatever the tab and the answers do, two starts of the timer are never less than 30 s apart, obs_045 twenty clicks across the four ranges in 2 s ask at most once for each range, obs_045 a click asks again for a range only after 10 s, and the 30 s restart from the click, obs_045 a click made while a request runs is asked for when that one ends: one waiting, the latest, never two at once, obs_045 a click on a range asked for within 10 s waits for nothing, and a click is dropped with the page or the tab, obs_045 a request that is never answered is given up at 30 s, as a failure, obs_045 clicking through the ranges for ten minutes never asks more than four times in any 10 s: 0.4 a second at the most, obs_045 a failed request is not asked for again by a click within 10 s, obs_045 the constants are the contract: 30 s, 60 s after three failures, 10 s for a range, obs_045 over five simulated minutes the page asks at most 11 times, each for exactly ?range=6h, obs_045 a hidden tab asks for nothing, and showing it asks once, not again until 30 s after, obs_045 twenty clicks across the four ranges in two seconds ask at most once for each range, obs_045 leaving the page ends the asking, obs_045 no request carries a cache header of its own, so the browser keeps the answer for the 10 s the server says, obs_045 a read that is never answered is given up at 30 s as a failure, and the page says it is stale after two, obs_045 a click made while a read runs is asked for as soon as that read ends, obs_045 clicking through the ranges for half a minute asks at most four times in any 10 s, obs_045 a 401 on a read ends the asking, and the page follows the sign-out of the app, obs_040 the page shows a healthy service: the verdict, five signals, the evidence, and no changes, obs_040 a degraded service says what is wrong, what cleared earlier, and the nodes in maintenance, obs_040 a severe service is red with the octagon, and a tile can differ from the banner in the server own way, obs_040 every state of a node is said as measured: not heard from is never down, a link problem is not a node problem, obs_040 a strip of states is drawn only for a node that has runs, with its words for a screen reader and a time axis, obs_040 a node whose history is missing, unavailable or older says why, in words, obs_040 one node: the chart is not split by node, the table has one row, and the cluster link stays, obs_040 with no answers recorded the charts give way to one notice, and the rest still shows, obs_040 with no answers and no reason for it, the notice says nothing is recorded yet, obs_040 a cold start: the page says since when, and the charts begin at the first bucket with data, obs_040 a bucket with no data is no data in the legend and the table, and a gap in the line, never 0, obs_040 at query-log privacy level 2 the clients tile says so, with no chart and no number, obs_040 when distinct clients are recorded the tile counts them, or more when a node is at its cap, and the chart appears, obs_040 a summary shows the verdict, the signals and the changes, and says the rest is not there, obs_040 api_012 a code the page does not know, and a reason without its parameters, show the server English as given, marked English, obs_040 two nodes with one name, and an upstream really named other beside the folded one, are all rows and no error, obs_040 more than four nodes: four coloured series and one grey, and the pods of a site in one, obs_040 a refusal on the first load says so over an unknown verdict, and the next ask is the 30 s one, obs_040 a refusal after a good load keeps the last answer, and says since when after two in a row, not before, obs_040 the range is in the address: six hours unless it says otherwise, and a click changes it, obs_040 the level is announced when it changes between two answers: three polls at one level say nothing, a change says it once, obs_040 every Look link is named by what it looks at, and the names of nodes and versions are not translated, obs_040 on a phone and in the dark nothing scrolls sideways, and the lesser charts are folded away until asked for, obs_040 the health icon opens the Service health page, and the page is neither on the wall nor in a display, obs_040 the page shows the real overview of a one-node server, obs_040 a server link to a page of the app is a link, with a plain query, obs_040 a server link that is not a page of the app is not a link, obs_040 the app registers the paths of its own table, and the wall and the display are not among them, obs_040 every place that follows a server link asks the one rule, obs_040 api_005 every chart colour of the Service health page is at least 3:1 against its card in the light theme, obs_040 api_005 every chart colour of the Service health page is at least 3:1 against its card in the system dark theme, obs_040 api_005 every chart colour of the Service health page is at least 3:1 against its card in the web UI dark theme, obs_040 api_005 the three places of the tokens agree with each other: the two dark ones are the same colours, obs_040 api_012 at desktop width a node row and an upstream row keep their column labels for a screen reader, obs_040 after two reads that failed the verdict says it was not refreshed, and not before, obs_040 a range that is not held yet keeps the verdict and the signals on screen, and loads only its evidence, obs_040 a read of a range that failed is said in its evidence, over the verdict that is still there, obs_040 the card of a signal that is not recorded is compact, and says so where the chart would be, obs_040 on a phone More charts says what is in it, has a chevron, and the tiles of its charts open it, obs_040 api_012 under the pseudo-locale at 1440 px no cell of a row, a check or a change lies over another, obs_040 api_012 a name with markup, 300 characters or a bidi control is text: no element, no script, no overflow, no reordering, obs_040 a tooltip over a bucket where no node has data says so, and has no total of nothing, obs_040 a series with a gap is drawn with a gap: no line over the buckets with no data, obs_040 a link in a change or a check is a link only when it is a page of the app, and the markers follow the same rule, obs_040 the health panel of the sidebar links only to pages of the app, api_012 pseudo locale leaves no literal text: service health.
REQ: OBS-040, OBS-041, OBS-042, OBS-043, OBS-044, OBS-045, OBS-015, OBS-016, CLU-002, CLU-004.
Requirements CLU-002 CLU-004 CLU-007 OBS-015 OBS-016 OBS-040 OBS-041 OBS-042 OBS-043 OBS-044 OBS-045
Builds on ADR-174
ADR-226 The running guide becomes a start page and topic pages; every old heading stays as a stub; docs pages have a size budgetDOC-006, DOC-005.
Context
DOC-006, DOC-005. docs/running.md is the one page that says how to run TelltaleDNS. It has grown to about 519 KB, past the 500 KiB at which GitHub documents truncating a rendered README, and most changes edit it, so branches that run in parallel meet in it often and a page that long is slow to open from a phone or a Pi (every "?" in the web UI and every guide's "Details" link opens it). About a hundred of its heading anchors are used from outside the page: the site, the README, the web UI's help, the chart's notes, unit files, and messages that released binaries print and other people's posts quote, none of which can be edited afterwards. GitHub can't send a link with a fragment to another file.
Decision
docs/running.mdstays at its path as the start page. The detail moves to topic pages underdocs/running/, one per topic of the site's guides (the pairing is in CONTRIBUTING.md). Topics move in steps:docs/running/topics.tomllists every planned page (file, title, one-line description, order, the H2 sections it takes by their exact text) and marks the ones that have moved.- Every heading of the old page stays in
running.mdas a stub: the same heading line (so the same level and anchor), then one line,Moved to [<page title>](running/<page>.md#<anchor>).. A heading of a moved section nested under another keeps its nesting. A link torunning.md#anchoranywhere, old or new, lands on the heading and is one click from the text. docs/running/legacy-anchors.txtis frozen: every heading anchor the start page has had. An anchor is never removed, and renaming a heading leaves a stub: for a heading of a moved page, an[[alias]]intopics.toml(the page, the old text and level, the new text) makes the tool write that stub after the page's current ones, and--checkverifies that the new heading exists on the page.python3 docs/index.py --freeze-anchorsadds new ones and never removes.python3 docs/index.pydoes the work and--check(CI, thesitejob) guards it: it takes the sections of a page markedmoved = trueout ofrunning.md, starts the page (its title, one sentence, a link back), and writes the stubs and a "Where to find things" list of the moved pages, each between marker comments.--checkfails when a generated part is out of date, whentopics.tomlnames a heading that doesn't exist or gives one heading to two pages, or when a frozen anchor doesn't resolve inrunning.md.- A move is byte for byte. Only the targets of links that now cross files change (a link to a heading that is elsewhere now names that page, a relative path gains
../), and a page's first lines are added.python3 docs/index.py --lossless <revision>compares with the page as it was. - A help topic's
docsis an anchor of the start page, orpage#anchor, an anchor ofdocs/running/<page>.md(monitoring#alerts). A topic of a moved section names the new page, so its "?" lands on the text, not on a stub. The web UI's link, the site's glossary and the docs check build the same link. - Docs pages have a size budget (DOC-005's rule for site pages, applied to
docs/**/*.md): a warning above 450,000 bytes and an error at 512,000 (the point at which GitHub documents truncating). The intention once the split is complete is 128 KiB a page; it is not enforced yet. - A change to a topic edits its page and, where one exists, the matching site guide (DOC-006). No new requirement.
Alternatives considered
- A contents list on top of the one page: GitHub's Outline already lists every heading, a list of two levels costs 2 KB and of three about 6 KB on a page already at its limit, and it doesn't shorten the page, speed its opening or reduce the conflicts. Kept only as the generated "Where to find things" list of the start page.
- The whole split in one change: the same end state, but every branch in flight meets it at once, and 100 or more links change together. Staged, each step can be checked and shipped alone, and the hottest topics go last.
- Leave it as it is and let the site be the reading path (ADR-122): the guides link back into this page for detail, so the page stays long and the "?" still opens all of it.
- Anchors without headings (
<a id>rows) instead of stubs: smaller, but a heading is guaranteed to have an anchor, shows in GitHub's Outline and keeps the page's own structure readable. - Moving by kind (tutorial, how-to, reference) instead of by topic: it means rewriting the text, not moving it.
Consequences
- Links keep working: through the stubs for every old heading, and straight to the text for the links in the repository, which the docs check keeps pointing at real headings (a moved section's links are rewritten and verified in the same change).
running.mdkeeps about a hundred bytes per heading of each moved section and a short list, and shrinks by the size of the text it gives up. A page that is edited in a branch conflicts only with edits to the same topic.- Messages that released binaries print, and that name
docs/running.mdand a section, still lead to the heading; new text names the page. - A branch that edits a moved section conflicts once in
running.mdand re-applies its lines on the new page (CONTRIBUTING.md gives the commands). The tool reports text left inside a stub, names the page it belongs on, and does not overwrite it. - A page's title must not repeat a heading inside it, or that heading's anchor would get a
-1.topics.tomlclaims whole H2 sections; a page that takes sub-sections of one (the planned router page) needs that added when it moves. - Python 3.11 or later runs
docs/index.py(it readstopics.toml), asspec/trace.pydoes.
Verification
site/test_docs_index.py, in the site CI job through python3 site/build.py --selftest: test_doc_006_a_a_page_marked_moved_gets_its_sections_unchanged (the sections as they were, apart from links that cross files), test_doc_006_a_links_that_cross_files_are_rewritten_and_nothing_else, test_doc_006_a_the_stub_keeps_the_heading_line_and_its_nesting, test_doc_006_a_a_move_changes_no_text_and_loses_no_heading, test_doc_006_a_clean_tree_passes_and_generation_is_idempotent, test_doc_006_c_a_stale_stub_is_found, test_doc_006_c_a_stale_contents_list_is_found, test_doc_006_c_a_heading_that_does_not_exist_is_found, test_doc_006_c_a_heading_on_two_pages_is_found, test_doc_006_c_a_legacy_anchor_that_stops_resolving_is_found, test_doc_006_c_freezing_adds_new_anchors_and_never_removes, test_doc_006_c_an_alias_keeps_the_old_anchor_of_a_renamed_heading, test_doc_006_c_an_alias_keeps_the_stub_region_of_a_renamed_section; and site/test_docs_links.py: test_doc_006_c_help_topic_with_a_page_and_an_anchor, test_doc_006_c_help_topic_whose_page_anchor_is_missing, test_doc_006_c_the_glossary_links_each_form_to_its_page, test_doc_006_b_references_to_a_topic_page_resolve_there.
REQ: DOC-006, DOC-005.
Requirements DOC-005 DOC-006
Builds on ADR-122
ADR-228 A node that has applied no version grants votes to the node it joined throughCLU-005, CLU-001; GitHub issue #144.
Context
CLU-005, CLU-001; GitHub issue #144. A primary in automatic failover publishes only while it holds a lease (ADR-056). A voter answers a vote request only for a candidate its member list names as an eligible node (ADR-143), and a node's member list (nodes.json) arrives in the first version it applies, which only a primary can publish. Joining stores no member list. So when fewer than a majority of voters (the primary counted) have applied a version at the moment the primary needs its lease, no one can vote and nothing can be published. Three ways in: (a) auto set before the others have joined and started (a scripted bring-up: init, set-failover auto, start, join, join); (b) the documented order (join, set-failover auto, restart the primary) when the primary restarts before the voters have started and applied a version; (c) voters that lost their data and joined again while the primary kept their old IDs as voters. DNS keeps answering on every node; configuration changes answer 503 until an operator runs set-failover manual.
Decision
- A node that joins records the node ID in the certificate of the node that answered the join, as
joined_viaincluster.json. The joining side reads it from the server certificate (JoinResponse.issuer, set bynet::joinafter the connection verified that certificate against the CA the token pins; it is never sent or read on the wire). The node that created the cluster, and a node that joined with a build from before this field, have none. - A node that votes (eligible, or a witness) and holds no
nodes.jsonanswers vote requests fromjoined_via, and from no other node (failover::may_ask_for_votes). The gate is the node's own settings: a node that is neither eligible nor a witness in them (a resolver pod joined withephemeral, a plain member) never takes it. A node configured eligible that joined with the bootstrap secret withoutephemeralis recorded by the primary as an ephemeral member that doesn't vote, and does take it; no candidate asks it, since a candidate asks the voters of its own list. Oncenodes.jsonexists, whatever it holds, or when it can't be looked at for a reason other than not being there, the member-list rule of ADR-143 alone decides, so a list that omits the node, or lists it as a plain member or a witness, refuses it. The member list is read first and the file's presence after it, so a file that appears between the two reads gives a refusal. - Everything after the check is unchanged: one vote per epoch, the ballot stored before the reply, the refusal while another node's lease runs. The check that refuses a candidate behind what the voter has applied compares with nothing for a voter that has applied no version, so the issuer is granted whatever version it has applied. The rule decides only who may ask. A node with no member list never stands for election (that needs three voters in the node's own list).
- The wire format,
PROTOCOLandSCHEMAdon't change. Nothing is on the DNS query path. - A voter that refuses a request with "only an eligible node can ask for votes" logs it, at most once a minute per asker, and the candidate logs once a minute that a voter refused it; both say why when the voter can. Before this, a refusal left no trace.
Alternatives considered
- Publish the first version without a lease. The lease gate would get an exception that rests on state (no
published.json, ballot epoch 0), and it doesn't help a primary restarted intoautobefore its voters applied a version, or voters that were rebuilt. - The member list in the join response. It changes the wire format, writes a partial
nodes.jsonat join (which ends ADR-205's "no member list yet" case for those nodes), and needs both ends to be new. - Refuse or warn on
set-failover autountil something is published. It fixes only the scripted order and breaks the scripts that use it; a note is a possible addition. - Serve the last published version on restart without a lease. New replication behaviour; it doesn't help the first publication.
- Hold joins until the first publication. It would block joins while a Git source has no first commit (ADR-049).
- Answer any asker while there is no member list (as ADR-205 does for who counts as primary). A resolver pod's certificate is available to anyone holding the bootstrap secret, and the vote it was granted would bind the voter for an epoch: the case ADR-143 closed. This rule names one node: the one whose certificate answered the join, a certificate the cluster CA signed and the pinned CA verified on that connection. The trust is the trust of the join path (the token and the pinned CA), and a member that relayed a join with its own certificate would be recorded the same way.
Consequences
- A freshly joined voter counts toward the primary's majority but not toward older members' (their lists don't name it yet). That is the same class as going from three voters to five before a version has propagated; the rule starts it at the node's first connection instead of after its first applied version. So voters are added one at a time, waiting until the Cluster page shows the new node synced before adding the next. Closing it for good takes joint membership changes, which this change doesn't do.
- A node that never applies a version keeps granting its issuer. It supports that node alone, where before it supported none; it costs nothing else.
- A node that joined through a node other than the primary helps that node only. That node (an eligible node, with a token made on it) also writes the new voter into its own
nodes.jsonas eligible or a witness when it answers the join (issue_join), while the primary hears of the joiner only from its Hello, as an ephemeral member that doesn't vote. A replica and two voters that joined through it can then be a majority of the replica's list that the primary's list doesn't know: the same disagreement as adding voters faster than a version spreads, started at the join. Voters are joined through the primary. A node that joined with an older build, and one upgraded before it applied anything, is not helped (it needs one version first). A running cluster (every node holdsnodes.json) never meets the rule. - Mixed versions: an older primary with new joiners works (only the joining side matters); a new primary with older joiners behaves as before. Rolling back is harmless: an older build ignores
joined_viaand drops it the next time it rewritescluster.json. - The issuer is as trustworthy as the join path (the token and the pinned CA) it answered on. The node ID in a certificate is the one the CA chose, written before any name the joiner asked for; a test covers that an advertised URL spelling another node's name can't change it.
- One optional field in
cluster.json; none appears in the file of a node without it.
Verification
clu_005_a_node_that_has_applied_no_version_grants_the_node_it_joined_through, clu_005_that_node_still_refuses_anyone_else, clu_005_the_node_it_joined_through_counts_only_while_the_node_has_no_registry, clu_005_the_rule_names_one_node_and_only_for_a_node_that_votes, clu_005_voters_that_joined_before_the_first_version_elect_the_primary, clu_005_the_same_when_the_primary_restarts_into_automatic_failover, clu_005_voters_that_joined_with_an_older_build_still_wait_for_a_version, clu_005_a_refusal_is_logged_once_a_minute_per_asker, clu_005_a_vote_answer_follows_the_clock_it_is_given, clu_005_a_member_list_file_of_any_kind_counts_as_a_member_list, clu_001_a_joined_node_keeps_the_id_of_the_node_whose_certificate_it_joined_through, clu_001_a_cluster_json_without_joined_via_loads, clu_001_the_join_response_carries_no_issuer_on_the_wire, clu_001_joined_via_survives_every_rewrite_of_cluster_json, clu_001_a_join_over_the_cluster_port_names_the_node_that_answered, clu_001_the_issuer_comes_from_the_certificate_and_not_from_the_answer, clu_001_a_join_request_cannot_choose_the_node_id_in_its_certificate; the real-process orders of deploy/cluster/failover-e2e.sh (joined-first in CI, nowait, wait).
Amends ADR-143; relates to ADR-056 and ADR-205. REQ: CLU-005, CLU-001.
Requirements CLU-001 CLU-005
ADR-229 A configured device is searched in the query log by its name, at every address it is looked up at; the devices of one read share one pass over the MAC tableGitHub issues #147 and #146 (follow-ups of #95).
Context
GitHub issues #147 and #146 (follow-ups of #95). The MCP tool get_client_profile searched the query log at the first address key of a device, so a device with several address keys showed only that address's queries; and no read gave a device's queries at all the addresses it has, because GET /api/v1/queries took an address or a Kubernetes workload alone. The lookups of ADR-211 made one pass over the MAC table for each MAC key of each device named only by its MAC, and the cluster's Clients page looked some of those devices up a second time by name.
Decision (proposed):
clientmay name a configured device. OnGET /api/v1/queries(and so the toolsearch_queries),clientis an address as before, else a Kubernetes workload as before (FLT-017), else the name of a configured device, in any case. The search is at every address the device is looked up at (api_backend::DeviceLookup): its single-address keys, each once, in the order of its keys, else, for a device named only by its MAC, the addresses where the MAC table recognizes it now (ADR-211: the same identification chain).clientNotworks as for an address. A device recognized by client ID (keyed: anid:key, no wide network, a name that can be keyed) is refused with 422client_id_device_unsupported, as before: the route's check runs before the backend, so a name with an ID key never reaches the search.- The bound is 64 addresses, the number a workload's addresses are cut to. The configuration does not limit a device's keys, so without it a device with thousands of keys would make the search filter as long. A device with more is searched at its first 64 (the order above) and the page says so in
clientTruncated, which now covers a device as well as a workload. - Privacy level 2 and above (which hide clients): every device's name is a 422
privacy_level, whatever the device is named by (address keys, a MAC, a network, an ID: for a keyed ID device it is told before the refusal for the ID, as for a device's day). A page with no rows would read as "no queries". An address is searched at every level, as before. - A device with no address to search at (a network alone, an
id:key with a wide network, or a MAC the node's table gives no address) is a 404 that says so and shows no address; the words are the same for every way a device is named. It is raised by the route, not by a node: a node that has no address answers an empty page flaggedclientUnresolved(the kernel's MAC entries are per network segment, so another node of the cluster may see the device), the flags of the nodes that answered are merged with AND, and the route answers 404 only when every node that answered had none and no node is missing (with a node missing it is the empty page, flagged, so it is not taken for an answer). A node is never listed as missing because it does not see a MAC. - Groups: with
group(the restriction of a group-restricted token, or any caller's own), a device is found by its name only if it is in that group, by the ruleGET /api/v1/clientsnarrows a restricted token's list by (its own groups, the groups that apply to it, or, for a device whose group depends on the site of the node that answers (ADR-220), the groups every site gives it): one predicate,ClientInfo::in_group, which ADR-231 uses too. Any other name is refused as a name nobody has (the same 400, the same headers and words), so a token learns of no device outside its group; at privacy level 2 and above too. The rows are the group's alone, as for an address. - The profile tool passes the device's name as
clientfor any configured device, so its recent and slow queries cover every address; it also gives a device named only by its MAC its queries (it had "no IP address known"). A device whose name reads as an address keeps the first of its address keys, as before. An address given asclientstays that address. - One pass per read:
MacTable::addresses_of_macsgives the addresses of many MACs in one pass over the table, and a read that looks several devices up (the devices list,Backend::clients_and_lookups) takes the state and the table once, and only when some device is named by its MAC alone. A read of one device (identity, rhythm, the query search) is one pass for all of that device's MACs. The query path is untouched. The pass is not cached between reads. The sources' text is checked so that no other code reads the table for one MAC. - In a cluster: the cluster's Clients page takes the addresses each device was looked up at from the same read of the devices and no longer asks the local backend for each device's identity by name; a backend that does not say (the default of the new trait method) is asked as before.
Federatedimplementsclients_and_lookupsas its ownclients, so the trait's default never answers a cluster read, and the guard over federating calls (derived from whatFederatedimplements) sees a call of it that is not behindblocking. Each node resolves a device's name for itself, with its own MAC table. A node of an earlier version refuses a device's name asclientas any non-address, so its rows are listed inmissingNodesuntil it is upgraded. - Not changed: the live stream and
device_timelinestill take an address; a device seen at its second address when another node has the better identity there is not looked up at it (the page uses the first looked-up address, as before).
REQ: OBS-003, OBS-025, FLT-006, AGT-004, AGT-005, CLU-002, CLU-004. Implemented in api_backend::{DeviceLookup, device_search, device_filter}, telltale_policy::MacTable::addresses_of_macs, telltale_api::Backend::clients_and_lookups, the queries route (404, privacy level, the merge of the flag in federation::merge_queries), federated::Federated::{clients, clients_and_lookups}, the profile tool in mcp.rs, and the descriptions of client, clientTruncated and clientUnresolved.
Alternatives rejected
- One search for each address and a merge of the pages in the tool: up to 64 searches for each of two lists, a merge that cannot page, and no help to anyone calling the route.
- A new parameter (
device=): an older node would ignore it and answer every row; the name inclientis refused by an older node, which a cluster page then lists as missing. - The 404 raised by each node: on a cluster with several network segments every node that does not see the MAC would be listed as missing.
- Searching the whole network of a device's CIDR key: the query log's index takes single addresses; a device's networks and MACs are not enumerated, as in ADR-211.
- Caching the MAC-to-addresses index between reads: it holds memory the reads do not need between them, and the table is replaced on every refresh.
Consequences
- A device's recent and slow queries in its profile, and a search by its name, cover every address key it has (up to 64).
- A device named by its MAC alone is searched where it is now; queries it made from an earlier address are found by that address.
- The devices list makes one pass over the MAC table however many devices are named by a MAC alone (it made one per MAC key of each), and the cluster's page no second.
- Nodes with different privacy levels: a node at level 2 or above refuses a device's name, so it is listed as missing from a cluster search for it while the others answer.
- Nothing changes on the DNS path.
Verification
obs_003_a_named_device_is_searched_at_every_one_of_its_address_keys, obs_003_get_client_profile_shows_the_queries_of_every_address_key, obs_003_a_device_with_many_address_keys_is_searched_at_the_first_64, flt_006_a_device_named_only_by_its_mac_is_searched_where_its_mac_is_seen, obs_003_privacy_level_two_refuses_every_device_name, obs_003_the_404_says_nothing_about_how_the_device_is_named, obs_003_a_device_named_like_an_address_is_profiled_at_its_keys, agt_004_a_restricted_token_finds_only_its_groups_devices_by_name, agt_004_a_device_in_a_group_by_its_network_is_found_by_that_groups_token, agt_004_search_queries_by_name_for_a_restricted_token, flt_006_a_devices_read_makes_one_pass_over_the_mac_table, flt_006_the_mac_table_is_read_in_one_place_and_in_one_pass, clu_002_the_cluster_clients_page_looks_each_mac_only_device_up_once, obs_003_a_node_that_does_not_see_the_mac_is_not_missing_from_a_name_search, clu_002_the_federated_clients_page_looks_a_mac_only_device_up_by_name, clu_004_a_bare_call_of_the_devices_read_with_its_lookups_is_flagged (telltale); obs_003_a_name_search_no_node_could_resolve_is_a_404, obs_003_the_queries_route_documents_its_404, obs_003_the_unresolved_flag_merges_with_and (telltale-api); flt_006_addresses_of_macs_agrees_with_addresses_of (telltale-policy).
REQ: FLT-005, FLT-006, FLT-013, FLT-017, CLU-002, CLU-003, CLU-009, CLU-010, OBS-024, AGT-004, API-010.
Requirements AGT-004 AGT-005 API-010 CLU-002 CLU-003 CLU-004 CLU-009 CLU-010 FLT-005 FLT-006 FLT-013 FLT-017 OBS-003 OBS-024 OBS-025
Builds on ADR-211 ADR-220 ADR-231
Referenced by ADR-231
ADR-230 The DNSSEC validator asks the questions of one validation that don't depend on each other's answers together, within boundsGitHub issues #112 (airart320) and #120 (cbernha986, rough-ton): a cold lookup with full recursion and validate takes longer than the client's wait.
Context
GitHub issues #112 (airart320) and #120 (cbernha986, rough-ton): a cold lookup with full recursion and validate takes longer than the client's wait. The reporter's timeline of one name is 13 questions one after another (7 after ADR-217), most of them NS questions at the names of a CNAME chain in an unsigned zone, each a round trip of its own to that zone's servers. The validation library asks them one after another: it walks the record sets of a section in a loop that waits for each (verify_rrsets), looks for each unsigned name's zone cut with an NS question at the name and at each ancestor (find_ds_records), and asks a key's DS after its DNSKEY. The offline timing bench agrees: a cold validation takes N × (hop + about 1.4 ms) for N questions. ADR-216 counts the questions; ADR-217 keeps and shares them; neither asks any of them earlier. Every question passes GroupHandle::ask and the question cache, so a question already in flight is waited for, which makes asking ahead possible without changing the library.
Decision
- When. After the validation's own question has been answered (never beside it: the member that answered it is the one the validation names, ADR-201, ADR-202), the validation makes a plan: from the answer's bytes it works out the questions the library will ask next, claims their slots in the question cache, and asks them together. The library's own asks then find them in flight or answered (
WaitorHit). The first window is claimed before the answer goes on to the library, which asks without yielding; later keys are claimed one at a time as a question ends, and a key the plan hasn't claimed is led by the library itself. - What, exactly. Questions the library asks and nothing it doesn't, for the validation's own answer only:
- the NS questions of the library's search for the zone cut of each record set that has no signature in its own section and isn't a DS or DNSKEY set: at its owner (an NSEC3 set's parent; for a DS question, the question's parent when the set is at or below it), then at each ancestor with at least two labels; the sets in the library's order (answer, authority, additional, by first appearance);
- the same search from the question's name (its parent for a DS question), when every authority set is unsigned and none a DS (the library does it when they are all insecure);
- last, the SOA question the unsigned-zone proof starts with (ADR-203), for an answer without answer records whose closest SOA at or above the name, of two labels or more, is unsigned, and only while that proof has more than half of its slots free;
- a zone's DS, claimed when the validation leads the zone's DNSKEY question: the library asks it right after the keys unless the zone is the root or owns a trust anchor of the validator's. Never the validation's own question, a link's question (ADR-188), a DNSKEY, a zone cut's DS (the library asks it at the same instant as the NS answer that finds the cut, which saves nothing), or a key the question cache already holds.
- Bounds. At most 8 of one validation's questions in flight, 16 keys claimed per validation, and 32 in flight for a validator (a node): a permit of the pool is taken before a key is claimed, and none free means today's order. Nothing starts with less than 100 ms of the validation's deadline left, and each question gets what the deadline leaves, at most the handle's budget. The bounds count questions, not packets: a question to a recursive upstream is up to 11 queries with query-name minimisation (a name that many labels below its zone's apex), but the in-process recursor's own cap is 96 queries a question (
MAX_QUERIES), which a hostile chain of referrals can reach, and a group that hedges can send a question twice, so a validation can send up to 16 × 96 queries (twice that with a retry's plan), at most 8 questions at once. The pool bounds how many questions are out, not how many start per second: a question that ends frees its permit at once, so what a node sends is its clients' rate of cold queries times up to 16 questions. The plan's questions sit outside the pipeline'smax_inflightand outside the slots of the unsigned-zone proof: the pool is their only limit. - The library checks everything as before. The plan changes when a response is fetched, never whether it is trusted: every response goes through the library when it consumes it, with its own clock. For an upstream whose answers depend only on the question (deterministic answers and deterministic failures), the library sees for each question it asks the bytes of one group answer to that question, with the plan on or off, so no verdict, EDE code, AD bit, proof or retry (ADR-201) changes: the offline suite pins it on all 30 shapes and on faults at every position. Where an upstream's answers depend on time, load or loss, the two runs can differ (next paragraphs). ADR-217's cache keys, bounds and TTL rules are untouched.
- Leftover questions. Questions the plan asked that the library didn't need end within their budgets, detached from the validation. A doubt flag in the plan, set under the plan's lock when the validation ends, decides what happens to a question still out: after a verdict (secure or insecure) its answer is kept like any other; after a bogus, indeterminate or missing one it is dropped, and the waiters ask for themselves. A validation that ends in doubt also drops every answer its plan kept, used or not (ADR-217's drop on doubt). A validation dropped before it ended (its future cancelled, as when a client gives up) counts as in doubt: the questions out are dropped when they answer, none starts, and what its plan kept is dropped from the question cache, as after a bogus verdict (a synchronous call under the cache's lock, which no code that drops a validation holds). The lock order is the plan's, then the cache's.
- An answer the cache doesn't keep. A plan question's answer that the question cache won't keep (an empty NOERROR, as some servers give to an NS question at a name that isn't a zone cut, a TTL of 0, an expired signature, one over 4 KiB) is passed to a library ask that is waiting for it; when none is, the plan holds it for the validation's first later ask of the same key and then drops it. The plan holds at most 4 KiB for an answer and 16 KiB in all (an answer over TCP, TLS or HTTPS can be 64 KiB); one it can't hold is dropped, and the library asks for itself. Without that the library, which asks later than the plan's question is answered, would ask it again, and the plan would have asked one question more than the library alone. Nothing else reads it, and it isn't kept in the cache.
- A failed question of the plan. A library ask that waited for the plan's own question, which failed (a timeout or a transport error), fails at once, as its own question would have after the same budget, instead of asking again with a whole budget as ADR-217's waiter does: that second wait would outlast the lookup's share of the validation's deadline and lose the bogus verdict that another member's validation (ADR-201) could correct. The rule holds only when the leader the ask waited for is the plan's own question for that key (the cache tells a waiter its leader's id); a waiter of another validation's question, or of another asking of the key, keeps ADR-217's rule. A question that came back SERVFAIL, REFUSED or truncated isn't a failure here: nothing keeps it and nobody is told it failed, so the library asks it again, a second sample where a failed one fails the waiting ask at once.
- The member's health. The plan's questions are the member's questions too, and what they come to is told to its health tracker, except that their failures don't count against it: they are counted (requests, failures and their kind,
telltale_upstream_failures_total) but enter neither the rolling window, nor the consecutive failures that open a breaker, nor the latency average, and they free a half-open probe they held. A failure does one thing a real one does: for 10 s, or until the member answers, the next attempt on it hands over to the next member at once instead of waiting for its hedge delay (Health::hedges_now; a hint for the order of attempts only). The hint is set when the question's group call returns, not when the attempt's own timeout fires, and a library ask that waits for its own plan's question waits 50 ms longer than its budget, so that the question's end (and the hint) come first even when a busy runtime fires the two timers in the other order: a run of seed 143 at the tests' constants ended bogus in two of three tries without it (a library ask gave up 0.6 ms before the plan's attempt recorded its timeout, and the unsigned-zone proof that followed asked the first member alone). Without it, a member that doesn't answer a question the plan asked ahead would be asked again by the library with no hedge, and a validation that today ends secure through the second member (the library's first failed ask marks the first one) could end bogus: the generated faults found it. A plan asks up to 8 questions at once, and 8 timeouts at once would open a breaker that 3 real ones open, for 10 s and longer. ADR-232's rules for what is evidence hold for the plan's questions too: a SERVFAIL or REFUSED that one of them got is an answer (it explains a timeout of a question that was out meanwhile, as any answer does), and a failed one frees the half-open probe a query held but never the one an active check holds (that check's outcome alone settles it). - What differs. For an upstream that isn't a function of the question, the plan changes what the validation sees in five ways. (1) A transient fault that meets the plan's question in place of the library's ask: a SERVFAIL or a loss is a second sample for the library's later ask (an error leader fails the waiting ask at once, a SERVFAIL leader is asked again), so the plan can end better than today's walk. (2) Two sequential failures that would outlast the lookup's share of the deadline (3 s) and end without a verdict end, with the failed leader failing at once, bogus: the stricter direction. (3) A burst of up to 8 questions at one upstream (one UDP socket pair, one DoT connection, a forwarder's per-client limit) can lose more of them than a sequential walk would. (4) Timing: answers arrive earlier and are used up to about 3 s later, so a TTL is lowered by the longer age. (5) Which member answers which question. The plan's concurrent questions are asked before any of them has failed, so they go to the first member alone; the sequential walk, after its first failure, asks both members for what follows (a failed attempt marks its member and the next attempt on it hands over at once) and takes the first answer. With members that fail (no answer, SERVFAIL, truncated) and a second member that is up, the two come to the same verdict wherever a question that gets no answer is handed over to the next member inside the query budget, which the defaults give (budget 2 s, attempt timeout 400 ms): the 1,000 seeds of the generator, run at half of the defaults (budget 1 s, attempt timeout 200 ms: their ratio), do not differ in one. At the tests' own constants (a budget of 200 ms against attempts of 400 ms, which no deployment has) a question without an answer uses the whole lookup share, in either order, and runs can differ for that reason (seeds 143 and 986: two questions dropped or held at the first member; at the defaults' ratios they agree, and at 5 and 10 times the tests' constants the plan is as good as the walk or better). A deployment that sets an attempt timeout as long as its query budget is in that regime. With a member that answers wrongly (a lie, a forgery) while another is up, the verdict depends on which member's answer each question gets, and that is decided at the moment of asking (seed 691: the own question truncated at the first of two members, its DNSKEY dropped and the DS of
t.answered "no such record": the walk asked the DS oft.of both members after the DNSKEY timed out and the honest member answered first, secure; the plan had asked it of the first member alone, 200 ms before that member's DNSKEY timed out (an answer of the member had cleared the mark of its first failure), and used the lie, bogus; ADR-201's retry then left out the member that answered the validation's own question, the honest one). The generator's second-member runs use failure faults only. The offline suite runs faults that come once and twice, at every position of two rows, with one member and two, and 1,000 seeds of a generator (..._a_fault_that_comes_once_is_never_worse_with_the_plan,..._two_failures_at_one_member_leave_the_verdict_class). - Reload. A reload builds a new validator with its own pool; questions of the old one run to their end (up to 32 more at once on the node for a moment).
- Configuration.
[dnssec] prefetch, on by default. A reload applies it to the validations that start after it; no cache is flushed (the same answers are cached, only when their questions are asked changes). It is not written while it is on (the cluster shares[dnssec], and an older node refuses an unknown key there, as ADR-187): set it tofalseonly once every node runs a build that knows it. - Counted in
telltale_dnssec_prefetch_total{type="ns|ds|soa",result="asked|used|skipped|late"},telltale_dnssec_prefetch_plans_totalandtelltale_dnssec_prefetch_in_flight; ADR-216'stelltale_dnssec_questions_totalkeeps counting every question sent (a plan's included), andtelltale_dnssec_question_seconds_totalcan add up to more than the wall time. The debug lineDNSSEC: questionsgainsprefetch asked/used/skipped.
What it doesn't change: cache hits (a hit never reaches the validator: no plan, no counter, no allocation); verdict logic, the proofs, link-by-link validation (its questions stay one after another), a bogus answer's second validation (it makes a plan of its own through the other members), the question cache's keys and bounds, EDE and AD.
Consequences
- A first lookup whose questions don't depend on each other takes one round trip for them where it took one for each: the question budget's rows are unchanged where the plan's guess is exact (all 30 of them: every key the plan asks is a key the library asks, in order), and the longest chain of dependent questions of
secure-coldis 4 where it was 6,insecure-cold5 where 8,nx-v.t-depth-103 where 14 andcname-three-in-unsigned3 where 7 (the offline bench's depth column); the rows of link-by-link validation get shorter by the keys their links need, not by the links, which stay one after another. Where the guess is wrong the question count rises by the waste, counted asaskedminusused. - Cost on a validation that plans: one scan of the answer (two vectors of up to 64 entries, about 1 KiB each, allocated for any answer that has records, whether anything is claimed or not), and for a plan that claims anything one
Arc<Plan>and one coordinator task, plus one task for each zone's DS claimed beside its DNSKEY. A claimed key holds about 1 KiB while its plan lives (a name of 256 bytes inline in the key, the candidate, the cache's leader, the claimed, kept and failed lists each hold one or two copies), 16 keys at most, and the stash up to 16 KiB; up to 32 non-evictableAskingentries in the question cache node-wide. Nothing on the cache-hit path. - Amplification: a burst of cold names puts at most 32 more questions in flight on a node, and more packets behind them for a recursive upstream (above). The worst case in questions is a shape where the library stops early: it ends its search for a zone cut at the first ancestor that has NS records and at the first failed question, while the plan asked the owner and every ancestor of two labels or more at once; a deep unsigned owner in a zone an attacker serves, whose NS questions fail at the owner, makes the library ask 1 question and the plan up to 16, 16 times the questions of a cold query (a cached answer costs none). Third-party names reached through a CNAME chain are walked by the library as well, so toward third parties the plan adds no more than the library's own walk, but for the ancestors above a real cut (16 at most).
- A validator that runs out of pool, time or keys asks as before.
- Mixed-version cluster: a node that doesn't know the key refuses a shared
[dnssec]that carries it, which is why it is never written while on. - The prediction copies three rules of the library (the unsigned owner's search, the DS-question special case, the all-insecure authority walk); a bump of the library is checked against the question budget's corpus (
dns_011_offline_prefetch_predicts_the_librarys_walk).
Alternatives considered
patching the validation library to ask concurrently (a maintenance burden: a patched copy of a security-critical dependency); our own validator; DS records kept from referrals in the recursor (the recursor sees them and drops them; it would remove the DS questions of recursive:// upstreams only, and is a larger change); raising the client's wait (ADR-202); warming the root's and the top-level domains' keys at start. Not done, for a later decision on measurements: asking the signer chain's keys above a zone together by name, asking the unsigned-zone proof's levels together, and the CNAME links of link-by-link validation.
Verification
offline (tests/dnssec_offline/prefetch.rs): dns_011_offline_prefetch_claims_a_key_before_the_library_asks_it (the synchronous claim), ..._asks_a_planned_key_once, ..._starts_nothing_when_nothing_is_claimed, ..._falls_back_when_the_pool_is_full, ..._holds_at_most_a_window, ..._plans_at_most_16_keys, ..._never_claims_the_validations_own_question, ..._the_member_that_answered_is_the_questions, ..._a_retry_asks_only_the_other_members, ..._a_late_answer_is_kept_only_after_a_verdict, ..._an_answer_the_cache_does_not_keep_is_used_by_its_validation, ..._off_is_todays_behaviour, ..._a_plan_leader_held_past_the_budget_leaves_the_verdict_class and ..._a_ds_held_past_the_budget_leaves_the_verdict_class (the failure corner), the planner's rules (dns_011_offline_prefetch_plan_*: the unsigned owner's walk, the library's order, an NSEC3 set's parent and one-label names, the DS question's parent, the insecure denial's walk, the proof's SOA hint and its gate, the own question and bad answers), dns_011_offline_prefetch_matches_the_sequential_walk_on_every_shape (all 30 shapes with the plan on and off: the same verdict, EDE, response code, member, AD bit and record sets, and the budget's questions), ..._predicts_the_librarys_walk (no waste on the corpus), ..._faults_at_every_position_leave_the_verdict_class (a hold, SERVFAIL, a drop, a lie, a truncation and a forgery at each position), ..._a_fault_that_comes_once_is_never_worse_with_the_plan, ..._two_failures_at_one_member_leave_the_verdict_class and ..._generated_faults_leave_the_verdict_class (40 seeds, 1,000 with --ignored), the member's health (dns_011_offline_prefetch_questions_asked_ahead_that_time_out_leave_the_breaker_closed, dns_011_offline_real_questions_that_time_out_still_open_the_breaker, ups_006_failures_of_questions_asked_ahead_do_not_open_the_breaker), cancellation and two validations (..._a_cancelled_validation_drops_what_its_plan_kept, ..._a_cancelled_validation_leaves_nothing_in_flight, ..._a_leader_of_a_validation_that_ended_in_doubt_is_asked_again, ..._two_plans_share_the_pool_and_the_second_goes_sequentially), the stash and the leader's identity (dns_011_a_plan_does_not_hold_an_answer_over_4_kib, dns_011_a_plan_holds_16_kib_of_answers_at_most, dns_011_a_wait_for_another_leader_of_a_planned_key_is_not_given_up), the planner on hostile wire (nfr_004_the_planner_*, and the nightly fuzz target prefetch_plan), ..._packets_on_the_recursive_path_are_bounded, ..._depth_of_each_shape, ..._a_zones_ds_is_asked_beside_its_dnskey, ..._asks_no_ds_for_the_root_an_anchor_or_its_own_question; the harness's own tests (dns_011_offline_fake_server_answers_held_questions_together, dns_011_offline_bench_*); unit: dns_011_a_plan_claims_nothing_with_less_than_100_ms_left, dns_011_a_ninth_question_of_one_plan_finds_the_window_full, dns_011_a_plan_claims_16_keys_at_most, dns_011_the_pool_of_a_validator_bounds_all_its_plans, dns_011_a_plan_that_ended_claims_nothing; the whole offline binary also runs with TELLTALE_TEST_DNSSEC_PREFETCH=0; config and pipeline: clu_010_dnssec_prefetch_left_out_of_the_shared_part_at_its_default, dns_011_a_reload_sets_the_prefetch_of_the_new_validator, dns_009_the_cache_fingerprint_covers_the_dnssec_setting (extended), nfr_002_pipeline_hot_paths_do_not_allocate_with_dnssec_validation_and_prefetch_on, obs_001_metrics_show_dnssec_prefetch_families; make bench-smoke and make bench-dnssec (DNSSEC_BENCH_HOPS_MS, DNSSEC_BENCH_HOP_ZONES=v.t=300,t=12,.=12, DNSSEC_BENCH_DROP_PCT, DNSSEC_BENCH_BURST) against the base with a same-binary control.
Measured
On the offline DNSSEC timing harness (make bench-dnssec, rotated against the base binary and a same-binary control), prefetch cuts cold validations in line with the reduced dependency depth: on the 300/12 ms multi-zone CNAME chain (cname-three-in-unsigned), median validation time drops from 1,823 ms to 617 ms (0.339×), and every firm row at 5 ms and 20 ms hops reaches 98% to 100% of its modelled saving with zero wasted questions (asked - used = 0.0%). At 0 ms hops, median B/A over all 30 rows is 0.967; on a warm zone with no round trip to save, planning adds a fixed cost of about 20 to 30 µs per validation (insecure-zone-warm 203 to 236 µs, secure-zone-warm 148 to 166 µs at 0 ms hops; at 5 ms and 20 ms hops both rows stay within 0.2%). With prefetch = false, validation latency matches the base binary across all rows (23,893 µs vs 23,893 µs overall median; 1,823 ms vs 1,823 ms on the 300/12 ms row).
REQ: DNS-011, NFR-001, NFR-004, OBS-001, UPS-006, DNS-012.
Requirements DNS-011 DNS-012 NFR-001 NFR-004 OBS-001 UPS-006
Builds on ADR-187 ADR-188 ADR-201 ADR-202 ADR-203 ADR-216 ADR-217 ADR-232
No decision matches. Try fewer words, or another status or area.