For the technical audience
Decisions ADR-211 to ADR-220
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-211 A device named only by its MAC is looked up at the addresses the MAC table recognizes it at now: its identity and rhythm by name, and its guess on the Clients pageGitHub issue #95.
Context
GitHub issue #95. ADR-183's "Not covered" left out the Clients page's guess of what a device is and the identity and rhythm reads by name for a device named only by its MAC: those views look a named device up at its address keys, and such a device has none. So its Devices row showed no guess, its identity by name was not_seen with the name as client, and its rhythm by name was a 404 ("has no single address"), while the query path, the top lists and a [[client]] kind already follow the MAC.
Decision (proposed):
- Where a named device is looked up for these three views (
api_backend::device_lookup_addresses): a device with single-address keys at those keys alone, exactly as before (it keeps its address first even where its MAC is recognized at another address). A device with none (named only by its MAC: no single-address key, though it may also have networks or client IDs) at the addresses where the MAC table (the kernel's entries, then the router bindings this node and the members vouch for, ADR-183) holds one of its MAC keys now, and only where the identification chain (ClientTable::identify, as a query from that address would be identified) gives this very device. So every withholding rule of ADR-183 holds: anunsurelease, a shared MAC, a member's tombstone, a router's MAC withrouter_macsoff (even in a table built before the setting changed), or no binding gives no address, and today's answers (not_seen; a 404 whose hint says the device isn't recognized at any address now). MAC keys are read withMatchKey::parse, as identification reads them; an all-zero or multicast MAC key gives nothing. - Privacy levels: at query-log privacy level 2 and above, which hide clients, a device named only by its MAC is not looked up by its MAC: the address it has now is what that level hides (as
recognitionis left out there, ADR-102). Its identity by name is thennot_seenwith the name, and its rhythm by name a 404, as before; a device with an address key keeps its answer at every level. - The order:
MacTable::addresses_oflists the table's addresses for a MAC, IPv4 first and in address order, so one table gives one answer. The identity by name prefers an address the identifier has seen, as before; the rhythm and the Clients page take the first (behind a MAC-translating extender the kernel holds one MAC at several addresses: the first is used, as identification accepts each). - In a cluster: the Clients page takes every node's identity at the address the row's own identity names, else at the one the entry node resolves for the device by name (the local identity by name, whose
clientis that address); the federated identity and rhythm reads already ask the other nodes by the address the entry node resolved, so no new read kind and no wire change. The federated identity merges only the other nodes' answers for that key: when the entry node resolves the device to no address (its key is the name), an answer another node gives at an address of its own is not merged, and the read is the entry node'snot_seen. A device with an address key is looked up by its keys alone, as before. - No MAC in any output: the views name the address, which the top lists already pair with the device's name.
- Change simulations, rule-impact estimates and anomaly mutes stay as ADR-183 says (they need a historic or stable address).
REQ: FLT-006, OBS-025, OBS-031, CLU-002. Implemented in telltale_policy::MacTable::addresses_of, api_backend::device_lookup_addresses (clients, identity_of, client_rhythm), federated::merged_identity, the identity and rhythm routes' descriptions, and the naming dialog's sentence on what a MAC alone leaves out.
Alternatives rejected
- The live table for every view, simulations included: a simulation replays past hours, and today's binding names the wrong device for them.
- Looking a device with an address key up at its MAC's address too: it would change those devices' answers (a seen MAC address over an unseen address key); they keep their keys.
- Trusting the table without the identification chain: a table built before a reload can hold entries the policy no longer accepts (
router_macsoff).
Consequences
- A device named only by its MAC gets its guess, identity and rhythm wherever it is recognized now; a device that moves is looked up at its new address once the router's next read reaches the node.
- Group-restricted agents: their
/api/v1/clients(narrowed to their group) now carries the identity of their group's MAC-only devices, with the current address. They already read that group's query log and top lists, which pair the address with the name. - One pass over the MAC table per MAC key per read, off the query path; nothing changes on the DNS path or on the wire, and an older node answers these reads as before.
Verification
flt_006_addresses_of_lists_every_source (telltale-policy), flt_006_identity_by_name_follows_a_mac_only_device, flt_006_rhythm_by_name_follows_a_mac_only_device, obs_025_the_clients_page_shows_the_guess_for_a_mac_only_device, flt_006_a_withheld_mac_gives_no_address_by_name, flt_006_a_device_with_an_ip_key_keeps_its_ip_first, flt_006_identity_by_name_keeps_a_mac_only_device_hidden_at_privacy_level_2, clu_002_the_federated_clients_page_keeps_a_mac_only_identity, clu_002_the_federated_clients_page_looks_a_mac_only_device_up_by_name, clu_002_identity_by_name_keeps_the_entry_nodes_key; the Playwright check of the naming dialog's sentence (api_010 name this device offers its MAC address when the router knows it); make bench-smoke with flt_006_identify_mac and flt_006_identify_router_mac unchanged.
Requirements CLU-002 FLT-006 OBS-025 OBS-031
ADR-212 The DoH and cluster listeners set their HTTP/2 limits explicitlyThe DoH listener (DNS-003) serves HTTP/2 with hyper and set only a timer and a keep-alive, so each of its other HTTP/2 limits was a default of hyper or h2.
Context
The DoH listener (DNS-003) serves HTTP/2 with hyper and set only a timer and a keep-alive, so each of its other HTTP/2 limits was a default of hyper or h2. Those defaults aren't part of either library's stability promise (hyper's documentation says so for the stream limit), and an update can change them: h2 0.4.21 changes some of its reset-stream defaults. A listener's limits should be the project's choice, written next to the listener, and change only when we change them.
Decision
- The DoH listener sets the limits in the table below, as named constants next to the builder (
crates/telltale-net/src/doh.rs), each at the value it had before (the defaults of hyper 1.12.0 and h2 0.4.20), so no client sees a change. - The cluster listener (CLU-001) sets the two reset limits the same way, at the same values (20 and 1,024), on every connection. Its other HTTP/2 limits are set per kind of connection: a member's connection keeps the values it had (hyper's: 200 streams, 1 MiB windows, 16 KiB header lists, a 400 KiB send buffer), written out the same way; a peer uses one long-lived stream, and a fetch at most 8 requests at a time on a connection of its own. A connection without a member certificate (a node joining or asking for the CA) gets tighter ones (
docs/running.md, Clusters). - These values stay with the library, and each is bounded per connection:
- the HPACK table size: the protocol's 4,096 bytes, not advertised (hyper offers a setter; it is left alone);
- how many streams the listener reset itself a connection remembers, and for how long: h2 0.4.20 keeps 50 for 1 s, h2 0.4.21 keeps twice the stream limit below (400) for 5 s; hyper's server builder has no setter for either;
- empty DATA frames: 100 per connection, and since h2 0.4.21 one more per stream, given back by any DATA frame that carries data; hyper's server builder has no setter.
- No configuration keys: no operator has needed one, and constants keep the surface small.
| Limit | Value | Why |
|---|---|---|
| Streams open at once on one connection | 200 | a proxy multiplexes its clients' queries; 200 in flight on one connection keep working |
| Streams the client opened and reset that wait at once to be taken up | 20 | a 21st closes the connection; the count drops as the listener takes them up |
| Requests the listener refuses or resets in one connection's life: malformed ones, and ones over the stream limit (a 431 for headers over the header list isn't counted) | 1,024 | the 1,025th closes the connection |
| Header list | 16 KiB | a GET's ?dns= query is a few hundred bytes |
| Frame size | 16 KiB | the protocol's minimum; a POST of up to 64 KiB comes in several frames |
| Stream and connection windows | 1 MiB each | request body read ahead of the listener |
| Send buffer per stream | 400 KiB | an answer is at most 64 KiB |
Alternatives considered
- Leave the defaults, and read each hyper and h2 release's notes. A default can move in a patch release, and nothing would fail. Not chosen.
- Lower values than before. Not chosen here: no client should see a change. A later decision can lower one with a measurement.
Consequences
- A hyper or h2 update can't move these limits. A test fails if one of the advertised limits or reset limits moves; the send buffer has no test.
- Nothing a client sees changes (except on the cluster listener's connections without a member certificate, which get tighter limits: see ADR-221), and nothing on the query path changes: the builder is set up once per connection, as before.
Verification
in crates/telltale-net/tests/doh_h2_limits.rs, a client that writes HTTP/2 frames by hand: dns_003_h2_settings_advertise_the_listeners_own_limits (the stream limit, windows, frame and header list sizes as the listener advertises them), dns_003_h2_resets_past_the_bound_close_only_that_connection (20 streams opened and reset at once keep the connection, 21 close it with ENHANCE_YOUR_CALM, another connection is answered), dns_003_h2_protocol_error_resets_past_the_bound_close_the_connection (1,024 malformed requests are reset and the connection stays, the next closes it); and dns_003_h2_a_burst_of_200_streams_on_one_connection_is_answered (200 queries in flight at once on one connection, all answered); in crates/telltale-cluster/src/net_tests.rs, clu_001_h2_resets_past_the_bound_close_the_connection (the same two reset bounds on the cluster listener, on a member's connection; on a connection without a member certificate at most two requests reach the handler: clu_001_rapid_resets_without_a_member_certificate_reach_the_handler_at_most_twice in net_port_tests.rs), and clu_001_the_listener_announces_each_kinds_h2_limits.
REQ: DNS-003, CLU-001.
Requirements CLU-001 DNS-003
Builds on ADR-221
ADR-213 DNS over QUIC upstreams: a query that finds its reused connection gone is sent once more on a new one, a handshake outlives the query that started it, and connections are countedthe DoQ upstream (UPS-002, T7.7) keeps one QUIC connection per upstream and opens a new one after the old one has closed.
Context
the DoQ upstream (UPS-002, T7.7) keeps one QUIC connection per upstream and opens a new one after the old one has closed. Issues #130 and #127 measured a share of DoQ queries to a public resolver failing as network errors while DoT and DoH to the same resolver rarely did. The DoQ upstream lacked what the stream pool and DoH over HTTP/2 already had (T10.9, ADR-148): a query on a reused connection that turned out to be gone (closed or forgotten by the server, a stateless reset, its idle timer run out) failed instead of being sent again; a new connection's handshake ran inside the query's attempt timeout, so a query that ran out of time abandoned it and the next query started another; and DoQ connections weren't counted, so a stale connection couldn't be told apart from an upstream that can't be reached. Three failures in a row bench an upstream (ADR-013), so a stale connection could bench a healthy one.
Decision
- A query whose reused DoQ connection is gone (the stream can't be opened, or the connection is lost while the query is written or the answer read: closed or reset by the server, or timed out) is sent once more on a new connection, within the same attempt's time. A query on a connection that the same exchange opened, or waited for, is not retried, so a server that refuses a handshake isn't asked twice. A stream the server resets (RFC 9250 §4.3, for example error 5,
DOQ_UNSPECIFIED_ERROR) or stops (STOP_SENDING, which RFC 9000 §3.5 scopes to the stream) is the server's answer to that query: a failure, not retried, and the connection stays in use. A connection the server closes withDOQ_EXCESSIVE_LOAD(0x4) isn't retried either: every query on it would go out again at once to a server asking for relief. An answer that doesn't parse or match isn't retried. The query is idempotent and goes to the same upstream over a connection verified the same way; 0-RTT stays off. - A new connection is opened in a task of its own, one at a time per upstream: a query that runs out of time while waiting for the handshake leaves it to the next query. The task first looks up the address (a bootstrap lookup keeps its own bounds, 2 s per server and question, so a bootstrap server that doesn't answer doesn't use up the handshake's time), then ends with the handshake, when the upstream is removed (a reload), or when the handshake has taken 3 s, the stream pool's
STALE(it gives up on a connection that sends nothing back after that long). 3 s is longer than any query attempt (at most 1 s, or the 2 s budget for a last member), and short enough that a handshake begun during an outage doesn't keep the upstream silent while QUIC backs off its retransmissions after the path is back; each query still ends at its own attempt timeout. A caller with a longer timeout gives the handshake that instead: the pre-save check of a draft upstream (5 s) and the synthetic probes (probe.timeout_ms), which build upstreams of their own, so no query waits on their handshakes. A handshake that ended while no query waited for it answers nobody: a failure is dropped and the next query starts a new handshake, a connection that has closed since is dropped, and one still open is used like any kept connection (reused, so the retry covers it). - DoQ connections are counted in the upstream connection metrics, in the families and labels the stream pool uses: opens (
ok/failed), the time spent opening them (the address lookup and the QUIC handshake), retries, closes by reason (idle: QUIC's idle timeout, ours or the server's if shorter;server: closed or reset by it;unused: the upstream was removed), and the open connection. The retry counter counts the queries that found the connection they reused gone (closed or reset by the server, or timed out) and were sent once more on a new connection, whether or not that one answered. The close counters can't show a server that forgets a connection without saying so (no close, no stateless reset): that connection is ended by our own idle timer and counted asidle. TLS session resumption isn't visible through the QUIC library, sotelltale_upstream_tls_handshakes_totalhas no DoQ series. - With
TELLTALE_LOG=debug, a retried query logs one line saying the reused connection was gone and the query was sent again on a new connection, and each DoQ connection logs why it ended. - DoH over HTTP/3 gets the same retry for a reused connection that is gone or that the server is closing (GOAWAY); a request stream the server resets or stops, and a connection closed with
H3_EXCESSIVE_LOAD(0x107), aren't retried. Its handshake task and counters are left for later. - Not done: reusing a connection only while its idle time is well below the idle timer (RFC 9250 §5.5), closing a DoQ connection that answers nothing (as the stream pool's
unansweredrule does), and keep-alives. In #130's comparison, quiet DoQ upstreams to a public resolver failed far less often withidle_timeout_ms = 600000than with the default 30 s (fewer new connections); the docs report that measurement and point to the connection metrics, without a general recommendation.
Consequences
a reused connection the server has closed or reset costs that query a new handshake within its time, not a failed attempt. A server that forgets a connection without saying so (no close, no stateless reset) costs every query sent on it until our idle timer ends the connection, up to idle_timeout_ms (30 s by default), which can be enough to open the breaker; that is the main gap left. A slow handshake is paid once, not by every query that times out during it, and an outage delays the first answer after it by at most about 3 s more than before. One small task per DoQ connection waits for it to end. The success path is unchanged: the same lock and no new allocation, for DoQ and DoH over HTTP/3.
Verification
ups_002_doq_a_connection_the_server_closes_on_a_query_is_retried_on_a_new_one, ups_002_doq_a_refused_new_connection_is_not_retried, ups_002_doq_a_stream_reset_by_the_peer_is_not_retried, ups_002_doq_a_stream_the_server_stopped_is_not_retried_and_keeps_the_connection, ups_002_doq_a_connection_closed_for_excessive_load_is_not_retried, ups_002_doq_upstream (3 of 3 queries answered right after a server close), ups_002_doq_a_handshake_outlives_a_timed_out_query, ups_002_doq_an_expired_unclaimed_handshake_does_not_fail_the_next_query, ups_002_doq_a_failed_unclaimed_handshake_does_not_fail_the_next_query, ups_002_doq_an_unclaimed_handshake_counts_as_a_reused_connection, ups_002_doq_answers_soon_after_an_outage_ends, ups_002_doq_a_slow_bootstrap_lookup_does_not_use_up_the_handshake_bound, ups_002_doq_a_longer_timeout_gives_the_handshake_that_long, ups_002_doq_a_dropped_upstream_leaves_no_connection_or_handshake, ups_008_doq_connections_are_counted, ups_002_doh3_a_connection_the_server_closes_on_a_request_is_retried_on_a_new_one, ups_002_doh3_a_new_connection_the_server_closes_is_not_retried, ups_002_doh3_a_connection_closed_for_excessive_load_is_not_retried, ups_002_doh3_a_request_stream_the_server_reset_is_not_retried.
Requirements UPS-002
ADR-214 The installer's language: chosen with --lang or TELLTALE_LANG, English for any message without a translation, and a missing translation reported, never failedsnnh's pull request #141 made deploy/systemd/install.sh speak Simplified Chinese: its questions, messages, --help and the comments of a config its walk-through writes.
Context
snnh's pull request #141 made deploy/systemd/install.sh speak Simplified Chinese: its questions, messages, --help and the comments of a config its walk-through writes. ADR-189 decides languages for the web UI only. The installer is different: it is one POSIX shell file that people download from main and read before they run it as root (docs/running.md), so a merge reaches every new install at once, and it can't fetch a catalog or run a JavaScript check. ADR-189's constraints still hold: maintainers can review a translation's structure but not its content, and English never waits for a translation.
Decision
- One file. Each language is a shell function in
install.sh(msg_en,msg_zh_hans) whose messages are fixedprintfformats; values only fill their%s. English is the source text. Nothing is downloaded for a language, and there is noeval. - English for any message without a translation, one key at a time: a catalog that lacks a key prints the English message; a tag without a catalog prints English throughout.
- Tags are the web UI's (ADR-189), case-insensitive:
zh-Hans, also reached byzh,zh-CN,zh-SGandzh-Hans-*; Traditional Chinese tags stay English. Other tags are placeholders and print English.--langrefuses a value that starts with-or holds anything but letters, digits,.,_and-. A tag, from either source, is only compared, never run. - The language is chosen explicitly, with
--lang(which wins) orTELLTALE_LANG. The locale (LC_ALL,LC_MESSAGES,LANG) picks a language only once the web UI offers it ("offered": trueinui/src/locales/manifest.json), so one rule decides when a language is picked for someone. The detection is in the file, off until that language is added toLOCALE_LANGS; a check fails whenLOCALE_LANGSand the languages the web UI offers (with an installer catalog) differ, so both change together.TELLTALE_LANGis the installer's own: it is read, then unset, so the binary and the programs the installer starts afterwards don't inherit it. - Yes and no mean what they say in Chinese. With the Chinese catalog, a yes/no question takes
是,是的,好,对and the full-widthy/Y(andy,yes) as yes,否,不,不要and the full-widthn/N(andn,no) as no, and asks again for anything else (three tries, then the default). English keeps its rule unchanged. - A missing translation is reported, never failed. The check in
deploy/systemd/guided-e2e.shnames every English key without a Chinese message (a notice in GitHub Actions) and passes; it fails only on a Chinese key that English lacks, which is never shown. The web UI's rule (ADR-189). - Two
--helptexts, held to the same names. The English one is the comment at the top of the file, the Chinese one is written beside it; the check fails when one lists an option (on its own line) or names aTELLTALE_variable the other doesn't, or when the English list and the options the argument loop takes differ.--helpis in the language of the last valid--lang, before or after it. - Menu numbers stay. An answer stream fed with
--interactiverelies on them: a new choice takes the next number (the AliDNS and DNSPod pair is 9; 7 and 8 keep their meaning).
Not done (considered):
- Catalogs as files next to the installer, fetched at run time: a second download, a second file to read before running as root, and a mirror that must carry it.
- The locale choosing the language from the start: a machine with a
zh_CNlocale would get a Chinese installer while the web UI it installs stays English; the explicit choice keeps the two in step until the UI offers the language. - Failing the check on a missing translation (as the pull request did): it would block every English change on a reader of Chinese.
Consequences
- An English message can be added or changed in one place; until someone translates it, Chinese readers see that message in English, and the check's report lists it.
- A machine's locale doesn't change what the installer prints today;
sudo sh install.sh --lang zh-Hansdoes. Offering zh-Hans in the web UI is the moment to list it inLOCALE_LANGS. docs/running.mdand the Get started page say how to choose Chinese and that the menu numbers stay.
Verification
in deploy/systemd/guided-e2e.sh (the CI native job): ops_004_upstream_menu_numbers_are_stable, ops_004_missing_translation_is_reported_not_failed, ops_004_locale_alone_keeps_english, ops_004_locale_langs_follow_the_web_ui, ops_004_help_options_match, ops_004_yes_no_answers_mean_what_they_say, ops_004_telltale_lang_is_not_passed_on, ops_004_help_follows_lang_in_any_order, and the pull request's own checks of --lang, TELLTALE_LANG, a placeholder tag, the Chinese --help and the Chinese config, each config passing telltale config check.
REQ: OPS-004, DOC-006.
Requirements DOC-006 OPS-004
Builds on ADR-189
ADR-215 DoH requests have a deadline and idle connections close, like the DoT listener'sThe tcp and dot listeners close a connection that sends nothing for 10 s, and one whose client stops taking its answers (RFC 7766 §6.2.3; "Slow and silent clients" in docs/running.md).
Context
The tcp and dot listeners close a connection that sends nothing for 10 s, and one whose client stops taking its answers (RFC 7766 §6.2.3; "Slow and silent clients" in docs/running.md). The doh listener follows the same contract over HTTP/2 and HTTP/1.1: a deadline for what a request waits on from its client, an idle limit for its connections, and a grace for the requests of a connection it ends. hyper has no per-request deadline for HTTP/2, and while an answer waits for flow-control room hyper doesn't poll its body again, so a deadline inside the body can't end that request.
Decision
- A POST has 10 s (the
tcplistener's idle timeout, the same constant) to send its whole body. Past that it is answered 408 (Request Timeout) on its own stream, and the connection's other requests go on. On HTTP/1.1 the same request gets the same 408. - Each
dohconnection, HTTP/2 or HTTP/1.1, has a watch: one timer per connection that looks every second, and a few atomic counters its requests update. A request is open from its headers until hyper has taken the last part of its answer. Answers go to hyper in parts of at most 16 KiB; an answer waits while hyper holds a part it has no room to hand to the connection, and the wait starts again with each part, so a client that keeps taking its answer, however slowly, isn't cut off. - An answer whose next part waits more than 10 s for room ends its connection: the listener sends GOAWAY, gives the connection's other requests 10 s to finish, then closes it. hyper can't reset a single stream from outside it, so the connection goes; the client opens a new one, as after any GOAWAY.
- A connection with no open request for 30 s is ended the same way, whether or not it answers PINGs. 30 s rather than DoT's 10 s: browsers keep one DoH connection between page loads, and a new one costs a TLS handshake. It is also the QUIC idle timeout of the
doqanddoh3listeners, and the HTTP/2 keep-alive interval, so an idle connection needs no PING. An HTTP/1.1 connection closes after 10 s without a request (hyper's header read timeout, the listener'shandshake_timeout). - A listener that stops also gives its connections 10 s, then closes them.
- All of these are constants next to the listener (
REALindoh.rs), not keys. - What each limit counts: the POST deadline, the time from a request's headers to the end of its body; the answer deadline, the time each part of an answer waits before hyper takes it; the idle limit, the time since a connection's last open request closed.
Alternatives considered
- A deadline inside the answer's body, or a timer per request for the answer: hyper doesn't poll the body while it waits for flow-control room, so neither would see that wait. Not chosen; a timer per request is used for the POST body only, where it does see the wait.
- Ending the connection for a slow POST body too: every request multiplexed on that connection would be ended with it. Not chosen.
- Resetting only the stream whose answer waits: hyper's server API has no way to do it. Not chosen.
- An idle limit of 10 s, as on DoT: a browser would make a new connection after most pauses. Not chosen.
Consequences
- What a request now does extra: one reference count taken and given back, and a few atomic adds and stores; a POST also one timer while its body is read. No lock; no allocation for an answer up to 16 KiB (a larger one is handed to hyper in parts, and the first split shares its buffer: one small allocation).
- Per connection: one timer that fires every second.
- Each connection-level limit holds to within a second.
- The connection closures are counted in
telltale_doh_stalled_closed_totalandtelltale_doh_idle_closed_total(OBS-005), next to the TCP listener'stelltale_tcp_stalled_closed_totalandtelltale_tcp_idle_closed_total; a 408 counts intelltale_doh_bad_requests_total.
Verification
in crates/telltale-net/src/doh_deadline_tests.rs (the limits scaled down under cfg(test): 1 s, 3 s, 1 s of grace, a 50 ms tick), with a client that writes HTTP/2 frames by hand, and hyper's client: dns_003_a_post_whose_body_never_ends_gets_408_and_its_connection_stays (4 POSTs that send 1,000 bytes and stop: each gets 408, not before the deadline; a GET meanwhile and one after them are answered on the same connection), dns_003_an_http1_post_whose_body_never_ends_gets_408; dns_003_a_connection_whose_client_never_makes_room_for_its_answers_is_closed (20 GETs, stream window 0, PINGs answered), dns_003_large_answers_the_client_never_makes_room_for_close_the_connection (60,000-byte answers), dns_003_an_answer_whose_next_part_gets_no_room_ends_its_connection (1 byte of room once: the 16 KiB part, then the deadline), dns_003_an_idle_connection_that_answers_pings_is_closed: each ends its connection within the bound and not before its limits, the connection's state is dropped and the address's one place is free again; dns_003_a_stopping_listener_gives_its_connections_the_grace; dns_003_a_request_open_longer_than_the_idle_limit_keeps_its_connection; dns_003_the_doh_limits_follow_the_dot_listeners (the real values); and dns_003_a_slow_reader_that_keeps_taking_its_answer_gets_all_of_it, dns_003_a_connection_kept_between_requests_is_used_again, and with the real limits, dns_003_doh_connection_used_again_after_a_pause in crates/telltale-net/tests/tls.rs and the 200-stream burst of ADR-212, are not cut off.
REQ: DNS-003.
Requirements DNS-003 OBS-005
Builds on ADR-212
Referenced by ADR-221
ADR-216 The DNSSEC validator's questions are counted by type, with the time they wait, also after the client's wait; one debug line per validationGitHub issues #112 (airart320) and #120 (cbernha986, rough-ton): cold lookups with full recursion and validate take longer than the client's wait, and the reporter's timeline of one name shows about a dozen upstream questions one after another.
Context
GitHub issues #112 (airart320) and #120 (cbernha986, rough-ton): cold lookups with full recursion and validate take longer than the client's wait, and the reporter's timeline of one name shows about a dozen upstream questions one after another. Nothing said which questions the validator asked or how long each kind took: telltale_upstream_requests_total counts every attempt of every query, validated or not, and ADR-202's stage is one time per validation. OBS-001 asks for a per-stage timing breakdown. Counting comes before any change that asks fewer questions, so that the live nodes and the cold case can be read before and after on the same counters.
Decision
- Every question the validator sends through an upstream group (
GroupHandle::send, the one path of the validation's question, the validation library's DNSKEY, DS and NS lookups, and the unsigned-zone proof's SOA and DS questions) is counted once when it is sent, by kind:question: the validation's own question, by its name and type, which a slot local to the validation's task holds from the start. So the question is told from the lookups of a proof that runs after it got no answer (ADR-202's slot is empty then too).ns,ds,dnskey,soa: any other question of that type.other: any other type (link-by-link validation's CNAME and end questions, ADR-188).
- The time it waited on the group (
Group::resolve_without) is added when it ends: answered, failed, or dropped because its validation stopped waiting for it. - Two counter families beside
telltale_dnssec_retries_total:telltale_dnssec_questions_total{type}andtelltale_dnssec_question_seconds_total{type}, six series each (bounded labels), kept across reloads with the other validation counters. A question counts once however many attempts the group makes for it. - They are counted in the validation's own task, so a validation that goes on after the client's wait (ADR-202) is counted to its end.
- One debug line per validation,
DNSSEC: questions: the name and type, the verdict (no answerwhen none), whether it is a bogus answer's second validation (retry, ADR-201: that one prints a line of its own), the number of questions, the questions by kind with the milliseconds each kind waited (by_kind), and the validation's own time after its question's answer arrived (own_ms, as ADR-202's stage). - Not in the query event, the query log or the API, as ADR-202's field isn't: the counters and the line answer which questions a validation asks; storing them per query would be a decision of its own.
Consequences
- Cost, on validated misses only (never on a cache hit): per validator question, two atomic additions, one clock read more and a borrow of the task-local slot; per validation, one task-local scope, and the debug line, which is only formatted with debug logging on.
- The sum of
telltale_dnssec_questions_totalover its types is the validator's share of the upstream questions;telltale_upstream_requests_totalstill counts attempts. - The Grafana dashboard gains two panels in its Upstreams row: the questions by type, and the average wait by type.
- The question budget is unchanged (counting asks nothing).
- No configuration, wire or API change; no mixed-version effect.
Verification
obs_001_offline_validation_counts_its_questions_by_type (every shape of the question budget: the counts by kind during its own question add up to the upstream questions it asks; insecure-tld-warm is 1 question, 3 NS, 1 DS, and 2 DNSKEY before ADR-217, 0 since: t.'s key set is kept), obs_001_offline_questions_are_counted_after_the_client_gives_up (through the pipeline: the counts grow after the client's SERVFAIL, and equal the validator's questions the upstream got), obs_001_offline_a_question_without_an_answer_is_told_from_its_proofs (a question held past the lookup's share: 1 question, and the proof's 1 SOA and 1 DS), obs_001_metrics_show_dnssec_question_families; the question budget's tests unchanged; make bench-smoke and make bench-dnssec against the base.
REQ: OBS-001, OBS-005, DNS-011, NFR-001.
Requirements DNS-011 NFR-001 OBS-001 OBS-005
ADR-217 The DNSSEC validator keeps its upstream group's answers to its own NS, DS, DNSKEY and SOA questions for their TTL, 15 minutes at most; never for a validation's own question; a validation that ends in doubt drops what it usedGitHub issues #112 (airart320) and #120 (cbernha986, rough-ton).
Context
GitHub issues #112 (airart320) and #120 (cbernha986, rough-ton). ADR-216's counts and the question budget show the validator asking the same questions several times within one validation, and again in the next one:
- for each unsigned record set of an answer, the validation library looks for its zone cut with NS questions, at the owner and then at each ancestor, and asks for the cut's DS, remembering nothing between record sets;
- a key set whose proof the library keeps is still fetched again for each new record set it signs.
Nothing on the validator's path keeps answers: the upstream group has no cache, the recursor keeps zone cuts and server addresses but not answers, and the pipeline's answer cache isn't on this path. For a name three CNAMEs deep in an unsigned zone, the reporter's timeline shows 13 questions one after another, a third of them the same NS and DS questions of the zone. Validation must not be weakened.
Decision
- What is kept. Each validator keeps, per upstream group, the group's answers to the validator's own NS, DS, DNSKEY and SOA questions of class IN: the questions a group handle sends (the validation library's lookups, and the unsigned-zone proof's SOA and DS questions). The key is the question's name (lowercase), type and class. Every question a group handle sends sets DO and CD and carries no client subnet; and a cache belongs to one validator (its trust anchors and negative trust anchors), one group and one member left out. So nothing else that changes an answer is left out of the key.
- Checked every time. An answer served from it goes through the validation library exactly as a fresh one: every signature is checked again each time. The cache changes when an answer was fetched, never whether it is trusted: a bogus answer stays bogus, and there is no new way to an insecure or secure verdict.
- For how long. NOERROR and NXDOMAIN answers, not truncated, with at least one answer or authority record, of at most 4 KiB, are kept until the earliest of:
- the smallest TTL of their records (every section; the OPT record's field isn't a TTL; a TTL with its top bit set counts as 0, RFC 2181 §8), and for a denial min(SOA TTL, SOA MINIMUM) too;
- the smallest original TTL their signatures sign (the TTLs themselves aren't signed, RFC 4035 §5.3.3);
- the earliest expiration of their signatures (RRSIG times compared as serial numbers);
- 15 minutes, the time ADR-098 trusts a zone proven unsigned.
An answer with a signature that has expired or isn't valid yet isn't kept, nor one with nothing left to keep it for. It is served with its TTLs lowered by the whole seconds it has been kept. The validation library gives a record set it has validated before the TTL of that first validation, so a zone the unsigned-zone proof proves from a kept DS denial is remembered no longer than the cache still keeps that denial.
- Never a validation's own questions: the client's question (its name and type, held from the start of the validation, ADR-216) and the questions of link-by-link validation (ADR-188), whose answers become the served answer. A client's own NS, DS, DNSKEY or SOA question always goes upstream, and the member that answered it is the one the validation names (ADR-201, ADR-202). A client that sets CD isn't validated and never reaches it.
- Questions in flight are shared. A question asked while the same one is being asked through the same cache waits for its answer, within its own budget, and takes it whether it is kept or not (one over 4 KiB, or with a TTL of 0, is passed on without being kept). A failure isn't shared: the waiter asks itself, with its whole budget (the validation's own deadlines still bound it). A lookup that runs out of its share of the validation's deadline stops asking its questions before the unsigned-zone proof runs, so neither the proof nor another validation waits for a question nobody asks any more.
- Drop on doubt. Each validation lists the kept answers it used (served from the cache, or kept from its own questions). When it ends bogus, indeterminate or without an answer, they leave that cache, by entry (a newer answer kept under the same key since stays), before a bogus answer is validated once more (ADR-201). So an answer that is wrong or out of date costs at most the validation that met it.
- Apart for the retry. A bogus answer's second validation (ADR-201) has a question cache of its own per group and member left out, so it never reads what the group's handle kept. The unsigned-zone proof's plain handle shares the cache of the validating handle it works for.
- Bounds. 2,048 entries and 4 MiB per group, counting the answers' bytes and the size of each entry's key and slot (a few hundred bytes); 256 entries and 512 KiB per group and member left out (ADR-201's eighth share). When full: the expired answers first, then the half that expires soonest (ADR-203's pattern: O(n), on an insert into a full cache only). A question in flight is never removed; with no room to note it, it is asked without sharing.
- Reloads. A reload builds a new validator, as it does now, so every change of mode, trust anchors or negative trust anchors, and every other reload, starts with empty question caches. The old validator's answers leave the counts when it is dropped.
- No configuration key: the cache changes only when answers are fetched, within their TTL and their signatures' validity, and its bounds are about memory (as ADR-196's).
- Counted in
telltale_dnssec_question_cache_total{type="ns|ds|dnskey|soa", result="hit|miss"}(hit: a kept answer, or the outcome of the same question in flight;miss: such a question that went to the group) and the gaugestelltale_dnssec_question_cache_entriesandtelltale_dnssec_question_cache_bytes. ADR-216'stelltale_dnssec_questions_totalkeeps counting the questions sent to the group only (its sum is still the validator's share of the upstream questions). The debug lineDNSSEC: questionsgainskept, and+n keptper kind.
Alternatives considered
a cache in the upstream group for every query (it would also answer clients and change the path that doesn't validate); keeping an answer past its signatures' validity (it could only make answers bogus); sharing failures between waiting questions (one slow or failing question would fail the others); one cache for the group and its retries (ADR-201's isolation).
Consequences
- Question budget (offline harness, every verdict unchanged, no row up):
secure-zone-warm2 → 1 andsecure-nxdomain4 → 1 (the zone's key set, fetched by the first question, is kept);insecure-cold9 → 8 andinsecure-tld-warm7 → 5 (t.'s key set fetched once, or kept from the first question);insecure-zone-warm9 → 2 (the first answer's NS and DS questions are kept; the denial asks its own question and the proof's SOA);insecure-proof11 → 5;nx-u-depth-2,-5,-109, 12, 17 → 5, 8, 13 andnx-v.t-depth-2,-5,-1011, 14, 19 → 6, 9, 14 (the walk's repeated NS and DS questions, and the root's ort.'s key set);cname-secure5 → 3;cname-nodata-links14 → 7,cname-two-links21 → 9,cname-nxdomain-links16 → 7,cname-misjudged-links23 → 11,cname-unsigned-child22 → 12 (each link's proof asks the zone's keys and DS again);cname-into-unsigned10 → 7,cname-order-u9 → 5,cname-order-u.t16 → 9; a new row,cname-three-in-unsigned(three CNAMEs insidev.t.to an address), 15 → 7: the question, an NS question at each of the four owners and one at the apex, and the apex's DS;bogus-cname22 → 15 (each of its two validations keeps what it repeats). Unchanged:secure-root-cold2,secure-cold6,secure-warm1,secure-nxdomain-cached0,insecure-proven0,insecure-denial-proven0,bogus-signature4. - ADR-196's test of the validation library's bound now counts the key lookups its evictions cause as the question cache's answers: while the question cache holds a zone's keys, a re-validation after an eviction asks no more upstream questions.
- Risks:
- During a key rollover, a key set kept from before it can make an answer signed by the new key bogus until the entry expires; the first validation that ends bogus drops it, and the next asks again.
- The library's zone-cut search and our proof's apex check ask NS and SOA questions without validating their answers. Such an answer, if forged, now lives up to its TTL (15 minutes at most) instead of one validation. It can change where a DS is asked, and so make an answer bogus; the DS answer is validated every time it is used, and a denial of a DS for a name that exists is accepted only with the parent's proof of a delegation there. The first validation that ends in doubt drops it.
- An answer the validation library accepts is kept as any cache keeps it, for its TTL within the 15-minute cap: only a validation that ends in doubt drops it, and a secure or insecure verdict doesn't.
- Questions that wait for one in flight wait for a slow one, at most their own budget.
- Memory: at most 4 MiB per group and 512 KiB per group and member left out; validating handles are kept for up to 65 groups and 65 such pairs, as ADR-196's caches are. A typical answer is 0.2 to 1.5 KB.
- Cost, on validated misses only (a cache hit of the answer cache is unchanged): per NS, DS, DNSKEY or SOA question, one lock and lookup; per such question asked upstream, one read of its answer (a summary and one walk of its records, for both whether it is kept and whether waiting questions may take it), one copy and a second lock (and one channel for questions that may wait on it); per answer served from it, one copy with its TTLs lowered.
- No configuration, wire or API change; no mixed-version effect.
Verification
offline: the question budget's five tests (updated, no row up, and the new row), dns_011_offline_validator_questions_are_asked_once_per_ttl (a second name in v.t. asks its own NS question only), dns_011_offline_question_cache_never_answers_the_validations_question (t.'s key set, v.t.'s NS and DS asked as clients' questions, while kept), dns_011_offline_a_bogus_validation_drops_the_questions_it_used (a forged key set once: bogus, then the next name of the zone secure), dns_011_offline_bogus_stays_bogus_with_a_warm_question_cache (bad. and forged.s.t., cold and warm, through two members), dns_011_offline_retry_never_reads_the_groups_question_cache, dns_011_offline_concurrent_validations_share_their_questions (A, AAAA and HTTPS of one name at once: its NS, the zone's NS and DS once each), dns_011_offline_a_timed_out_lookup_does_not_hold_up_its_rescue (a lookup out of time while it asks v.t.'s DS: the proof asks it again and proves the zone unsigned), dns_011_offline_a_waiting_question_whose_leader_failed_asks_with_its_whole_budget (the question it waited for fails late: it asks with the handle's whole budget, and the library proves the answer itself), dns_011_offline_a_kept_answer_served_later_still_validates (kept answers used 20 s later, on a test clock of the question cache and the zone memory: secure, and a zone proven from a kept DS denial remembered only for what the denial has left), dns_011_offline_validation_cache_is_bounded (updated as above), and ADR-216's obs_001_offline_validation_counts_its_questions_by_type (insecure-tld-warm now 1, 3, 1, 0); unit: dns_011_offline_question_cache_keeps_an_answer_no_longer_than_its_ttl, dns_011_offline_question_cache_stops_at_the_signature_expiry, dns_011_offline_question_cache_keeps_no_longer_than_the_signed_original_ttl, dns_011_offline_question_cache_keeps_only_whole_answers_with_records, dns_011_offline_question_cache_reads_an_answer_once_for_both_decisions, dns_011_offline_question_cache_is_bounded, dns_011_offline_question_cache_shares_a_question_in_flight, dns_011_offline_question_cache_forgets_only_the_entries_it_was_given, dns_011_validator_questions_set_do_and_cd_without_a_client_subnet; pipeline: dns_011_the_question_cache_never_answers_a_clients_question (with CD and without), dns_011_reload_starts_the_validator_with_an_empty_question_cache (the same setting, another mode, a negative trust anchor, a trust anchors file); dns_011_metrics_show_the_question_cache; make bench-dnssec and make bench-smoke against ADR-216's build with a same-binary control.
REQ: DNS-011, NFR-001, NFR-004, UPS-006, OBS-005.
Requirements DNS-011 NFR-001 NFR-004 OBS-005 UPS-006
Builds on ADR-098 ADR-188 ADR-196 ADR-201 ADR-202 ADR-203 ADR-216
ADR-218 Devices recognized by client ID have their own row in the per-device analytics, under their nameGitHub issue #133 (and the third point of #91).
Context
GitHub issue #133 (and the third point of #91). A device configured with a client ID ([[client]] match = ["id:…"]: the DoT server name's first label, or the DoH path /dns-query/<id>) gets its group and filtering wherever it is, but every per-device view (top clients, Clients → Last hour, the heatmap, the rhythm, anomalies, new devices) is keyed by the address a query came from. Behind a proxy or a tunnel every such device is one row, the proxy's; a phone that roams is a row per network. ADR-194 left this out on purpose. ADR-150 already gives Kubernetes workloads a synthetic analytics key, substituted on the telemetry thread for the analytics only; this decision follows it.
Decision
- One key per configured device, for every query of a device that has an
id:key, whatever recognized it (its ID, a MAC address, an address). The pipeline already puts the device's configured index + 1 (client_ref) in every event; the telemetry thread replaces the transport address with the device's key where it drains events, before the privacy level is applied. No event field and no work on the query path were added. Unknown IDs keep the address (identification falls through to it), so made-up IDs create no rows. A device that also has a network wider than one address in itsmatchgets no key: one key would make every host of the network one row (and a new host no new device), so its queries keep their addresses, as the network's hosts did before (config checkwarns). - The key is
0100:0:0:1::/64followed by the first 8 bytes of BLAKE3 of the device's name in lower case (the folding of the names' uniqueness check). No secret: the key says no more than the name. It is disjoint from the workloads'100::/64. Nothing derived from an ID is ever part of a key, of the analytics, or of any output. - Shown by the name, never by the key or an ID. Every analytics answer of the API and MCP (top lists, the last hour, the heatmap's
key, rhythm, anomalies, new devices and new domains, the SLO attribution's clients,telltale_client_queries_total) shows such a device by its configured name; a top list marks the rowbyClientId. A key no device has now (a renamed or removed device) is left out of every list rather than shown. Renaming such a device starts its per-device history afresh. clientparameters that take an address also take such a device's name (any case): the top domains of one client, the heatmap, the rhythm, the identity, new domains. Aclientthat is anid:value is refused with one answer (422 client_id_given) whatever followsid:and whether or not a device has that ID, so it can't be used to test IDs.- The query log, the live tail, dnstap, the event sinks and the exports keep the transport address (they are where the attribution can be checked). Until the query log can be read by these devices' names (ADR-231 names this node's own rows by device, at read time; a search by name is a later step), the reads from it by a device's name refuse such a device with the reason (
422 client_id_device_unsupported): a device's day,GET /queries?client=, the live stream'sclient, a vqlogclientcondition, a device's query flow, and MCPget_client_profile's recent queries. Explain and drill targets, which act on an address, refuse it too: such a device can't be explained or drilled yet, and a drill by the address its queries come from leaves them out of its report (they count under the device). Its identity isavailable: falsewithreason: client_id(it isn't classified). - Source addresses inside the key prefixes. A transport address inside
100::/64or100:0:0:1::/64(which no real device has) is counted as one fixed value,100:0:0:ffff::, before any key is given, so a query from such an address never counts under a device's or a workload's key. The query log and the tail never name such an address after a device. - One shared check (
client_id::synthetic) tells a workload's key, a client-ID device's key and the fixed value from an address, at every backend site that skipped workload keys: a client-ID key or the fixed value never triggers a query-log read, a reverse or MAC lookup, a device classification, a drill target, a drill report row, or an affinity row. The UI marks a client-ID device's row (no device menu); the fixed value's row is an ordinary row there (its menu offers "Name this device" and "Show queries", which finds nothing: the log keeps the real addresses), left to the next step. - Restart. The startup replay of the query log (OBS-004) reads a row's
client_refthrough the node's own history,<data_dir>/client-refs.json: spans ofclient_ref → keyby time, written atomically at start, at each change of the devices that have an ID, and at a clean stop (which ends the span in force). It holds onlyclient_refs, times and keys; it is node-local (never replicated, shipped, backed up, or put in a support package), pruned to the query log's retention and to 256 spans. A row no span covers, or a missing or unreadable file (logged once), keeps its address: aclient_refis never read through today's device list (ADR-040). Within one second of a change of the device list in a running process, aclient_refwhose device differs on the two sides keeps its address (a query identified just before the change may be counted just after it). The file also keeps the latest time it recorded (a span's start, a clean stop). A start or reload whose clock is at or before that time (a host without a real-time clock that starts before NTP, a clock stepped back) can't tell the rows it will log from the earlier ones, so from that time on the history names nothing: later spans are dropped and the one in force ends there, and those rows keep their addresses until a start past everything recorded. That run's clean stop doesn't stretch the span it ended. Moving the new span just after the last one instead (the first version) would read the earlier run's rows through the new device list. - Cluster. The key is a function of the shared configuration, so it is the same on every node, and lists merge by the name. Mixed versions fail closed for the lists: an older node counts the device's queries under the address they came from (both rows show during an upgrade); a read sent to an older peer by key (a device's top domains, its heatmap) returns nothing for it; an older node that serves the page shows the device's row from newer nodes by its name, without the tag. The rhythm and the identity go to peers by the device's name: an older peer reads the name as the device's first configured address and answers for that address (an identity from it may show a classification, and the rhythm adds that address's part), until every node runs this version.
- Configuration check. A warning when a device's name shows a client ID: one of its own or another device's, in any case, with or without
id:, with spaces at its ends, with Unicode hyphens or dashes written for-, or an ID of 4 characters or more inside the name (the name is shown to everyone who may read the analytics, the IDs only to who may read the configuration; a shorter ID inside a name says too little and would match ordinary names). A device whose name is an address or starts withid:keeps its addresses in the analytics (its name couldn't be given back as aclient), with a warning; so does a device with an ID and a network wider than one address. Other look-alike characters (Cyrillic letters for Latin ones, full-width letters) aren't folded: the names are the operator's own, and the check is a guard against a mistake, not a filter. - Anomaly mutes that name such a device, or a group it is in, cover its key; such a device can be muted by name without an address in its
match.
Consequences
- A device recognized by client ID is followed across networks under its name. Its queries that were recognized by an address or a MAC move from that address's row to the device's row.
- Privacy level 2 hides it: the key is given before the level is applied, which then clears the client of every event; the name-to-key reads answer
privacy_levelas reads by an address do. - Attribution is only as strong as the ID is secret: whoever uses the ID is counted as the device. The query log keeps the transport address for checking.
- Known limit: exclusions (
[exclusions], OBS-022) leave queries out by domain or by the address they came from, never by device, so there is no per-device opt-out for these devices short of privacy level 2. A follow-up is planned. - Drills and the affinity view, which work by address, leave these devices out.
- Known behaviour: a device with an ID and no groups of its own shows the group
defaultin the last hour (its own groups, without a network's), even when its queries get their network's group; the last hour'sgroup=filter follows that label. A top list can return fewer rows thanlimitwhile it holds the keys of renamed devices (they are left out after the list is cut). A renamed device's old key keeps its per-client Prometheus slot until restart (its count is shown inclient="other"); a device recognized by client ID namedotherand the rest share that label (two samples of one series). - Known limit: the anomaly findings, new devices and new domains don't mark a device recognized by client ID yet, so their links to the query log ("Show these queries", "See the day", a new domain's queries, the rhythm strip's domains, the drawer's timeline) end in
client_id_device_unsupportedfor it. The next step adds the mark and hides those links. - The cost: two 8-byte comparisons per event on the telemetry thread, and, while some device has an ID, two binary searches; none on the query path. One more lock read per drain.
- The prefix
100:0:0:1::/64lies outside RFC 6666's100::/64(the discard prefix), in0100::/8, which IANA's IPv6 address space registry lists as reserved by the IETF; its exact status could not be verified here. It is only ever an analytics key, never a source or destination on the wire, and a transport address inside it is never counted under a key.
Alternatives considered
- A key per ID (the issue's proof of concept): a device with two IDs would be two rows, and an unkeyed hash of a guessable ID in the API or the rollups could be tested offline. Not chosen.
- Replacing the address in the pipeline: the query log, tail and exports would lose the transport address, and every query would pay for a hash. Not chosen.
- Naming the device in query-log rows now: the query log has no key; it needs
client_refread through the span table. Left to the next step (done by ADR-231, at read time, for this node's own rows).
REQ: OBS-001, OBS-004, OBS-012, API-010, FLT-006.
Requirements API-010 FLT-006 OBS-001 OBS-004 OBS-012 OBS-022
Builds on ADR-040 ADR-150 ADR-194 ADR-231
Referenced by ADR-231
ADR-219 Compare nodes: the tab's count is never in warning colours, each finding opens the answers behind it, and with two nodes a difference differsFrom spiralshapeturtle's report (#131): two nodes and a witness, no fault on either node, and the Compare tab said "2 odd" with four findings in warning colours.
Context
From spiralshapeturtle's report (#131): two nodes and a witness, no fault on either node, and the Compare tab said "2 odd" with four findings in warning colours. Clients pick their resolver, so two nodes see different clients, and a node's shares follow its clients: a few clients (a DNSSEC test page, one chatty app) made most of one node's SERVFAILs. Amends ADR-128 and ADR-121.
Decision
- The tab's count, in plain colours. The Compare tab still says "N odd" from any tab of the Cluster page, never in warning colours. An exception to ADR-121 ("a tab shows a count or a word, in warning colours when something needs attention"): the comparison is a lens, not a condition (ADR-128: no health reason, no alert), and a count in warning colours on healthy nodes teaches people to ignore the tab.
- Each finding opens the query log for its node (
scope=node:<id>), its window (from: the finding'soddSince, else the window's start;to: the window's end) and the answers behind it: SERVFAIL →rcode=SERVFAIL; slow →minLatencyMs=<slowMs>(the comparison gainsslowMs, the latency objective's threshold: additive); from-cache share →status=forwarded; upstream failures →status=servfail,stale, labelled approximate (the share counts exchanges with upstreams, the log counts answers); p50 or p99 →minLatencyMsof the lower of the two values (the log takes whole milliseconds: under 1 ms the link lists the answers of 1 ms and slower and says so). The query log readsscope(onlynode:<id>for a node of this cluster, shown as removable text; nothing is read until the cluster's nodes say whether it is one, and a search made meanwhile keeps the scope; when the nodes can't be read, the scope goes to the server, which refuses a node it doesn't know; a scope that isn't taken is said in a notice, never dropped in silence) andto(shown as removable text) from its address, and a search keeps both. - A node's scope is the node's rows wherever they are kept (
GET /queries?scope=node:<…>, MCPsearch_queriestoo). A node in ship mode (every chart resolver pod, a Pi set to ship) keeps only what it hasn't delivered yet (aboutinterval_secs, 5 minutes); the rest is on the node it shipped to, underqlog-nodes/<its node ID>/. A shipped row records nothing about its node (the segment header's node number is 0 on every node): the directory, named by the sender's authenticated node ID, does. So the entry node asks the node itself for its own rows (node:localto it: not what others shipped to it; an older node answers as before), every other serving node for what that node shipped to it (a new read,Read::QueriesShipped, answered from that one directory: an empty page where there is none; an older node doesn't know it and is listed inmissingNodes), and reads its own part the same way; a row that comes without a node is labelled with the node (an older storing node in scope still answers with the logs shipped to it, and those rows keep the node they came from), and the cursor keeps one position per node asked. The read runs on an instance of its own, as a scoped read does: itsmissingNodesis its own list, and lists every member that isn't connected (it may keep part of the node's log). Before, a node's scope asked only that node, and a scope of the node that stores shipped logs also returned the rows others shipped to it. - Who is behind it (SERVFAIL and slow findings only, the two shares an objective counts): the error budget's attribution (OBS-027, ADR-127) for that node and window, read when asked, never on the tab's 60 s poll; it says when the node's lists cover only part of the window (
coverage.partialNodes), and an answer to an older request never lands in a newer panel. The comparison itself stays aggregate: its answer gains no client or name, soanalytics:readcallers ofcompare_nodesget nothing new. - The help topic, the running guide and the MCP description say: "Nodes only look alike when clients are split evenly between them, which a resolver can't control: a different mix of clients (a test page, one busy app) changes a node's shares while nothing is wrong with it."
- With two nodes,
differs, neverodd(amends ADR-128's two-node rule). When exactly two nodes have a base for a metric in the window (a third node without one, such as one that answered nothing or asked no upstream, doesn't make it three, wherever it is in the list), the metrics compared — the SERVFAIL, slow and from-cache shares, the node-wide upstream-failure share, p50 and p99 — all follow who asks, so where ADR-128 would sayoddthe finding sayslevel: "differs": the same test, the sameobserved,others,spreadandoddSince, and a detail that says a difference like this usually follows which clients each node serves, not a fault.levelisodd|differs|note(a free string: nothing breaks), findings sortodd,differs,note, and the Compare tab countsoddonly. The Compare tab drawsdifferswith a dashed outline and a line saying what it means. With three or more nodes nothing changes. - A documented limit: three or more nodes whose clients each pick their own resolver keep ADR-128's rule, so a node there can still be
oddbecause of its clients. The follow-up is a population rule: compare the client-driven metrics only among nodes that share one client mix (a site's resolver pods behind one Service), and call the restdiffers; the cluster doesn't record what a population is yet. - Planned, not in this change:
oddwith two nodes from signals the node controls — failures per upstream both nodes use (timeouts, network errors, bad responses, an unresolved upstream host; not SERVFAIL or REFUSED, which follow the name asked) from new per-minute, per-upstream counters, and the node's own listener probes (OBS-020) — gated on: sparse counters bounded by the configured upstreams and counted off the DNS path;make bench-smokeand an RSS check on a Pi; an older peer's buckets without the counters read aspartial(no verdict), never as zero failures; listener probes counted from the node's own results only. A scheduled fixed question through each upstream is not planned here (it would need its own review), nor are client mutes in Compare or suppressing a verdict by how concentrated the clients are.
Alternatives considered
- Keep
oddand suppress it when a few clients explain most of the excess: its thresholds are tuning that a network's clients can always defeat. Not chosen; the attribution's numbers are shown as evidence instead. - A separate
basisfield besidelevel: every reader that listsoddfindings would keep reading client-driven differences as faults. Not chosen. - No findings with two nodes: also loses the planned node-controlled signals. Not chosen.
Consequences
one attribution read per click on Who is behind it?; the 60 s poll is unchanged. With two nodes, no finding is odd until the planned node-controlled signals exist; an agent that reads odd as "a node problem" sees fewer of them, which is the intent, and one that lists every finding that isn't a note sees differs with its reason. The verdict is computed on the entry node, so in a cluster of mixed versions the entry node's version decides it. A query-log read scoped to one node asks every serving node instead of one (the others answer from one directory, or at once with nothing); a site's scope is unchanged (its nodes still answer with the logs shipped to them).
Verification
Playwright obs_028 compare tab count is not an alert, obs_028 a finding opens the query log for its node, window and outcome (every link's node, window and filter; no attribution read before the click, one after), obs_028 the query log keeps a node scope from a link and shows it (a node of this cluster only, kept by a search, removable; to read and kept), and obs_028 node compare (the count without the warning colours); obs_028_a_finding_link_for_a_ship_mode_node_lists_its_shipped_rows (crates/telltale/src/federated.rs, two real nodes over the cluster channel: the node in ship mode gets its buffer and what it shipped, and none of the primary's rows, by node:local and by its ID, paged 7 rows at a time with every row once; the primary gets its own rows and not what was shipped to it); in crates/telltale-api/src/compare.rs, obs_028_two_nodes_with_a_different_client_mix_differ_not_odd (the design's 150 / 38k against 14 / 300k, and the reported shape: 416 / 122,475 against 40 / 40,000), obs_028_two_nodes_p99_and_cache_share_differ_not_odd, obs_028_differs_keeps_odd_since_and_evidence (oddSince 15:00 and the same observed, others and spread), obs_028_a_third_node_without_a_base_does_not_bring_odd_back (every order of the three nodes, for the SERVFAIL share and for the upstream-failure share of a node that asked no upstream; and a third with a base gives the rule of three: odd), with the guards obs_028_three_nodes_one_odd_since_1500 and obs_028_small_base_note_unchanged; Playwright obs_028 node compare (two nodes: a dashed cell, its line, the same mark in the table, the tab counts no differs); obs_028_an_older_storing_node_keeps_other_nodes_rows_labelled_as_theirs and obs_028_a_node_scoped_read_keeps_its_own_missing_nodes (federated.rs, two real nodes).
REQ: OBS-028, CLU-007.
Requirements CLU-007 OBS-020 OBS-027 OBS-028
ADR-220 A group can apply at some sites only: [[group]] nodes = ["site:<name>"], decided by the site of the node that answersGitHub issue #135 (aslafy-z).
Context
GitHub issue #135 (aslafy-z). One scaled Helm cluster serves several homes. Each home has its own LoadBalancer with externalTrafficPolicy: Local, announced from that home's node, so each home's devices reach the resolver pod on their own node with their real address. Two homes reuse 192.168.1.0/24, and ADR-050 lets a network belong to one group, so those devices all fall into default. ADR-050 also says groups are shared configuration, "so every cluster node attributes devices the same way": that is what a reused range needs to be different. A node already knows its site ([cluster] site, announced to the cluster when it created or joined it), and the rollout canaries and the cluster reads already select nodes by site:<name>.
Decision
- A new key,
nodes, on[[group]](shared like the rest of the group, written only when set, so every existing configuration keeps its bytes and its hash). The only selector issite:<name>(the name is not empty and has no space at its ends). There is no node ID and no Kubernetes-node form: a pod's site comes fromresolvers.site(its node's name, its zone, ...; ADR-234), or an environment variable. - The site a selector matches is the site the node announces: the one recorded when it created or joined the cluster (sent in its Hello, shown by
GET /api/v1/cluster, the one rollouts andscope=site:match). A node with no cluster identity (standalone, or not joined yet) uses its own[cluster] site. A node that changed[cluster] siteafter joining keeps announcing the site it joined with; while a group hasnodesit says so in its log (once) and in its health (site_differs, degraded). A site is matched without the spaces at its ends. The group table is built from the announced site at every start and at every reload (the identity file is read each time,cluster.jsononly); nothing in a running node writes the identity. A node that creates or joins the cluster while it starts gets its identity with its[cluster] site, so the table it started with is the right one, and a guard builds it again if the site it announces turns out to be another. nodesandnetworksare ANDed. A group's networks count at a node only when one of its selectors names the node's site. A group withnodesand nonetworksis the default of those sites: what a device nothing else places gets at such a node, in place ofdefault. "Nothing else places" is: no[[client]]entry with groups of its own (or a client by ID, MAC, kernel neighbor or router MAC that has them), and no network group that contains the address. A Kubernetes workload without a group of its own (ADR-150) is such a device: at a site with a default it gets that default. The nameddefaultgroup stays what a query that can't be attributed to a device is counted in.- Decided when the table is built, never per query.
ClientTable::for_sitekeeps only the networks of the groups that select the site, and the site's default is the table's fallback for an identity with no network group;identifyis unchanged, and an identity'snetstays empty for a device a site default places: "no network group matched" keeps its meaning (the change simulator's "keep the group the query was logged with" depends on it). No group is ever left out of the table, so group numbers are the same on every node: the query log's group column and the per-group statistics hold across nodes. - Validation. Selectors must be
site:<name>, not repeated in a group. The same network may be listed by two groups only when both havenodes, and no site is in both; anything else keeps ADR-050's error. At most one group is the default of a site (a group withnodesand nonetworks).defaultitself can't havenodes. The configuration check warns: for a[[client]]keyed by an address or network inside a network that two groups list ("the same device at every site"), and for a site's default while[clients] router_macsis on and a[[client]]is named by a MAC address (decision 8). - No read gives a group from the entry node's site. The Clients page (
effectiveGroups,groupsFrom = "site",groupsBySite) lists each site's group for an address whose group depends on the site, and none as the one group. A token restricted to a group (AGT-004) sees such a device only when every site gives it that group: the Clients page (GET /api/v1/clients) and the last hour's top clients of a group (GET /api/v1/stats/top?kind=clients&hour=rolling&group=) follow that rule, and so does a device that has no group of its own and is placed by a site's default (a Kubernetes workload without a group, a device named by client ID with none). The lists of the current and previous hour for a group, the query log's group filter, the per-group statistics, alerts and metrics use the group index the answering node logged, which is right for its site, and a row of such a list names that group only.explaintakes asite(GET /api/v1/explain?site=, MCPexplain_decision): without one it answers for the answering node's site, names it (client.site) and lists every site's group when they differ (client.groupsBySite); with one it reads the table as that site has it. A row of a top list names every group its address gets at a site. The change simulator decides each logged query with the group of the site of the node that logged it (the node's own rows with its own site, a shipped log's rows with the shipping node's site from the registry, a node the registry doesn't have as no site, notedsite_unknown), and keeps its answers by site and address.identify_device's suggested group is the one of the node that saw the device (itsnode), as its other fields are. - The group follows the node that answers. Each site needs its own LoadBalancer with
externalTrafficPolicy: Local, announced from that site's node: withCluster, Kubernetes can send a query to a pod on another node, with another source address, and neither the address nor the node can be relied on. If a LoadBalancer's address moves to another site's node, those devices get that node's group. The controller pod is a node like the others (it has the sitecluster.sitegives it), and in Helm it does not getresolvers.site: the chart sets the resolver pods' site, and nothing else. A site decides, for each pod: its groups, the canariessite:<name>of staged rollouts,scope=site:<name>of the cluster reads, thetoof a shipped query log, and thesitelabel of alerts and metrics. - Address identity stays cluster-wide, and so do the per-device rows. A
[[client]]entry keyed by an address, a CIDR, a client ID or a MAC is the same device at every site; the analytics rows of one address (top lists, a device's page) merge the sites' queries. MAC addresses that routers report identify devices only at the site of the router that listed them. Where groups havenodes, that is decided when the MAC table is built: an address inside a network that a group withnodeslists gets no device from the MAC addresses routers report (this node's and the members'), and the dialog that names a device offers no router MAC there. The kernel's neighbor table is the node's own link and is unchanged. - Notices. A
site:that no member announces is said by the Cluster page'sgroup_sitescheck (failing: that group goes to nobody; its fix says that an ephemeral pod that left can make a site vanish until it is replaced), by the primary in its log (once, on a reload, and only when its registry lists a member besides itself: the members of a controller that has just started haven't joined yet) and by the plan of a write that names it; a node whose site no group selects says so in its log (once),explainsays it for a site it is asked about, and the check lists such sites (not failing). A member's site is shown up to 64 characters in these texts. All of it is said only while a group hasnodes. - Mixed versions.
GroupConfigrefuses unknown fields: an older replica refuses a version of the shared configuration that setsnodesand keeps serving its last version (as forrouter_macs = false); it shows as behind on the Cluster page. A write that setsnodes(the UI, the API and the MCP plan) warns, naming every member that is not a witness and runs an earlier version (in the version order the update uses), or one whose version can't be compared with this node's. - Helm.
resolvers.sitegives the resolver pods their site (ADR-234). It is unset by default and never reaches the controller's StatefulSet (a test renders both);extraEnvstill goes to both, and aTELLTALE_CLUSTER_SITEin it replaces the one fromresolvers.site.valueFrom(the pod has one entry of that name). Amended by ADR-234 (Proposed):resolvers.sitereplacesresolvers.siteFromNode, which no release had.
Amends ADR-050's "every cluster node attributes devices the same way": groups that have nodes are the exception. ADR-183's router MAC rules are unchanged except inside the networks of decision 8.
Alternatives considered
- A node-local
[node] default_group: a local file would name a shared group (a rename or delete on the primary must not make a replica refuse every version), it is invisible to the management plane, and it cannot make one range a different network group at each site. - Node-only groups (
node_only, as for routes): group numbers would differ on each node, which breaks the query log's group column and the per-group statistics. - The site default as
0.0.0.0/0and::/0among the group networks: it would make "a network group matched" true for every device at that site, and the simulator could no longer tell a device a MAC recognized when it asked. - Reading each read's groups at the answering node's site and saying nothing: the Clients page and an agent would call a device by the group the entry node gives its address.
Consequences
- Nothing changes without
nodes: the shared bytes, the hashes, the table and the per-query path are as before. The change intelltale-policyisClientTable::for_site(build time) and the fallback for an unplaced identity (group_idsandgroup_namesread the table's own field, as they read one before);identifyis not touched. - An older node refuses the key: set it once every node runs this version.
- A site's name is a label chosen at join time; a node that must change it leaves the cluster and joins again.
- One address at two sites is two devices to the groups and one row to the analytics.
Verification
telltale-config, tests/group_sites.rs: flt_005_a_group_takes_site_selectors, flt_005_a_selector_must_be_a_site_with_a_name, flt_005_same_network_allowed_only_for_disjoint_sites, flt_005_two_site_defaults_for_one_site_refused, flt_005_default_group_cannot_be_limited_to_a_site, flt_005_reused_range_with_address_keyed_device_warns, flt_006_site_default_with_router_macs_warns, clu_010_group_nodes_not_written_when_empty, clu_010_groups_without_nodes_are_shared_as_the_build_before_shared_them. telltale-cluster, tests/registered_site.rs: clu_002_the_registered_site_is_read_from_cluster_json_alone. telltale-policy, tests/group_sites.rs and tests/group_site_views.rs: flt_005_reused_range_at_two_sites_gets_two_groups, flt_005_site_selector_and_networks_must_both_match, flt_005_site_only_group_is_the_step_before_default, flt_005_device_with_own_groups_wins_at_every_site, flt_005_group_indices_equal_on_every_node, flt_005_site_default_is_not_a_network_match, flt_017_workload_without_group_at_a_site, flt_005_a_table_says_what_every_site_gives_an_address, flt_005_a_table_can_be_seen_from_another_site, flt_005_an_identity_from_another_site_is_pinned_to_its_group, flt_005_a_site_is_matched_without_the_spaces_at_its_ends, flt_005_what_nothing_places_is_the_default_of_each_site. The server: flt_006_router_binding_not_used_in_a_site_scoped_network and flt_006_the_table_is_rebuilt_only_when_an_input_changed (devices.rs, server.rs); in site_scope.rs, flt_005_the_policy_follows_the_announced_site_when_it_becomes_known, flt_005_a_site_changed_after_joining_is_reported_and_one_value_is_used, flt_005_a_site_no_node_has_and_a_node_no_group_selects_are_noted, clu_010_versions_compare_as_semantic_versions, clu_010_a_write_that_sets_nodes_names_the_members_on_an_earlier_version, flt_005_a_write_naming_a_site_no_member_has_is_warned, flt_005_a_members_site_is_cut_where_it_is_shown; in api_backend_site_tests.rs, flt_005_the_groups_page_shows_the_selectors, flt_005_the_clients_page_lists_every_sites_group, flt_013_explain_answers_for_a_site, flt_005_a_top_list_row_lists_every_sites_group, agt_004_rolling_top_restricted_token_site_dependent_client_hidden, agt_004_rolling_top_restricted_token_site_default_workload_and_client_id, agt_004_group_top_row_names_only_the_group_asked_for, flt_005_the_site_is_read_only_while_a_group_has_nodes_and_a_failed_read_is_said, flt_005_a_site_that_differs_is_found_without_the_nodes_key_and_certificates, flt_005_a_site_that_differs_is_said_only_while_a_group_has_nodes, flt_005_a_missing_site_is_said_when_the_registry_lists_other_members, flt_005_the_check_for_a_missing_site_says_what_an_ephemeral_pod_does, flt_005_a_site_is_matched_trimmed_and_a_members_site_is_shown_cut, flt_005_a_group_with_nodes_is_written_through_the_api, flt_005_a_bad_selector_is_refused_by_the_write_with_the_checks_words; in simulate/tests.rs, obs_024_simulation_uses_the_rows_site, obs_024_the_devices_only_replay_keeps_its_answers_by_site_and_address, flt_005_site_default_keeps_logged_group_in_simulation; in health.rs, obs_040_every_reason_carries_its_parameters and obs_040_the_reason_parameters_are_in_the_docs (site_differs). telltale-api: agt_004_restricted_token_site_dependent_device_hidden, agt_001_plan_update_group_takes_nodes_and_explain_a_site. The chart: deploy/helm/site-test.sh. The rolling upgrade: deploy/cluster/upgrade-e2e.sh step 6 (with no rollout holding it back, an older replica takes an ordinary version, refuses the one that sets the key, naming the unknown field, and keeps serving its last; the write names it). Playwright: 12-group-sites.spec.ts, and the pseudo-locale pages for groups and clients.
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 API-010 CLU-002 CLU-003 CLU-009 CLU-010 FLT-005 FLT-006 FLT-013 FLT-017 OBS-024
Builds on ADR-050 ADR-150 ADR-183 ADR-234
No decision matches. Try fewer words, or another status or area.