Skip to content

chore: "one release" is one chart minor; mesh-DNS reads only the snapshot envelope, and an older file fails closed - #1658

Merged
bpalermo merged 1 commit into
mainfrom
chore/compat-window-meshdns-legacy-snapshot
Oct 10, 2026
Merged

bpalermo merged 1 commit into
mainfrom
chore/compat-window-meshdns-legacy-snapshot

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Four owner decisions from the 2026-10-10 codebase audit, in one change. Written by an AI coding agent.

1. "One release" is one minor version of the aether chart

Deprecated in 2.5.x, removable in 2.6.0, never within the same minor. Written once:

  • AGENTS.md, "Rules for agents", new group Compatibility window: the rule, the skew to design for, and how a deprecation is announced (the runbook's "Chart X.Y.Z" section, and where the thing is defined), with the removing minor written as a version.
  • charts/README.md, new section Compatibility window: the operator's side. The table of supported skew is derived from the rule (adjacent minors side by side for the length of a roll; an upgrade that skips a minor is not supported). Please read that table as a proposal: only the one-minor rule itself was decided.
  • Comments and docs that said "for one release" or "the release after" now name a chart:
Where What Now says
cni/internal/cmd/root.go, root_test.go, docs/configuration.md, charts/aether/BUILD.bazel cni-install's ignored --otlp-endpoint / --otlp-pin-endpoint deprecated in chart 2.4.0, removable from chart 2.5.0 on
registrar/internal/server/metrics.go (comment), metrics_test.go, docs/observability/registrar-alerts.yml, docs/runbook.md aether.registrar.snapshot.content{content_hash} deprecated in chart 2.4.12, removed in chart 2.6.0 at the earliest
AGENTS.md (protos), .claude/agents/aether-adversarial-reviewer.md, aether-chart-engineer.md "one release apart" one chart minor apart

Not dated (listed, unchanged):

2. Removing a production function only tests reference

AGENTS.md ("Tests and findings") and CLAUDE.md ("Testing"): an agent may remove such a function together with the test that only calls it, when the pull request shows by whole-module analysis, not grep alone, that nothing else references it. It is the one exception to "never remove existing test cases unless explicitly asked".

3. The 2.5.0 aether.pod tolerance goes in chart 2.6.0

The optional namespace group of the proxy bootstrap's aether.pod stats extractor (#1634) is recorded for removal in chart 2.6.0 in charts/aether/BUILD.bazel, beside aether_proxy_bootstrap_pod_stats_tags_test, and in the runbook's "Chart 2.5.0" section. The template is not touched: the explanation there is a YAML comment inside the rendered bootstrap, and any changed byte of it hot-restarts every Envoy on upgrade.

Chart 2.5.6 -> 2.5.7 (origin/main was at 2.5.6 when this was pushed).

helm template of the packaged 2.5.6 and 2.5.7 charts, offline (an empty stub kubeconfig), default values and --set controller.webhook.spire=true:

  • templates/agent-proxy-configmap.yaml: one line differs, helm.sh/chart: aether-2.5.6 -> aether-2.5.7.
  • whole render: the helm.sh/chart label (29 objects), and the agent and mesh-dns image digests (three lines: the two images and the controller's --identity-gate-image, which names the agent image). Those come from item 4. With default values the generated webhook certificate differs too, as it does between any two renders.

The first render also showed new registrar and cni-install digests, from comment edits that moved line numbers. Those two comments were rewritten to keep their line count, and both digests are now the same as on main.

4. mesh-DNS reads only the snapshot envelope

  • Who writes, who reads. The node agent writes (meshdns.WriteSnapshot, called from agent/internal/xds/cache/capture.go on a record change and on the heartbeat). The aether-mesh-dns daemon reads (loadSnapshot at start, ReloadFromSnapshot from its watch loop in agent/cmd/mesh-dns/main.go); both go through meshdns.ReadSnapshot, the only reader.
  • Every writer since mesh-dns: close the observability gaps (snapshot staleness, log shipping, forward-path blindness) #586 writes the envelope. 997cc99e (mesh-dns: close the observability gaps (snapshot staleness, log shipping, forward-path blindness) #586/feat(mesh-dns): close the observability gaps (#586) #587, 2026-07-25, chart 0.87.0) changed WriteSnapshot from json.Marshal(records) to json.Marshal(&Snapshot{…}); it is the only function that writes the file, then and now.
  • Removed: the parseSnapshot fallback and its mtime back-fill, with TestReadSnapshotLegacyBareMap and TestReadSnapshotLegacyEnvelopeShapedKeys. TestWarmStartLoadsSnapshot wrote a bare map as its fixture; it now writes the envelope through WriteSnapshot and asserts what it did before.
  • What a resolver does with an old file. A file without a records object is ErrSnapshotParse. At start the resolver stays cold, so a mesh name answers SERVFAIL; on a reload it keeps the table it serves. Both log a warning with the reason and count aether_mesh_dns_snapshot_reloads_total{result="parse_error"}, which the shipped alert rule on result!="success" reads.
  • Why the check is explicit. Deleting the fallback alone would be worse than keeping it: a bare map decodes as an envelope with no fields set. The new tests (TestReadSnapshotBareMapIsParseError, TestBareMapSnapshotFailsClosed) were red against the old reader, and are red again with the Records == nil check mutated away: in that case a reload replaces the served table with an empty one and the resolver answers NXDOMAIN for the whole mesh.
  • One behaviour change beyond the old format: a JSON object with no records key ({} included) used to be read as an empty table. It is now a parse error.
  • Runbook: new "Chart 2.5.7" section (the rule, what is deprecated today with its removal chart, what was removed, that a node carrying a snapshot written before chart 0.87.0 is not supported, what the upgrade rolls).

//agent/cmd/mesh-dns:deps_test is green; the module set did not change.

Verification

  • bazel test of //agent/internal/meshdns:all, //agent/cmd/mesh-dns:all, //agent/internal/xds/cache:cache_test, //cni/internal/cmd:all, //registrar/internal/server:all, //charts/..., //website:site_test, //test/harnesscontract:checks: 282 tests pass.
  • --config=race on the five touched go_test targets: pass.
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...: clean. make format-check: clean.
  • Not run on a cluster.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…shot envelope

The compatibility window is written down once: one minor version of the
aether chart (deprecated in 2.5.x, removable in 2.6.0, never within the same
minor). AGENTS.md has the rule for contributors, charts/README.md the
operator's side (supported skew, where a deprecation is announced), and the
comments that said "for one release" now name a chart version.

AGENTS.md and CLAUDE.md also allow removing a production function that only
tests reference, with the test that only calls it, when whole-module analysis
shows nothing else references it.

The optional namespace group of the proxy bootstrap's aether.pod extractor
(#1634) is recorded for removal in chart 2.6.0, beside the test that pins it
and in the runbook; the rendered bootstrap is unchanged.

The mesh-DNS snapshot reader no longer accepts the bare record map written
before the envelope (#586, chart 0.87.0). A file without a records object is
a parse error: the resolver starts cold or keeps the table it serves, warns
and counts parse_error. Before, a JSON object without records was read as an
empty table, and a reload of it answered NXDOMAIN for every mesh name.

Chart 2.5.7.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit 17c8647 into main Oct 10, 2026
30 checks passed
@bpalermo
bpalermo deleted the chore/compat-window-meshdns-legacy-snapshot branch October 10, 2026 23:53
bpalermo added a commit that referenced this pull request Oct 11, 2026
…auge is removed (#1667)

The labelled info gauge aether.registrar.snapshot.content{content_hash}
(Prometheus aether_registrar_snapshot_content) was deprecated in chart 2.4.12
(#1329, #1346) in favour of aether.registrar.snapshot.content_hash, which
carries the hash as its value and is what the shipped rule
AetherRegistrarSnapshotDiverged reads. Deprecated in 2.4.x means removable from
2.5.0 on; the "chart 2.6.0 at the earliest" written beside it by #1658 was one
minor too cautious and is corrected here.

- registrar: the instrument, its content_hash attribute key and the helper
  that observed both gauges are gone; the value gauge and the revision gauges
  are untouched. A test asserts the exported metric set does not contain the
  name, and that no gauge data point carries a content_hash attribute.
- docs: the runbook's transitional `or` arm and its order of work, the
  "Deprecated" sections of the runbook and docs/observability/README.md, and
  the upgrade comment in registrar-alerts.yml are replaced by a short account
  in the past tense. The shipped rule and its promtool tests never read the
  metric and are unchanged.
- chart 2.5.9: a runbook section says what an operator sees (a rule or a
  dashboard still reading the metric returns no data, silently), the query to
  use instead, and closes the row of the "Chart 2.5.7" deprecation table.

The upgrade rolls the registrar Deployment (new image); no template changed.


Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant