For the technical audience

Decisions ADR-231 to ADR-234

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-231 The query log names a device recognized by client ID on this node's own rows, at read time, from the node's own historyProposedAGTAPIFLTOBSGitHub issue #133, the step after ADR-218.

Context

GitHub issue #133, the step after ADR-218. ADR-218 gave a device recognized by client ID a row of its own in the per-device analytics and left the query log on addresses "until the query log names these devices". Behind a proxy or a tunnel the log's client column is the proxy's address for every such device, and the query log's quick-rule form, which starts from that address, would make a rule for it. A rule for an address matches by the transport peer, outranks a group's scope, and at the same rank an allow beats a block (policy/quick.rs): one save from such a row could unblock a domain for every device behind the proxy. A query-log row holds the address, the primary group and client_ref (the device's configured index + 1, set for any recognition source); the node's history of which client_ref was which device when (client-refs.json, ADR-218) already says, for a row's time, which device key its number was.

Decision

  • A row is named when it is read. clientName is the configured name of the device whose key the node's history gives for the row's client_ref at the row's time (the same lookup the restart replay makes), and byClientId is true; client stays the address the query came from. Nothing is added to a query, an event, the ring, the writer or the segment format, and no byte of the log changes: the work is at most one binary search per returned row (a page has at most 1,000), plus one lookup table per request, in the API layer, after the page is decoded.
  • A device is its name. The key is a hash of the device's lower-case name, so a renamed or removed device's old rows are named by nothing, and when two devices swap names, old rows show under the name the other device holds now, and a new device that takes an old device's name shows that device's old rows. The tag says the device has a client ID, not how a query was recognized: a row of such a device that was recognized by its address or its MAC is named too. A device whose match also holds a network wider than one address has no key (ADR-218) and is named by address as before.
  • Own rows only. Only a row read from this node's own qlog/ is named, whichever read it came through (the cluster's, scope=node:local, a combined cursor's later pages): ApiBackend::search_dir takes an explicit own, because the node label it already takes is empty for the logs shipped here as well. Rows in qlog-nodes/<id>/ are never named by this node's history (a client_ref there is a number of that node's list, and two nodes' lists, and clocks, differ: ADR-040), and the entry node of a cluster names a peer's rows by their address only, keeping a name a newer peer gave. So a row that is named on the node that wrote it shows its address once it has shipped to another node. A qlog/ restored or copied onto a node is read through that node's own history, and a run of a build that doesn't keep the history between two runs of this one, or a crash, leaves the last span open over that time.
  • Privacy level 2 and above: no row is named (a row written at level 0 or 1 and read at 2 included, which still shows its address; a row written at level 2 holds no address and no number), and GET /queries?client=<device name> answers 422 privacy_level, as the other reads of a device do. Levels 0 and 1 name rows (level 1 keeps client_ref).
  • The history's clock. A reload takes its time before the pipeline swaps the new list in (client_ids::apply_reload, calling Pipeline::reload after it), and the analytics take theirs inside Pipeline::reload, after its wait for the aggregates: the history's span starts no later than the analytics', by that wait (normally milliseconds). A row identified under the old list in that interval is read through the new span, and the one-second guard leaves it unnamed where the two lists give different keys; a wait of more than a second would misname such rows. A later change could make Pipeline::reload return the stamp it took, so that both spans start at one instant. The start keeps the wall clock, since nothing is answered before the listeners start.
  • The history is held by the process and written whole. client_ids::History (a shared handle in the node's sources) holds what the node last recorded; record_change and record_stop take their source from it (the file only while the handle is empty, at start), store the new history in it every time, and write the file when the list changed, the file is missing, a span was pruned, or an earlier write failed. A failed write is logged and leaves the file behind the process, never the names: the next change or start writes the whole history. A restart after a failed write names the rows since the unsaved change by the last saved span (as the restart's top lists do), which is the wrong device for a number that moved meanwhile. After a crash with a clock behind the file's, rows of the last minutes can still be named through the new list: the file's floor holds the starts and stops it recorded, not the last row's time.
  • Restricted tokens. For a group-restricted principal, client=<name> of a device that /clients doesn't show it (the device's groups or effective_groups doesn't hold the token's group, nor, for a device whose group depends on the site of the node that answers (ADR-220), does every site's: the predicate /clients uses, ClientInfo::in_group) answers exactly as a string that is no device does (400, the same text with the value echoed), on /queries and on /stats/top; in the group, the answer is the refusal below (on /stats/top, the 400 "use either client or group", since the token's group is forced). This closes the one-bit test of a device's existence that /queries and /stats/top had (422 against 400). For a restricted token the device list (a read of every node in a cluster) is read once for every client that is neither an id: value nor an address, whatever the string is, so that what the call costs doesn't say whether it names a device. A token with querylog:read or analytics:read and no group, and without config:read, still gets the 422 against 400 difference: the fix is for group-restricted tokens. A restricted token sees a device's name on its group's old rows after the device has left the group (a row keeps the group it was logged with).
  • With ADR-229 (a configured device's name as the client of the query log). The route checks the value first (an id: value is refused), then, with the principal, whether client names a device recognized by client ID that the principal may know exists (422 client_id_device_unsupported, or privacy_level at level 2 and above); only then does the backend resolve any other device name. The answer is by how the device is named: address keys only, the rows of all of them (up to 64, clientTruncated) for any caller who may see the device; an id: key and no network wider than one address, alone or with addresses, the 422 above, and its addresses are not searched; a MAC alone, the rows where the MAC is recognized now, else a 404; a network alone, or a network and an ID (such an ID has no key), a 404 with the same words; at privacy level 2 and above every device's name is privacy_level. A token restricted to a group that isn't shown the device, of any of these kinds, gets the answer of a string that is no device, on /queries, on /stats/top and through the MCP tools. The group of a search narrows a device's name for any caller (ADR-229), so an unrestricted caller who gives a group and a name of an address-keyed, MAC or network device outside it is answered as for a name nobody has; a device recognized by client ID is refused as above whatever the group is.
  • Reads by name stay refused. /queries?client=<device name>, /queries/stream, vqlog (client), a device's day, flow and the profile's recent queries still answer client_id_device_unsupported for a device recognized by client ID, with the wording changed: the read can't take the device by its name yet, and the rows show its name. Explain stays refused. An id: value is refused as before, whatever follows it.
  • The Why? drawer of such a row is reduced. It asks neither explain nor the identity of the address (the address may be a proxy's, and an explanation of it would describe the wrong device and group). It says that the device has a client ID and where the log has the query from, and keeps Make a quick rule for the device by its name (never the address); the form says so and, when the Device field holds that address (in any spelling of it), warns that a rule for it applies to every query from it. It doesn't try the rule on the log, because the simulation identifies each logged query by its address and would show no change for a device recognized by client ID. The tag says the device has a client ID, not how the query was recognized, so a row recognized by the device's own address or MAC gets the same drawer. The live view's relabelling (relabelRows) skips these rows: prepared for the live tail, a no-op today.
  • The Queries page shows the name with the client ID tag, no menu, and the address as text beside it.
  • MCP and OpenAPI: QueryRow.byClientId (absent when false; an older peer's rows read as false); search_queries' text says what client takes (an address, or a Kubernetes workload) and where such a device is named.

Consequences

  • Limits to say, and said in the guide: rows another node shipped here and rows from before the history (or before the device had a client ID) show addresses; a rename or removal leaves old rows unnamed; the second around a change of the device list is unnamed; a node's rows turn from named to unnamed when they ship to another node (visible in a deployment where resolver pods ship their logs to the primary: the primary names only its own rows).
  • Not covered, as before this decision: a quick rule from a row that is not named still starts from the address, with a note that a rule for an address applies to every device that connects from it. That is the Live view (its rows have byClientId false: the tail is not named, T34.2), and every unnamed row of a device that has a client ID: shipped to another node, older than the history, in the second around a change, from an older peer. An agent that builds a rule from client is told in search_queries' text.
  • Memory: the history in the handle, 20 bytes per (device, span), at most 256 spans (10 devices: 51 KB; 500 devices: 2.5 MB); none while no device has an id: key.
  • Mixed versions: an older peer's rows have no byClientId and no device name (they show the proxy's address); an older UI shows the name beside the proxy address with the address's menu. A newer entry node keeps a name a newer peer gave.
  • No benchmark-list crate, telltale-store or pipeline.rs is changed.

Alternatives considered

  • A column in the segment (a device key per row, or a number in the high bits of ClientRef): an older reader would see an empty segment without an error, the key of a name in a file is guessable, and the format would need a version that readers learn a release before writers use it.
  • A client-ID column: the ID is a credential (ADR-218), and a hash of it per query is work on the query path.
  • A sidecar file per segment: orphaned by retention, and a shipped sidecar would be filed as a segment.
  • Naming shipped rows on the receiver by its own history: wrong when the nodes' lists differ (ADR-040).
  • Hiding Why? for these rows: it removes the only path to the quick-rule form; the reduced drawer keeps the form and drops the explanation.

Deferred (listed, not started): searching by a device's name (a store filter from the same history, which must not reach a shipped directory), vqlog by client and where client, a device's day, flow and profile views, shippedNotSearched, the live tail, CLI qlog search, the event sinks, naming shipped rows (needs a versioned format).

Amends ADR-218's "until the query log names these devices" and its alternatives line "naming the device in query-log rows now": the log's rows show the name (own rows, at read time); the reads by name still refuse. ADR-218's known-limit line (the links that end in the refusal) stands.

Verification

obs_004_a_failed_save_keeps_naming_right_and_the_next_save_writes_the_whole_history, obs_004_the_history_span_starts_no_later_than_the_analytics_span, obs_001_row_names_follow_key_at_and_the_current_list, obs_001_query_rows_name_a_device_recognized_by_client_id, obs_001_a_device_recognized_by_its_address_is_named_too, obs_001_a_device_list_change_does_not_name_a_row_by_the_new_list, obs_001_a_renamed_or_removed_device_leaves_its_old_rows_unnamed, obs_001_a_row_before_the_history_keeps_its_address, obs_004_an_unreadable_or_missing_history_names_nothing, obs_001_shipped_rows_are_not_named_by_this_nodes_history, obs_003_privacy_levels_and_named_rows, obs_001_an_unconfigured_id_and_a_forged_source_name_no_row, obs_001_no_client_id_leaves_the_configuration_views, agt_004_a_device_outside_the_tokens_group_answers_like_an_unknown_string, agt_004_a_group_restricted_token_sees_the_rows_it_saw_before, api_001_a_query_row_names_by_client_id_only_when_true, agt_006_search_queries_text_says_where_a_client_id_device_is_named, obs_003_a_newer_peers_device_name_is_kept_by_the_entry_node, obs_003_a_peers_rows_reach_the_entry_node_named_by_address_alone, agt_004_a_restricted_tokens_client_costs_one_device_list_read_whatever_it_names, agt_004_a_device_is_in_a_group_by_its_groups_or_its_effective_groups, agt_004_a_site_dependent_device_is_in_a_group_only_when_every_site_gives_it, obs_003_a_device_name_answers_by_how_the_device_is_keyed, obs_003_from_level_two_every_device_name_is_a_privacy_level_422, agt_004_a_device_the_token_is_not_shown_answers_like_an_unknown_string_whatever_its_keys; Playwright obs_001 a device recognized by client ID on the query log, flt_005 the Why drawer of a client ID row has no explanation and a quick rule for the device, flt_005 the quick rule form warns when its device is a shared address, flt_005 a viewer sees no quick rule form on the Why drawer of a client ID row, obs_001 a rename relabels only rows without a client ID; unchanged and green: api_010_client_id_device_reads_work_or_refuse_with_the_reason, api_010_device_name_works_as_client_for_heatmap_rhythm_timeline.

REQ: OBS-001, OBS-003, OBS-004, API-010, AGT-004, FLT-005, API-012.

Requirements AGT-004 API-010 API-012 FLT-005 OBS-001 OBS-003 OBS-004

Builds on ADR-040 ADR-218 ADR-220 ADR-229

Referenced by ADR-218 ADR-229

ADR-232 A breaker opens on failures an upstream's own answers don't explain; an active check is the probe of a benched upstream; openings are counted and loggedProposedOBSUPSUPS-006, spec/04 §5.

Context

UPS-006, spec/04 §5. A breaker opened on three failures in a row, counted when each attempt ended. ADR-165's correction of 2026-11-23 made every attempt that a query leaves running record its outcome, so a name that an upstream needs more than the query's budget for (its zone's servers drop the queries, or answer after seconds) now ends in a timeout against an upstream that is up. Three things followed from counting arrivals:

  • Attempts that run at the same time end at the same time. One client that asks a name as A, AAAA and HTTPS starts three, and their three timeouts are three failures in a row, with nothing in between, although the upstream answered other queries meanwhile (and with DNSSEC validation on, the validator's own questions for the same name add more).
  • At the end of a backoff the next query's attempt was the half-open probe, whatever name it asked: a name the upstream can't resolve in time failed the probe and doubled the backoff, up to 5 minutes, for an upstream that was up. On a node with traffic no active check ran, because every outcome, a last resort's included, counts as the upstream being used (ADR-198 closes a benched upstream by a check only while queries don't reach it).
  • Nothing said when a breaker opened: only its state, sampled, was visible, so openings could not be counted, and a flapping upstream could not be told from a steady one.

Decision

  • Count evidence, not arrivals. Health::record_attempt takes the attempt's start as well as its end, and each upstream remembers when it last answered (NOERROR, NXDOMAIN, SERVFAIL or REFUSED, a check's answer too). A failure counts toward the three in a row only if it is not (a) a timeout during which the upstream answered something (an answer that arrived after the attempt started; the latest answer is kept whatever order answers are recorded in, and an answer stamped just after the timeout's end still explains it), and not (b) an attempt that started before the previous counted failure ended (it ran at the same time, and counts with it). An answer still ends the streak, as before. Only a timeout can be explained: a refused connection or a malformed answer is not a name's doing. record_outcome and record take an attempt as instantaneous, so (a) never applies to them and (b) only to attempts with different instants.
  • Everything else about the count stays. An explained timeout still goes into the rolling window as an error and into telltale_upstream_failures_total{kind="timeout"}, so the rate rule (more than half of the last 50, at least 10) still opens an upstream that fails most of what it is asked. A silent upstream, one that answers nothing in any window, opens after three windows one after another (about 6 s for an attempt that uses the whole 2 s budget, 1.2 s for one cut at 400 ms). The thresholds, the backoff (10 s, doubling to 300 s) and the window are unchanged, and there is no new setting.
  • The active check is the probe. The check loop (active_health_checks) also looks at upstreams whose breaker is open or half-open, every 250 ms (BENCH_CHECK_TICK; the idle check of the others still runs every 30 s), used or not, and starts a check as soon as the backoff has run out. The check takes the half-open probe (Health::begin_check) and asks its fixed question (the root's NS, a stub zone's SOA), which an upstream that is up answers. While it holds the probe, its outcome alone settles the breaker: the outcomes of queries that end meanwhile (a last resort's attempt) count in the statistics and settle nothing, where before the next outcome recorded, whoever's, decided. A check that is lost holds the probe for at most 10 s (CHECK_HOLD).
  • A query isn't the probe of an upstream whose check is running. The loop registers itself with each upstream it looks after (Health::watch, ended when the loop is dropped, so a reload that replaces the loop counts). For 3 s after the backoff has run out (CHECK_GRACE, many ticks) admit doesn't hand such an upstream's probe to a query: it stays a last resort, as any benched upstream does, and the check takes the probe within one tick. Only if no check has started by then, because the loop is stuck, may a query take it. An upstream no loop looks after (no checks, a draft upstream, the tests that call admit directly) is probed by its first query, exactly as before; so is one whose check could not take the probe because a query's probe is out (then whichever outcome is recorded first settles it, as ADR-198 says).
  • A check that is answered with a refusal doesn't keep the probe. ADR-198's own text says a forward that answers REFUSED or FORMERR to . NS fails its check, and that such a server belongs in a stub zone. On a node with queries that server used to recover from a benching through a query's probe, and the check alone would keep it benched (up to 5 minutes at a time) while it answers every name. So when a check that held the probe fails with an answer (REFUSED, FORMERR or SERVFAIL: the upstream is up and fails the question), the next probe, at the end of the doubled backoff, is a query's, as before checks took it (Health::check_declined); the check may still take it first on a node without queries, as ADR-198 has it. A check that fails with no answer (a timeout, a network error, a malformed answer) keeps the check as the probe, and the last check decides; a success clears it.
  • Openings are counted and logged. telltale_upstream_breaker_opens_total{cause} counts the openings from closed, by cause (consecutive: three failures in a row that its answers don't explain, which wins when both hold; rate), summed over the upstreams, with no upstream label. One INFO line per opening names the upstream, the cause and the backoff. A failed probe that opens the breaker again is not an opening, and neither is an outcome that arrives while it is open.

Alternatives considered

  • Count only the questions a client asked, not the checks' or the validator's. On a node with traffic the queries are the only signal that an upstream has gone silent, and ups_006_dead_sole_upstream_is_benched and ups_006_silent_member_behind_a_servfail_is_benched pin that three timeouts in a row bench an upstream the checks don't reach. Not chosen.
  • A floor on benched upstreams (never bench the last one, or more than half of a group). It changes ADR-165's documented behaviour for a dead upstream (last resorts with their own timeout, then SERVFAIL without waiting the whole budget). Not chosen.
  • Count distinct names or registered domains. It needs a public-suffix list, and a second domain defeats it. Not chosen.
  • A longer minimum open time. It lengthens the time an upstream that is up stays benched. Not chosen.
  • Let a query keep the probe and give it the check's question. The probe is whichever query is next; changing what it asks would change what the client gets.
  • Raise the thresholds or add settings for them. The accounting was the problem, not the numbers; a setting would have to be explained to every operator.

What it doesn't change: the cache-hit path; the number of attempts, their order, their timeouts and hedging; how the recursive mode classifies its errors (a lame delegation or a CNAME loop is still a failure of the recursive:// upstream; later); the rolling window and the rate rule, so an upstream that fails most of what it is asked still opens, and a window right after a closing, which holds few samples, still opens on ten failures at once (a known limit); the thresholds and the backoff.

Remaining cases, stated plainly: an upstream that answers nothing in any window is benched by three windows even when the cause is one name asked again and again (a client retrying a lookup that fails, on a node nothing else uses): that looks like an upstream that is down. The same name asked as A, AAAA and HTTPS at once is one window and no longer benches it. A busy node's dead sole upstream is benched after three windows instead of after three queries, so up to about 6 s instead of about 2 s while queries wait their whole budget; the rate rule can open it sooner when ten or more attempts end together. Recovery of a benched upstream under traffic starts within 250 ms of its backoff running out, and not on the first query after it.

What changes for upstreams that are only partly down, stated plainly:

  • An upstream that times out on up to half of what it is asked and answers the rest is never benched by these rules. Every window holds an answer, so none of its timeouts counts toward the three, and the rate rule needs more than half of the last 50 (at least 10). Before, runs of three timeouts by chance benched it now and then, and it flapped. The share that fails now waits for the attempt's timeout (about 400 ms) before the next member is tried, since an explained timeout no longer makes the next query hedge at once; under fastest and parallel its latency average sorts it behind the others, under failover it stays first. One that fails more than half of what it is asked opens by the rate.
  • A burst of fewer than ten timeouts that end together, followed by silence, no longer benches the upstream by itself. They count as one. The upstream opens on the third window of later traffic, or after one to two minutes through its idle checks (about a minute apart, since a check's own outcome counts as use). Before, the burst opened it at once. Ten or more that end together still open it through the rate rule (more than half of a window that holds at least ten attempts), as before.
  • Under a slow steady stream an upstream that goes silent is benched later: about 6 s instead of about 2 s for a sole upstream or a parallel racer (the attempt that uses the whole budget), about 1.2 s instead of 0.4 s for one of several that the others can take over from. Clients don't wait for it while another member answers. A faster stream ends ten attempts within the first windows and still opens it through the rate rule, after about 2 s for a sole upstream or about 0.4 s for one of several, as before.
  • A FORMERR or NOTIMP answer still counts as a failure of the upstream and doesn't explain a timeout (the classification is unchanged).

Deferred

confirming before opening (after three unexplained timeouts, ask the check's question once, one at a time per upstream, and open only if it fails too); classifying the recursor's no-server and loop errors as answers of the upstream rather than failures of it; a floor on the window's error rate right after a closing.

Consequences

  • An upstream that is up and slow for some names isn't benched by them, so cold names it can answer aren't answered by a last resort with a shorter timeout meanwhile, and its latency average and place in fastest and parallel aren't pushed back by an opening that didn't need to happen.
  • A benched upstream that is up returns within a tick of its backoff, whatever the queries ask, and its backoff isn't doubled by a query's failure.
  • One check per backoff per benched upstream: about one extra question per 10 s at most to an upstream that is down, doubling to one per 5 minutes. A node whose upstreams are all closed wakes four times a second more than before; nothing else is sent.
  • Operators can count how often upstreams are benched and why, and read the upstream's name in the log.
  • health_check takes the probe through begin_check instead of admit; a check that cannot take it records as any attempt does.
  • An upstream that fails its check with an answer (the REFUSED or FORMERR of a server meant for a stub zone) is probed by queries at the end of each backoff, as before; on a node without queries only its checks reach it, and each one that fails opens the breaker again with the backoff doubled (ADR-198), so it stays benched there until it is made a stub zone. One whose check gets no answer at all keeps the check as its only probe.

Verification

health.rs: ups_006_concurrent_timeouts_with_an_answer_inside_do_not_open_the_breaker, ups_006_a_timeout_during_which_the_upstream_answered_does_not_count, ups_006_three_timeouts_one_after_another_with_no_answer_open_the_breaker, ups_006_timeouts_that_ran_together_count_once, ups_006_overlapping_failures_of_any_kind_count_once_and_an_answer_ends_the_streak, ups_006_explained_timeouts_still_open_the_breaker_by_the_rate, ups_006_openings_are_counted_by_cause, ups_006_a_check_that_took_the_probe_settles_it_alone, ups_006_a_lost_check_does_not_hold_the_probe_for_ever, ups_006_a_check_does_not_take_a_probe_a_query_holds, ups_006_a_watched_upstream_is_probed_by_its_check_not_by_a_query, ups_006_a_check_answered_with_a_refusal_releases_the_next_probe_to_a_query, ups_006_the_latest_answer_explains_a_timeout_in_whatever_order_answers_are_recorded, ups_006_forty_percent_explained_timeouts_stay_closed_and_sixty_open_by_the_rate. tests/upstream.rs: ups_006_dead_names_asked_together_with_a_live_one_do_not_bench_the_upstream, ups_006_one_dead_name_in_three_types_is_one_window_and_three_windows_still_bench, ups_006_dead_names_started_one_after_another_around_an_answer_do_not_bench_the_upstream, ups_006_a_silent_sole_member_under_a_concurrent_stream_is_benched_in_three_windows, ups_006_a_silent_member_of_two_under_a_concurrent_stream_is_benched_in_three_windows, ups_006_the_check_loop_closes_a_benched_upstream_while_queries_keep_arriving, ups_006_the_probe_goes_back_to_queries_when_the_check_loop_stops, ups_006_an_upstream_that_refuses_the_checks_question_is_closed_by_a_query, ups_006_without_a_check_loop_the_first_query_is_the_probe, obs_011_an_opening_is_counted_by_cause_and_logged_once. The server: obs_011_the_breaker_opens_counter_is_one_series_per_cause. Kept green as they pin behaviour this keeps: ups_006_dead_sole_upstream_is_benched, ups_006_silent_member_behind_a_servfail_is_benched, ups_006_servfail_does_not_open_the_breaker_by_itself, ups_006_all_dead_still_attempts_and_reports, and ADR-198's tests. Benchmark: the change is on the attempt-completion path (the attempt's start, already measured, is passed on; no allocation and no lock beyond the one already taken), not on the cache-hit path.

REQ: UPS-006, OBS-011.

Requirements OBS-011 UPS-006

Builds on ADR-165 ADR-198

Referenced by ADR-230

ADR-233 An empty TELLTALE_CLUSTER_SITE counts as unset: the node keeps its configured site and says soProposedCLUOBSOPSGitHub issue #165 (aslafy-z).

Context

GitHub issue #165 (aslafy-z). TELLTALE_CLUSTER_SITE overrides [cluster] site (OPS-005), and an empty value replaced it too: the node announced the site "", which no site: selector matches (ADR-220), no rollout canary or scope=site: read names, and the Cluster page shows as a blank site. An empty value is easy to get without meaning it: a Kubernetes valueFrom on a node label the node doesn't have, or TELLTALE_CLUSTER_SITE= left in a Compose file.

Decision

  1. An empty TELLTALE_CLUSTER_SITE (or one of spaces only) counts as unset, on every install: the node keeps the site of its configuration files (or the default), and the loader warns. Its devices get the groups of that site rather than none, and it keeps serving.
  2. The fallback is visible: the log at start (the loader's warning), the health reason site_empty (degraded; parameter site, the site it uses), shown by the health icon, the Service health page and GET /api/v1/system/health (federated from every node), and the gauge telltale_cluster_site_empty. The variable is read once, when the process starts: the environment of a process doesn't change.

Alternatives considered

  • Keep "" as a site. A site no selector matches, shown blank; nothing says why.
  • Refuse to start. For a site with one node, a resolver that never starts takes down DNS for that whole site; a stricter choice belongs where the site comes from (the Helm chart's).
  • Treat every empty TELLTALE_* variable as unset. An empty value means something for other keys (an empty list, an empty string setting); the site is the one where empty is never a meaningful value.

Consequences

  • A node started with TELLTALE_CLUSTER_SITE="" (Helm, Compose, systemd) now has its configured site instead of an empty one, and says so (site_empty).
  • site_empty is a new health code (OBS-015's table and the UI's sentences have it); a UI of an earlier build shows the server's own English for it.

Verification

telltale-config, tests/config.rs: clu_009_empty_site_variable_keeps_the_configured_site, clu_009_site_env_reads_the_variables. site_scope.rs: clu_009_the_site_variable_says_when_the_node_fell_back. http_tests.rs: clu_009_the_site_fallback_is_a_metric. health.rs: obs_040_every_reason_carries_its_parameters, obs_040_the_reason_parameters_are_in_the_docs (site_empty). Playwright: 12-health-says.spec.ts.

REQ: CLU-009, OBS-015.

Requirements CLU-009 OBS-015 OPS-005

Builds on ADR-220

Referenced by ADR-234

ADR-234 Helm: resolvers.site gives the resolver pods their site as an environment variable gives a value; required keeps a pod without one unreadyProposedCLUFLTOBSOPSGitHub issue #165 (aslafy-z), a follow-up to ADR-220.

Context

GitHub issue #165 (aslafy-z), a follow-up to ADR-220. One cluster serves several homes, each home a Kubernetes zone (topology.kubernetes.io/zone) of one or more nodes, each with its own LoadBalancer announced from that zone's nodes. ADR-220's resolvers.siteFromNode makes each node its own site: a group has to list every node of a home (nodes = ["site:node-a", "site:node-b"]) and be edited when a node is added or replaced, and the sites are named after hosts rather than homes. extraEnv can set TELLTALE_CLUSTER_SITE from any field, but it reaches the controller too, and nothing in the values points at it. siteFromNode is not in a release yet. A valueFrom can resolve to an empty string (a node without the label, a cluster before Kubernetes 1.35 or with the gate off, a pod bound before the plugin was on), which ADR-233 makes a fallback to the configured site.

Decision

  1. resolvers.site replaces resolvers.siteFromNode, shaped as a container's environment variable: value (a fixed site for every resolver pod) and valueFrom (any EnvVarSource, copied as is into the resolver pods' TELLTALE_CLUSTER_SITE; it wins over value). spec.nodeName gives what siteFromNode: true gave; metadata.labels['topology.kubernetes.io/zone'] gives every node of a zone one site, with no permission on the resolver pods (ADR-120 holds): the PodTopologyLabelsAdmission plugin (Kubernetes 1.35, beta, on by default; alpha behind a gate in 1.33 and 1.34) copies the node's topology labels onto the pod when it is bound. The values schema refuses any other key under resolvers.site, and a values file that still sets siteFromNode fails the render, in every mode, naming resolvers.site.valueFrom.
  2. value is the site of the resolver pods' own file (20-resolver.toml, else cluster.site), not a variable: it is the pods' site when valueFrom is unset, and, by ADR-233, the site of a pod whose valueFrom resolves to nothing. The controller's file keeps cluster.site. A TELLTALE_CLUSTER_SITE in extraEnv beats both, as the environment beats a file (OPS-005), and the resolver pod gets one entry of that name.
  3. It can be strict. resolvers.site.required: true (it needs valueFrom or a TELLTALE_CLUSTER_SITE in extraEnv; the chart refuses it alone, in every mode) sets TELLTALE_CLUSTER_SITE_REQUIRED=true in the resolver pods (a boolean variable: true, 1, yes, on; the loader warns on anything else). A node with it whose TELLTALE_CLUSTER_SITE is unset or empty never becomes ready: /readyz is 503 site_missing, after syncing and before maintenance. Like maintenance, it still answers what arrives, and the startup view ignores it, so Kubernetes does not restart the pod for it. Behind externalTrafficPolicy: Local, a site's other ready pods keep serving, and no device lands in another site's groups. ADR-233's site_empty gets a parameter required, and is also raised for a required site that is unset; the gauge counts it too.

Alternatives considered

  • Keep siteFromNode beside a new key, as a shorthand for valueFrom.fieldRef.fieldPath: spec.nodeName. Two keys for one setting, and their order to define; it never shipped.
  • A value that may be a string or an object. Harder to validate and to document than one fixed shape that Kubernetes users already know.
  • Only a resolvers.extraEnv. It would reach the resolver pods alone, but the chart couldn't document the site next to the other resolver settings; it can still be added for other variables.
  • Read the node's labels through the API. It needs RBAC on the resolver pods (ADR-120).
  • A configuration key for required. It concerns where the site comes from (the environment), on the pods the chart starts; a variable the binary reads keeps it out of the shared and local configuration schema.

Consequences

  • Values that set resolvers.siteFromNode fail the render; no release had it.
  • With required, a new resolver pod that never turns ready holds up a rolling update (maxUnavailable: 0) until it gets a site or the change is rolled back.
  • site_missing is a readiness reason, not a serving one (as maintenance is): health stays degraded even when no resolver pod is ready, so the Deployment's ready replicas are what to alert on.

Verification

telltale-config, tests/config.rs: clu_009_site_env_reads_the_variables (the required flag), clu_009_a_required_flag_that_is_not_a_boolean_is_warned. readiness.rs: clu_009_a_missing_required_site_keeps_the_node_unready. site_scope.rs: clu_009_the_site_variable_says_when_the_node_fell_back (required). The chart: deploy/helm/site-test.sh; on kind (Kubernetes 1.35 or later), deploy/helm/site-e2e.sh: the zone label copied onto the pods and announced as their site, the fallback of a pod on a node without it, a site's group applied through that site's pods only, and required keeping such a pod unready without a restart. Playwright: 12-health-says.spec.ts (the required sentence).

REQ: CLU-009, FLT-005, OBS-015.

Requirements CLU-009 FLT-005 OBS-015 OPS-005

Builds on ADR-120 ADR-220 ADR-233

Referenced by ADR-220