domains: never prime negative DNS caches for new custom hostnames (#724)
A cached query for a hostname that does not exist yet plants a "no such name" in systemd-resolved and the VPC resolver for the zone's SOA minimum, and the cert issuer gates its orders on those caches. Nothing of ours now sends one before the record exists. FreshResolver.resolve walks the zones above the name first and tries the name itself as a zone only last (apex or delegated sub-zone), outside the freshMaxZones count. No cached LookupCNAME or LookupNS on the name runs before the parent walk is over. Section 4 looks fresh first at a name that was not "pointing" before the pass (eligible names, same budget): edge address "pointing", other "elsewhere", authoritative not-found "", and the cached lookup only on a fresh error or past the budget. A previously pointing name keeps the cached-first path plus the upgrade-only fresh look, so the fresh path still never unpublishes. Census overlay for StampHealth (sites) included.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7 files changed,
+646
−86
docs/superpowers/notes/census-proposal-no-negative-prime-724.md+19 −0internal/domains/freshdns.go+72 −35internal/domains/freshdns_stamp_test.go+226 −4internal/domains/freshdns_test.go+248 −0internal/domains/reconcile.go+75 −47internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-no-negative-prime-724.tsv+5 −0
CI failed — run details
diff --git a/docs/superpowers/notes/census-proposal-no-negative-prime-724.md b/docs/superpowers/notes/census-proposal-no-negative-prime-724.md| new file mode 100644 |
| index 000000000..4b5c03f3f |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-no-negative-prime-724.md |
| @@ -0,0 +1,19 @@ |
| +# Census approval: no-negative-prime-724 |
| + |
| +Ruling `census-ruling-no-negative-prime-724`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `internal/domains/reconcile.go` `StampHealth` | sites | -registry:Alias, +registry:DNSStatus ×2, -registry:Host, -whole:Route, -whole:RouteAlias | section 4 now hands each route and alias, with its previous stamp (the two new registry:DNSStatus reads, rt.DNSStatus and a.DNSStatus, same rows already listed), to dnsVerdicts: a name not "pointing" before this pass and eligible for a fresh lookup (public name, not under the apps domain, ResolveFresh set) is looked at uncached first within the same 64-lookup/30 s budget and stamped from it (edge address "pointing", other "elsewhere", authoritative not-found ""), falling back to the cached lookup on a fresh error or past the budget; a previously "pointing" name keeps cached-first plus the upgrade-only fresh look, so the fresh path still never unpublishes; no new file, path or command input; the dropped Alias/Host/Route/RouteAlias sites are the old indexed loops folded into the candidate build (#724) | |
| + |
| +Envelopes re-pinned: `internal/domains`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `internal/domains/reconcile.go` `StampHealth`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-dns-fresh-lookup-724;basis=section 4 now computes every cached verdict first, then freshUpgrade gives up to 64 randomly ordered names that could have a public zone (not under the apps domain, not special-use like .internal) and whose verdict is "" or "elsewhere" an uncached lookup (30 s pass budget) that may only upgrade to "pointing", then stamps; the extra sites are the indexed loops over the same rows (#724) |
| + |
| +Seal: `8924fafc5b6083858a72f45c764081abe3bcad6a6de71901470586c076c64bb6` → `f7eb15fc80af393e7da87f84e5b9bd8fe4803ffed533cfedf209a92dd53910ec`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-no-negative-prime-724.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/internal/domains/freshdns.go b/internal/domains/freshdns.go| index b05641a30..ec9bf4dc2 100644 |
| --- a/internal/domains/freshdns.go |
| +++ b/internal/domains/freshdns.go |
| @@ -68,9 +68,11 @@ const ( |
| // freshMaxServers bounds the nameserver addresses tried per zone, so a |
| // zone of silent servers leaves time for the next zone up. |
| freshMaxServers = 2 |
| - // freshMaxZones bounds the enclosing zones tried, nearest first. More |
| - // than one, because a cached CNAME at the name can make the nearest NS |
| - // set belong to the CNAME target's zone, which then refuses. |
| + // freshMaxZones bounds the parent zones tried, nearest first; the name |
| + // itself, tried last, is not counted. More than one, because a cached |
| + // CNAME at a parent level can make its NS set belong to the CNAME |
| + // target's zone, which then refuses, and a delegated sub-zone's parent |
| + // only refers down. |
| freshMaxZones = 3 |
| // freshMaxCNAMEs bounds a CNAME chain inside one reply. |
| freshMaxCNAMEs = 8 |
| @@ -89,7 +91,7 @@ var freshSkipTLDs = map[string]bool{ |
| // freshPublicName reports whether name (lower case, no trailing dot) could |
| // live in a public zone at all: more than one label, and not under a |
| -// special-use top-level name. Resolve refuses the rest, and freshUpgrade |
| +// special-use top-level name. Resolve refuses the rest, and dnsVerdicts |
| // leaves them out before they can take a share of a pass's budget. |
| func freshPublicName(name string) bool { |
| dot := strings.LastIndex(name, ".") |
| @@ -159,10 +161,25 @@ func isNotFound(err error) bool { |
| return errors.As(err, &dnsErr) && dnsErr.IsNotFound |
| } |
| -// resolve walks the enclosing zones of name, nearest first, and asks each |
| -// zone's nameservers until one gives a definitive authoritative answer (the |
| +// resolve walks the zones ABOVE name, nearest first, and asks each zone's |
| +// nameservers until one gives a definitive authoritative answer (the |
| // addresses, or "no such name"). It stops below the top level: a TLD's |
| -// servers only refer back down. |
| +// servers only refer back down. Only when no parent zone gave a definitive |
| +// answer is the name ITSELF tried as a zone, last. |
| +// |
| +// Why parents first: the cached resolver (systemd-resolved, then the VPC |
| +// resolver) caches a "no such name" for the NAME, whatever type was asked |
| +// (RFC 2308 section 5), for the zone's SOA minimum. A customer attaches a |
| +// hostname before adding its record, so a cached LookupCNAME or LookupNS on |
| +// the name itself would plant exactly that negative entry, and the cert |
| +// issuer reading the same caches would wait it out. Asking the parent |
| +// zone's servers directly needs no cached query for the name at all, and |
| +// the parent is where an ordinary customer hostname lives. The name-itself |
| +// attempt covers a name that is its own zone (an apex, or a delegated |
| +// sub-zone, whose parent only refers down); such a name exists before |
| +// anyone attaches it, so asking about it primes nothing. freshMaxZones |
| +// bounds the parents only; the name-itself attempt always gets its turn, |
| +// inside the same Timeout. |
| // |
| // A zone is only used once it is VERIFIED: the server about to be asked |
| // answers, with authority, an SOA record owned by exactly that name. The |
| @@ -176,42 +193,62 @@ func isNotFound(err error) bool { |
| // since a CNAME cannot sit at a zone apex. |
| func (r *FreshResolver) resolve(ctx context.Context, name string) ([]string, error) { |
| last := fmt.Errorf("%w: no zone found for %s", errNoAuthority, name) |
| - zones := 0 |
| - for zone := name; strings.Contains(zone, "."); zone = zone[strings.Index(zone, ".")+1:] { |
| - if r.aliased(ctx, zone) { |
| - continue |
| - } |
| - nss, err := r.LookupNS(ctx, zone) |
| - if err != nil || len(nss) == 0 { |
| - if ctx.Err() != nil { |
| - return nil, last |
| - } |
| - continue |
| + // try asks one level; stop is true at a definitive answer or once the |
| + // deadline has passed. |
| + try := func(zone string, zones *int) (stop bool, ips []string, err error) { |
| + ips, err = r.tryZone(ctx, name, zone, zones) |
| + if err == nil || isNotFound(err) { |
| + return true, ips, err |
| } |
| - if zones++; zones > freshMaxZones { |
| - break |
| + if !errors.Is(err, errNotAZone) { |
| + last = err |
| } |
| - servers := r.nameserverAddrs(ctx, nss) |
| - if len(servers) == 0 { |
| - last = fmt.Errorf("%w: no public address for any nameserver of %s", errNoAuthority, zone) |
| - continue |
| + return ctx.Err() != nil, nil, last |
| + } |
| + zones := 0 |
| + for zone := name[strings.Index(name, ".")+1:]; strings.Contains(zone, ".") && zones < freshMaxZones; zone = zone[strings.Index(zone, ".")+1:] { |
| + if stop, ips, err := try(zone, &zones); stop { |
| + return ips, err |
| } |
| - for _, s := range servers { |
| - if err := r.verifyZone(ctx, s, zone); err != nil { |
| - last = err |
| - if ctx.Err() != nil { |
| - return nil, last |
| - } |
| - continue |
| - } |
| + } |
| + // The parent walk is over with no definitive answer. Now the name |
| + // itself, with its own allowance outside freshMaxZones. |
| + _, ips, err := try(name, new(int)) |
| + return ips, err |
| +} |
| + |
| +// errNotAZone is a level tryZone skipped without asking anyone: a cached |
| +// alias, or no NS set. |
| +var errNotAZone = errors.New("fresh dns: not a zone") |
| + |
| +// tryZone asks zone's nameservers about name and returns the first |
| +// definitive answer (addresses, or an authoritative not-found), else the |
| +// last failure, or errNotAZone for a level that is not a zone. *zones |
| +// counts the levels that had an NS set. |
| +func (r *FreshResolver) tryZone(ctx context.Context, name, zone string, zones *int) ([]string, error) { |
| + if r.aliased(ctx, zone) { |
| + return nil, errNotAZone |
| + } |
| + nss, err := r.LookupNS(ctx, zone) |
| + if err != nil || len(nss) == 0 { |
| + return nil, errNotAZone |
| + } |
| + *zones++ |
| + servers := r.nameserverAddrs(ctx, nss) |
| + if len(servers) == 0 { |
| + return nil, fmt.Errorf("%w: no public address for any nameserver of %s", errNoAuthority, zone) |
| + } |
| + var last error |
| + for _, s := range servers { |
| + if last = r.verifyZone(ctx, s, zone); last == nil { |
| ips, err := r.ask(ctx, s, name, zone) |
| if err == nil || isNotFound(err) { |
| return ips, err |
| } |
| last = err |
| - if ctx.Err() != nil { |
| - return nil, last |
| - } |
| + } |
| + if ctx.Err() != nil { |
| + break |
| } |
| } |
| return nil, last |
diff --git a/internal/domains/freshdns_stamp_test.go b/internal/domains/freshdns_stamp_test.go| index bc663c777..10fecd242 100644 |
| --- a/internal/domains/freshdns_stamp_test.go |
| +++ b/internal/domains/freshdns_stamp_test.go |
| @@ -100,6 +100,9 @@ func TestStampHealthFreshLookupBeatsCachedElsewhere(t *testing.T) { |
| } |
| } |
| +// A name that was "pointing" keeps the cached-first path: the fresh answer |
| +// may only raise the cached verdict back to "pointing", never lower it. |
| +// This is the invariant that stops the fresh path unpublishing a name. |
| func TestStampHealthFreshLookupNeverDowngrades(t *testing.T) { |
| cases := map[string]func(string) ([]string, error){ |
| "fresh NXDOMAIN": nxdomain, |
| @@ -109,6 +112,7 @@ func TestStampHealthFreshLookupNeverDowngrades(t *testing.T) { |
| for name, fresh := range cases { |
| t.Run(name, func(t *testing.T) { |
| reg := regWithAlias(t, "shop.example.com") |
| + stampAlias(t, reg, "shop.example.com", "pointing") |
| var calls []string |
| cfg := freshCfg(func(h string) ([]string, error) { |
| if h == "shop.example.com" { |
| @@ -136,6 +140,7 @@ func TestStampHealthFreshLookupOnlyWhereItCanHelp(t *testing.T) { |
| t.Fatal(err) |
| } |
| } |
| + stampAlias(t, reg, "live.example.com", "pointing") |
| var calls []string |
| cfg := freshCfg(func(h string) ([]string, error) { |
| switch h { |
| @@ -158,9 +163,10 @@ func TestStampHealthFreshLookupOnlyWhereItCanHelp(t *testing.T) { |
| } |
| func TestStampHealthFreshLookupLeavesResolverFailureAlone(t *testing.T) { |
| - // Our resolver failing is not a customer verdict to second-guess: the |
| - // existing hold-last-verdict rule applies untouched. |
| + // Our resolver failing on a published name is not a customer verdict to |
| + // second-guess: the existing hold-last-verdict rule applies untouched. |
| reg := regWithAlias(t, "shop.example.com") |
| + stampAlias(t, reg, "shop.example.com", "pointing") |
| var calls []string |
| cfg := freshCfg(func(h string) ([]string, error) { |
| if h == "shop.example.com" { |
| @@ -174,8 +180,8 @@ func TestStampHealthFreshLookupLeavesResolverFailureAlone(t *testing.T) { |
| if len(calls) != 0 { |
| t.Fatalf("fresh lookups = %v, want none on a resolver failure", calls) |
| } |
| - if got := aliasStatus(t, reg, "shop.example.com"); got != "unresolved" { |
| - t.Fatalf("alias dns_status = %q, want unresolved", got) |
| + if got := aliasStatus(t, reg, "shop.example.com"); got != "pointing" { |
| + t.Fatalf("alias dns_status = %q, want pointing held", got) |
| } |
| } |
| @@ -248,3 +254,219 @@ func TestStampHealthSpecialUseNamesTakeNoBudget(t *testing.T) { |
| } |
| } |
| } |
| + |
| +func stampAlias(t *testing.T, reg *registry.Registry, alias, status string) { |
| + t.Helper() |
| + if err := reg.SetAliasDNSStatus(alias, status, 4000); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| +// counted wraps a cached resolver and records every name it is asked about. |
| +func counted(resolve func(string) ([]string, error), asked map[string]int) func(string) ([]string, error) { |
| + return func(h string) ([]string, error) { |
| + asked[h]++ |
| + return resolve(h) |
| + } |
| +} |
| + |
| +// #724 follow-up: a name that was not "pointing" before this pass is looked |
| +// at fresh FIRST, so the box's cached resolver never hears about it while |
| +// the record may not exist yet. A cached query would plant a "no such name" |
| +// in systemd-resolved and the VPC resolver for the SOA minimum, and the |
| +// cert issuer reads those caches. |
| +func TestStampHealthNewNameIsLookedAtFreshFirst(t *testing.T) { |
| + cases := []struct { |
| + name string |
| + fresh func(string) ([]string, error) |
| + want string |
| + }{ |
| + {"record absent", nxdomain, ""}, |
| + {"record pointing", pointingAt, "pointing"}, |
| + {"record elsewhere", func(string) ([]string, error) { return []string{"198.51.100.9"}, nil }, "elsewhere"}, |
| + } |
| + for _, tc := range cases { |
| + t.Run(tc.name, func(t *testing.T) { |
| + reg := regWithAlias(t, "shop.example.com") |
| + asked := map[string]int{} |
| + var calls []string |
| + // The cached resolver would say not-found, the primed answer. |
| + cfg := freshCfg(counted(func(h string) ([]string, error) { |
| + if h == "shop.example.com" { |
| + return nxdomain(h) |
| + } |
| + return pointingAt(h) |
| + }, asked), tc.fresh, &calls) |
| + if err := domains.StampHealth(context.Background(), reg, cfg, nil); err != nil { |
| + t.Fatal(err) |
| + } |
| + if got := aliasStatus(t, reg, "shop.example.com"); got != tc.want { |
| + t.Fatalf("alias dns_status = %q, want %q", got, tc.want) |
| + } |
| + if asked["shop.example.com"] != 0 { |
| + t.Fatalf("cached resolver asked about shop.example.com %d times, want 0", asked["shop.example.com"]) |
| + } |
| + if len(calls) != 1 || calls[0] != "shop.example.com" { |
| + t.Fatalf("fresh lookups = %v, want [shop.example.com]", calls) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +// Routes are stamped the same way as aliases: a custom-domain route that |
| +// was not pointing is looked at fresh first. |
| +func TestStampHealthNewRouteIsLookedAtFreshFirst(t *testing.T) { |
| + reg := regWith(t, registry.Route{Host: "shop.example.com", Kind: "service", Addr: "10.0.0.1:1", Status: "ready"}) |
| + asked := map[string]int{} |
| + var calls []string |
| + cfg := freshCfg(counted(nxdomain, asked), pointingAt, &calls) |
| + if err := domains.StampHealth(context.Background(), reg, cfg, nil); err != nil { |
| + t.Fatal(err) |
| + } |
| + if got := mustGet(t, reg, "shop.example.com").DNSStatus; got != "pointing" { |
| + t.Fatalf("route dns_status = %q, want pointing", got) |
| + } |
| + if asked["shop.example.com"] != 0 { |
| + t.Fatalf("cached resolver asked about shop.example.com %d times, want 0", asked["shop.example.com"]) |
| + } |
| +} |
| + |
| +// A fresh lookup that FAILS (no authority, backoff, timeout) decides |
| +// nothing: the cached path stamps exactly as it did before #724. |
| +func TestStampHealthFreshErrorFallsBackToCached(t *testing.T) { |
| + failing := func(string) ([]string, error) { return nil, errors.New("fresh dns: no authoritative answer") } |
| + cases := []struct { |
| + name string |
| + cached func(string) ([]string, error) |
| + want string |
| + }{ |
| + {"cached pointing", pointingAt, "pointing"}, |
| + {"cached not-found", nxdomain, ""}, |
| + {"cached elsewhere", func(string) ([]string, error) { return []string{"198.51.100.9"}, nil }, "elsewhere"}, |
| + {"cached failure", func(string) ([]string, error) { return nil, errors.New("SERVFAIL") }, "unresolved"}, |
| + } |
| + for _, tc := range cases { |
| + t.Run(tc.name, func(t *testing.T) { |
| + reg := regWithAlias(t, "shop.example.com") |
| + asked := map[string]int{} |
| + var calls []string |
| + cfg := freshCfg(counted(func(h string) ([]string, error) { |
| + if h == "shop.example.com" { |
| + return tc.cached(h) |
| + } |
| + return pointingAt(h) |
| + }, asked), failing, &calls) |
| + if err := domains.StampHealth(context.Background(), reg, cfg, nil); err != nil { |
| + t.Fatal(err) |
| + } |
| + if asked["shop.example.com"] != 1 { |
| + t.Fatalf("cached resolver asked about shop.example.com %d times, want 1", asked["shop.example.com"]) |
| + } |
| + if len(calls) != 1 { |
| + t.Fatalf("fresh lookups = %v, want exactly one (no second try in the upgrade)", calls) |
| + } |
| + if got := aliasStatus(t, reg, "shop.example.com"); got != tc.want { |
| + t.Fatalf("alias dns_status = %q, want %q", got, tc.want) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +// A name that was "pointing" is decided by the cached path, as before: a |
| +// positive cache entry is cheap and cannot be a primed miss. The upgrade |
| +// still re-raises a cached "" when the fresh look says pointing. |
| +func TestStampHealthPointingNameStaysCachedFirst(t *testing.T) { |
| + t.Run("cached pointing", func(t *testing.T) { |
| + reg := regWithAlias(t, "shop.example.com") |
| + stampAlias(t, reg, "shop.example.com", "pointing") |
| + asked := map[string]int{} |
| + var calls []string |
| + cfg := freshCfg(counted(pointingAt, asked), nxdomain, &calls) |
| + if err := domains.StampHealth(context.Background(), reg, cfg, nil); err != nil { |
| + t.Fatal(err) |
| + } |
| + if asked["shop.example.com"] != 1 || len(calls) != 0 { |
| + t.Fatalf("cached asked %d, fresh %v; want cached once and no fresh look", asked["shop.example.com"], calls) |
| + } |
| + if got := aliasStatus(t, reg, "shop.example.com"); got != "pointing" { |
| + t.Fatalf("alias dns_status = %q, want pointing", got) |
| + } |
| + }) |
| + t.Run("cached not-found, fresh pointing", func(t *testing.T) { |
| + reg := regWithAlias(t, "shop.example.com") |
| + stampAlias(t, reg, "shop.example.com", "pointing") |
| + asked := map[string]int{} |
| + var calls []string |
| + cfg := freshCfg(counted(func(h string) ([]string, error) { |
| + if h == "shop.example.com" { |
| + return nxdomain(h) |
| + } |
| + return pointingAt(h) |
| + }, asked), pointingAt, &calls) |
| + if err := domains.StampHealth(context.Background(), reg, cfg, nil); err != nil { |
| + t.Fatal(err) |
| + } |
| + if asked["shop.example.com"] != 1 { |
| + t.Fatalf("cached resolver asked about shop.example.com %d times, want 1 (cached first)", asked["shop.example.com"]) |
| + } |
| + if got := aliasStatus(t, reg, "shop.example.com"); got != "pointing" { |
| + t.Fatalf("alias dns_status = %q, want pointing re-raised", got) |
| + } |
| + }) |
| +} |
| + |
| +// Names past the per-pass fresh budget are stamped by the cached path, as |
| +// before. |
| +func TestStampHealthFreshFirstRespectsTheBudget(t *testing.T) { |
| + defer domains.SetFreshPassMax(1)() |
| + reg := regWithAlias(t, "a.example.com") |
| + if err := reg.UpsertAlias(registry.RouteAlias{Alias: "b.example.com", Host: "app.acct.oncarlos.test", Account: "acct", App: "app"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + asked := map[string]int{} |
| + var calls []string |
| + cfg := freshCfg(counted(pointingAt, asked), func(string) ([]string, error) { return []string{"198.51.100.9"}, nil }, &calls) |
| + if err := domains.StampHealth(context.Background(), reg, cfg, nil); err != nil { |
| + t.Fatal(err) |
| + } |
| + if len(calls) != 1 { |
| + t.Fatalf("fresh lookups = %v, want 1 (the budget)", calls) |
| + } |
| + freshName := calls[0] |
| + other := "a.example.com" |
| + if freshName == other { |
| + other = "b.example.com" |
| + } |
| + if asked[freshName] != 0 || asked[other] != 1 { |
| + t.Fatalf("cached asked %v; want none for %s and once for %s", asked, freshName, other) |
| + } |
| + if got := aliasStatus(t, reg, freshName); got != "elsewhere" { |
| + t.Fatalf("%s = %q, want elsewhere (fresh)", freshName, got) |
| + } |
| + if got := aliasStatus(t, reg, other); got != "pointing" { |
| + t.Fatalf("%s = %q, want pointing (cached)", other, got) |
| + } |
| +} |
| + |
| +// Apps-domain names (the platform's own zone) and names with no public |
| +// zone are never eligible: cached only, no fresh call. |
| +func TestStampHealthIneligibleNamesStayCached(t *testing.T) { |
| + reg := regWith(t, |
| + registry.Route{Host: "app.acct.oncarlos.test", Kind: "service", Addr: "10.0.0.1:1", Status: "ready"}, |
| + registry.Route{Host: "bot.app.acct.sidecar.internal", Kind: "service", Addr: "10.0.0.1:2", Status: "ready"}, |
| + ) |
| + asked := map[string]int{} |
| + var calls []string |
| + cfg := freshCfg(counted(pointingAt, asked), pointingAt, &calls) |
| + if err := domains.StampHealth(context.Background(), reg, cfg, nil); err != nil { |
| + t.Fatal(err) |
| + } |
| + if len(calls) != 0 { |
| + t.Fatalf("fresh lookups = %v, want none", calls) |
| + } |
| + for _, h := range []string{"app.acct.oncarlos.test", "bot.app.acct.sidecar.internal"} { |
| + if asked[h] != 1 { |
| + t.Fatalf("cached resolver asked about %s %d times, want 1", h, asked[h]) |
| + } |
| + } |
| +} |
diff --git a/internal/domains/freshdns_test.go b/internal/domains/freshdns_test.go| index 7d6fd2cd9..06dff5a54 100644 |
| --- a/internal/domains/freshdns_test.go |
| +++ b/internal/domains/freshdns_test.go |
| @@ -125,11 +125,33 @@ type world struct { |
| cnames map[string]string // name -> cached canonical name |
| mu sync.Mutex |
| dialed []string |
| + cached []string // every name the cached resolver was asked about, in order |
| +} |
| + |
| +// note records a cached-resolver query for name. |
| +func (w *world) note(name string) { |
| + w.mu.Lock() |
| + w.cached = append(w.cached, strings.TrimSuffix(name, ".")) |
| + w.mu.Unlock() |
| +} |
| + |
| +// cachedFor counts the cached-resolver queries sent for name. |
| +func (w *world) cachedFor(name string) int { |
| + w.mu.Lock() |
| + defer w.mu.Unlock() |
| + n := 0 |
| + for _, c := range w.cached { |
| + if c == name { |
| + n++ |
| + } |
| + } |
| + return n |
| } |
| func (w *world) resolver(now *time.Time) *domains.FreshResolver { |
| return &domains.FreshResolver{ |
| LookupNS: func(_ context.Context, name string) ([]*net.NS, error) { |
| + w.note(name) |
| hs, ok := w.ns[name] |
| if !ok { |
| return nil, errNotFound |
| @@ -141,12 +163,14 @@ func (w *world) resolver(now *time.Time) *domains.FreshResolver { |
| return out, nil |
| }, |
| LookupHost: func(_ context.Context, host string) ([]string, error) { |
| + w.note(host) |
| if a, ok := w.hosts[strings.TrimSuffix(host, ".")]; ok { |
| return a, nil |
| } |
| return nil, errNotFound |
| }, |
| LookupCNAME: func(_ context.Context, host string) (string, error) { |
| + w.note(host) |
| if c, ok := w.cnames[host]; ok { |
| return c, nil |
| } |
| @@ -528,3 +552,227 @@ func TestFreshResolverVerifiesTheSOAOwner(t *testing.T) { |
| t.Fatalf("Resolve = %v, want an error", ips) |
| } |
| } |
| + |
| +// #724 follow-up: the box's own lookups must never plant a "no such name" |
| +// for a hostname that does not exist yet. A cached query for the name |
| +// itself (any type: RFC 2308 caches NXDOMAIN per name) through |
| +// systemd-resolved and the VPC resolver would sit there for the zone's SOA |
| +// minimum, and the cert issuer reads those same caches. So the walk asks |
| +// the parent zones first and the cached resolver hears nothing about the |
| +// name while they answer. |
| +func TestFreshResolverNeverPrimesTheCacheForAMissingName(t *testing.T) { |
| + fa := startAuthority(t, "example.com", func(_ dnsmessage.Question, r *dnsmessage.Message) bool { |
| + r.Authoritative = true |
| + r.RCode = dnsmessage.RCodeNameError |
| + return true |
| + }) |
| + w := oneZone(fa) |
| + _, err := w.resolver(clock()).Resolve("shop.example.com") |
| + if !isNotFoundErr(err) { |
| + t.Fatalf("Resolve error = %v, want the authoritative not-found", err) |
| + } |
| + if n := w.cachedFor("shop.example.com"); n != 0 { |
| + t.Fatalf("cached resolver asked about shop.example.com %d times (%v), want 0", n, w.cached) |
| + } |
| +} |
| + |
| +func TestFreshResolverNeverAsksTheCacheAboutAPresentName(t *testing.T) { |
| + fa := startAuthority(t, "example.com", authoritative(cnameRecord("shop.example.com.", "edge.oncarlos.test."))) |
| + w := oneZone(fa) |
| + ips, err := w.resolver(clock()).Resolve("shop.example.com") |
| + if err != nil || len(ips) != 1 || ips[0] != edgeIP { |
| + t.Fatalf("Resolve = %v, %v; want [%s]", ips, err, edgeIP) |
| + } |
| + if n := w.cachedFor("shop.example.com"); n != 0 { |
| + t.Fatalf("cached resolver asked about shop.example.com %d times (%v), want 0", n, w.cached) |
| + } |
| +} |
| + |
| +// nameAfterParents fails unless every cached query for name came after the |
| +// last cached query for any other level of it: the parent walk is over |
| +// before the name itself is looked at. |
| +func nameAfterParents(t *testing.T, w *world, name string) { |
| + t.Helper() |
| + w.mu.Lock() |
| + defer w.mu.Unlock() |
| + firstName, lastParent := -1, -1 |
| + for i, c := range w.cached { |
| + switch { |
| + case c == name: |
| + if firstName < 0 { |
| + firstName = i |
| + } |
| + case strings.HasSuffix(name, "."+c): |
| + lastParent = i |
| + } |
| + } |
| + if firstName >= 0 && firstName < lastParent { |
| + t.Fatalf("cached query for %s before the parent walk finished: %v", name, w.cached) |
| + } |
| +} |
| + |
| +// The custom domain is a zone apex with its own A records. No enclosing |
| +// zone below the TLD exists to ask, so the name itself is tried as a zone. |
| +// An apex exists before anyone can attach it, so that query primes nothing. |
| +func TestFreshResolverResolvesAnApex(t *testing.T) { |
| + fa := startAuthority(t, "example.com", authoritative(aRecord("example.com.", edgeIP))) |
| + w := oneZone(fa) |
| + ips, err := w.resolver(clock()).Resolve("example.com") |
| + if err != nil || len(ips) != 1 || ips[0] != edgeIP { |
| + t.Fatalf("Resolve = %v, %v; want [%s]", ips, err, edgeIP) |
| + } |
| +} |
| + |
| +// shop.example.co.uk is its own zone. example.co.uk's servers only refer |
| +// down (no authority), so the walk falls through to the name itself, and |
| +// only after every parent level has been tried. |
| +func TestFreshResolverResolvesADelegatedSubZoneApex(t *testing.T) { |
| + parent := startAuthority(t, "example.co.uk", func(_ dnsmessage.Question, r *dnsmessage.Message) bool { |
| + // A referral: no authority, the child's NS in the authority section. |
| + r.Authorities = []dnsmessage.Resource{{ |
| + Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("shop.example.co.uk."), Type: dnsmessage.TypeNS, Class: dnsmessage.ClassINET, TTL: 300}, |
| + Body: &dnsmessage.NSResource{NS: dnsmessage.MustNewName("ns.shop.example.co.uk.")}, |
| + }} |
| + return true |
| + }) |
| + child := startAuthority(t, "shop.example.co.uk", authoritative(aRecord("shop.example.co.uk.", edgeIP))) |
| + w := &world{ |
| + ns: map[string][]string{ |
| + "example.co.uk": {"ns.example.co.uk."}, |
| + "shop.example.co.uk": {"ns.shop.example.co.uk."}, |
| + }, |
| + hosts: map[string][]string{ |
| + "ns.example.co.uk": {"192.0.2.20"}, |
| + "ns.shop.example.co.uk": {"192.0.2.21"}, |
| + }, |
| + routes: map[string]*fakeAuthority{"192.0.2.20:53": parent, "192.0.2.21:53": child}, |
| + } |
| + ips, err := w.resolver(clock()).Resolve("shop.example.co.uk") |
| + if err != nil || len(ips) != 1 || ips[0] != edgeIP { |
| + t.Fatalf("Resolve = %v, %v; want the sub-zone's own answer", ips, err) |
| + } |
| + if parent.queries.Load() == 0 { |
| + t.Fatal("the parent zone was never asked") |
| + } |
| + nameAfterParents(t, w, "shop.example.co.uk") |
| +} |
| + |
| +// The parent zone's servers are silent: the walk still reaches the name |
| +// itself, after the parents, and the whole lookup stays inside Timeout. |
| +func TestFreshResolverFallsToTheNameWhenParentsAreSilent(t *testing.T) { |
| + silent := startAuthority(t, "example.com", nil) |
| + child := startAuthority(t, "shop.example.com", authoritative(aRecord("shop.example.com.", edgeIP))) |
| + w := &world{ |
| + ns: map[string][]string{ |
| + "example.com": {"ns1.example.com."}, |
| + "shop.example.com": {"ns.shop.example.com."}, |
| + }, |
| + hosts: map[string][]string{ |
| + "ns1.example.com": {"192.0.2.53"}, |
| + "ns.shop.example.com": {"192.0.2.54"}, |
| + }, |
| + routes: map[string]*fakeAuthority{"192.0.2.53:53": silent, "192.0.2.54:53": child}, |
| + } |
| + r := w.resolver(clock()) |
| + start := time.Now() |
| + ips, err := r.Resolve("shop.example.com") |
| + if took := time.Since(start); took > r.Timeout+500*time.Millisecond { |
| + t.Fatalf("Resolve took %s, past Timeout %s", took, r.Timeout) |
| + } |
| + if err != nil || len(ips) != 1 || ips[0] != edgeIP { |
| + t.Fatalf("Resolve = %v, %v; want the name's own zone's answer", ips, err) |
| + } |
| + if silent.queries.Load() == 0 { |
| + t.Fatal("the parent zone was never asked") |
| + } |
| + nameAfterParents(t, w, "shop.example.com") |
| +} |
| + |
| +// With every parent level silent and nothing at the name either, the walk |
| +// gives up within Timeout. |
| +func TestFreshResolverSilentEverywhereStaysInsideTimeout(t *testing.T) { |
| + silent := startAuthority(t, "", nil) |
| + w := &world{ |
| + ns: map[string][]string{ |
| + "a.b.example.com": {"ns.a.b.example.com."}, |
| + "b.example.com": {"ns.b.example.com."}, |
| + "example.com": {"ns.example.com."}, |
| + "x.a.b.example.com": {"ns.x.example.com."}, |
| + }, |
| + hosts: map[string][]string{ |
| + "ns.a.b.example.com": {"192.0.2.1", "192.0.2.2"}, |
| + "ns.b.example.com": {"192.0.2.3", "192.0.2.4"}, |
| + "ns.example.com": {"192.0.2.5", "192.0.2.6"}, |
| + "ns.x.example.com": {"192.0.2.7"}, |
| + }, |
| + routes: map[string]*fakeAuthority{}, |
| + } |
| + for _, a := range []string{"192.0.2.1:53", "192.0.2.2:53", "192.0.2.3:53", "192.0.2.4:53", "192.0.2.5:53", "192.0.2.6:53", "192.0.2.7:53"} { |
| + w.routes[a] = silent |
| + } |
| + r := w.resolver(clock()) |
| + start := time.Now() |
| + if _, err := r.Resolve("x.a.b.example.com"); err == nil { |
| + t.Fatal("Resolve against silent servers succeeded") |
| + } |
| + if took := time.Since(start); took > r.Timeout+500*time.Millisecond { |
| + t.Fatalf("Resolve took %s, past Timeout %s", took, r.Timeout) |
| + } |
| +} |
| + |
| +// The name-itself attempt has its own allowance: parents that use up |
| +// freshMaxZones (each with an NS set, none holding the name) do not stop |
| +// the walk from trying the name as its own zone. |
| +func TestFreshResolverTriesTheNameAfterTheZoneBudget(t *testing.T) { |
| + refusing := startAuthority(t, "", func(_ dnsmessage.Question, r *dnsmessage.Message) bool { |
| + r.RCode = dnsmessage.RCodeRefused |
| + return true |
| + }) |
| + child := startAuthority(t, "x.a.b.c.example.com", authoritative(aRecord("x.a.b.c.example.com.", edgeIP))) |
| + w := &world{ |
| + ns: map[string][]string{ |
| + "a.b.c.example.com": {"ns.p.example.net."}, |
| + "b.c.example.com": {"ns.p.example.net."}, |
| + "c.example.com": {"ns.p.example.net."}, |
| + "example.com": {"ns.p.example.net."}, |
| + "x.a.b.c.example.com": {"ns.x.example.net."}, |
| + }, |
| + hosts: map[string][]string{ |
| + "ns.p.example.net": {"192.0.2.30"}, |
| + "ns.x.example.net": {"192.0.2.31"}, |
| + }, |
| + routes: map[string]*fakeAuthority{"192.0.2.30:53": refusing, "192.0.2.31:53": child}, |
| + } |
| + ips, err := w.resolver(clock()).Resolve("x.a.b.c.example.com") |
| + if err != nil || len(ips) != 1 || ips[0] != edgeIP { |
| + t.Fatalf("Resolve = %v, %v; want the name's own zone's answer", ips, err) |
| + } |
| +} |
| + |
| +// A parent level the cache knows to be an alias is still skipped: its |
| +// (silent) servers are never dialled. |
| +func TestFreshResolverSkipsAnAliasedParent(t *testing.T) { |
| + silent := startAuthority(t, "oldprovider.net", nil) |
| + right := startAuthority(t, "example.com", authoritative(aRecord("www.shop.example.com.", edgeIP))) |
| + w := &world{ |
| + ns: map[string][]string{ |
| + "shop.example.com": {"ns.oldprovider.net."}, |
| + "example.com": {"ns1.example.com."}, |
| + }, |
| + hosts: map[string][]string{ |
| + "ns.oldprovider.net": {"192.0.2.9", "192.0.2.10"}, |
| + "ns1.example.com": {"192.0.2.53"}, |
| + }, |
| + routes: map[string]*fakeAuthority{"192.0.2.9:53": silent, "192.0.2.10:53": silent, "192.0.2.53:53": right}, |
| + cnames: map[string]string{"shop.example.com": "old-provider.net."}, |
| + } |
| + ips, err := w.resolver(clock()).Resolve("www.shop.example.com") |
| + if err != nil || len(ips) != 1 || ips[0] != edgeIP { |
| + t.Fatalf("Resolve = %v, %v; want [%s]", ips, err, edgeIP) |
| + } |
| + for _, d := range w.dialed { |
| + if d != "192.0.2.53:53" { |
| + t.Fatalf("dialled %v, want only the real zone's server", w.dialed) |
| + } |
| + } |
| +} |
diff --git a/internal/domains/reconcile.go b/internal/domains/reconcile.go| index 61f120601..09fad0293 100644 |
| --- a/internal/domains/reconcile.go |
| +++ b/internal/domains/reconcile.go |
| @@ -42,7 +42,7 @@ type Config struct { |
| // Resolve is the DNS seam (net resolver in production, a fake in |
| // tests); nil skips DNS stamping entirely. |
| Resolve func(host string) ([]string, error) |
| - // ResolveFresh asks without any cache (#724); see freshUpgrade. nil |
| + // ResolveFresh asks without any cache (#724); see dnsVerdicts. nil |
| // leaves every verdict to Resolve alone. |
| ResolveFresh func(host string) ([]string, error) |
| // AcmeDir is the edge's autocert DirCache directory; "" skips TLS |
| @@ -498,21 +498,15 @@ func StampHealth(ctx context.Context, reg *registry.Registry, cfg Config, routes |
| // "pointing" — refusing that news would be the same lie in the |
| // opposite direction. |
| routeStatus := make([]string, len(routes)) |
| - for i, rt := range routes { |
| - routeStatus[i] = dnsStatus(cfg.Resolve, rt.Host, edge) |
| - } |
| aliasStatus := make([]string, len(aliases)) |
| - for i, a := range aliases { |
| - aliasStatus[i] = dnsStatus(cfg.Resolve, a.Alias, edge) |
| - } |
| var candidates []freshCandidate |
| for i, rt := range routes { |
| - candidates = append(candidates, freshCandidate{rt.Host, &routeStatus[i]}) |
| + candidates = append(candidates, freshCandidate{rt.Host, rt.DNSStatus, &routeStatus[i]}) |
| } |
| for i, a := range aliases { |
| - candidates = append(candidates, freshCandidate{a.Alias, &aliasStatus[i]}) |
| + candidates = append(candidates, freshCandidate{a.Alias, a.DNSStatus, &aliasStatus[i]}) |
| } |
| - freshUpgrade(cfg, edge, candidates) |
| + dnsVerdicts(cfg, edge, candidates) |
| for i, rt := range routes { |
| status := routeStatus[i] |
| if status == unresolvedDNS && rt.DNSStatus != "" { |
| @@ -587,10 +581,11 @@ func dnsStatus(resolve func(host string) ([]string, error), host string, edge ma |
| return "elsewhere" |
| } |
| -// freshCandidate is one name section 4 stamps and the verdict the cached |
| -// lookup gave it, which freshUpgrade may raise in place. |
| +// freshCandidate is one name section 4 stamps: its stamp before this pass |
| +// (prev) and where dnsVerdicts writes this pass's verdict. |
| type freshCandidate struct { |
| host string |
| + prev string |
| status *string |
| } |
| @@ -604,59 +599,92 @@ var ( |
| freshPassTime = 30 * time.Second |
| ) |
| -// freshUpgrade gives a customer hostname that does not point here yet a |
| -// second, uncached look (#724). |
| +// dnsVerdicts sets each candidate's verdict for section 4, from the cached |
| +// resolver (cfg.Resolve) and, for customer hostnames, an uncached look |
| +// (cfg.ResolveFresh, #724). |
| // |
| -// The cached answer is the box's resolver's, and that resolver holds a |
| -// "no such name" for the zone's SOA minimum: a customer who attaches a |
| -// hostname and then adds the record (the order attach prints) is read as |
| -// "" for 30 minutes to a day after the record went live, and the alias stays |
| -// unpublished all that time. A customer moving a name from another host has |
| -// the same wait on the old record's TTL ("elsewhere"). |
| +// A name that was NOT "pointing" before this pass is looked at fresh |
| +// FIRST, and the cached resolver is not asked about it at all unless the |
| +// fresh look fails. The customer attaches a hostname and then adds the |
| +// record (the order attach prints), so such a name may not exist yet, and |
| +// a cached query for it would plant a "no such name" in systemd-resolved |
| +// and the VPC resolver behind it for the zone's SOA minimum. The cert |
| +// issuer gates its orders on those same caches; if nothing of ours asks |
| +// them about the name before it exists, its first lookup after the record |
| +// goes live is a clean miss. The fresh verdicts are the cached path's: |
| +// addresses including an edge are "pointing", other addresses |
| +// "elsewhere", an authoritative not-found "". A fresh FAILURE (no |
| +// authority, backoff, timeout) decides nothing and the cached path stamps |
| +// as it always has. |
| // |
| -// The fresh answer may only UPGRADE a verdict to "pointing". Every other |
| -// fresh result (no record, another address, a failure) leaves the cached |
| -// verdict as it was, so this path can never unpublish anything or turn an |
| -// answer into "unresolved". A cached lookup that FAILED is left alone too: |
| +// A name that WAS "pointing" keeps the cached-first path: a positive cache |
| +// entry is cheap and cannot be a primed miss. Its fresh look may only |
| +// UPGRADE a cached "" or "elsewhere" to "pointing" (the cached answer can |
| +// lag a moved record by its TTL); any other fresh result leaves the cached |
| +// verdict as it was. So the fresh path can never unpublish a name: it |
| +// decides the verdict only for names that were not "pointing" before this |
| +// pass, and a published name stays decided by the cached path plus that |
| +// upgrade, as before. A cached lookup that FAILED is not upgraded either: |
| // that is our resolver's fault, handled by section 4's hold-last-verdict |
| -// rule. Names under the apps domain are the platform's own zone, and names |
| -// with no possible public zone (sidecar hosts under .internal) have nothing |
| -// to ask; neither is eligible, so neither takes a share of the budget. |
| +// rule. |
| // |
| -// Eligible names are visited in a random order and the pass stops after |
| +// Names under the apps domain are the platform's own zone, and names with |
| +// no possible public zone (sidecar hosts under .internal) have nothing to |
| +// ask; neither is eligible, so neither takes a share of the budget, and |
| +// both are stamped by the cached path alone. Eligible names share one |
| +// budget, visited in a random order: the pass stops looking fresh after |
| // freshPassMax lookups or freshPassTime, so a large backlog is worked |
| -// through across passes instead of stretching any one of them. |
| -func freshUpgrade(cfg Config, edge map[string]bool, candidates []freshCandidate) { |
| - if cfg.ResolveFresh == nil { |
| - return |
| - } |
| +// through across passes instead of stretching any one of them. A |
| +// not-pointing name past the budget gets the cached look, as before #724. |
| +func dnsVerdicts(cfg Config, edge map[string]bool, candidates []freshCandidate) { |
| apps := strings.ToLower(cfg.AppsDomain) |
| - var eligible []freshCandidate |
| + eligible := func(host string) bool { |
| + h := strings.ToLower(strings.TrimSuffix(host, ".")) |
| + return cfg.ResolveFresh != nil && freshPublicName(h) && |
| + (apps == "" || (h != apps && !strings.HasSuffix(h, "."+apps))) |
| + } |
| + // Fresh-first names wait for the budget loop; everything else gets its |
| + // cached verdict now, and a published name the cache does not read as |
| + // pointing joins the loop for an upgrade. |
| + var pending []freshCandidate |
| for _, c := range candidates { |
| - if *c.status != "" && *c.status != "elsewhere" { |
| + if !eligible(c.host) { |
| + *c.status = dnsStatus(cfg.Resolve, c.host, edge) |
| continue |
| } |
| - h := strings.ToLower(strings.TrimSuffix(c.host, ".")) |
| - if !freshPublicName(h) || (apps != "" && (h == apps || strings.HasSuffix(h, "."+apps))) { |
| + if c.prev != "pointing" { |
| + *c.status = unresolvedDNS |
| + pending = append(pending, c) |
| continue |
| } |
| - eligible = append(eligible, c) |
| + *c.status = dnsStatus(cfg.Resolve, c.host, edge) |
| + if *c.status == "" || *c.status == "elsewhere" { |
| + pending = append(pending, c) |
| + } |
| } |
| - rand.Shuffle(len(eligible), func(i, j int) { eligible[i], eligible[j] = eligible[j], eligible[i] }) |
| + rand.Shuffle(len(pending), func(i, j int) { pending[i], pending[j] = pending[j], pending[i] }) |
| start := time.Now() |
| - for n, c := range eligible { |
| + for n, c := range pending { |
| if n >= freshPassMax || time.Since(start) >= freshPassTime { |
| + // Out of budget: a fresh-first name falls back to the cached |
| + // look; an upgrade candidate keeps its cached verdict. |
| + for _, rest := range pending[n:] { |
| + if rest.prev != "pointing" { |
| + *rest.status = dnsStatus(cfg.Resolve, rest.host, edge) |
| + } |
| + } |
| return |
| } |
| - ips, err := cfg.ResolveFresh(c.host) |
| - if err != nil { |
| - continue |
| - } |
| - for _, ip := range ips { |
| - if edge[ip] { |
| + fresh := dnsStatus(cfg.ResolveFresh, c.host, edge) |
| + switch { |
| + case c.prev == "pointing": |
| + if fresh == "pointing" { |
| *c.status = "pointing" |
| - break |
| } |
| + case fresh == unresolvedDNS: |
| + *c.status = dnsStatus(cfg.Resolve, c.host, edge) |
| + default: |
| + *c.status = fresh |
| } |
| } |
| } |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 794583fe8..8706a8e04 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -144,3 +144,4 @@ plan14-root-reads-deploy-edge-718.tsv 250e3ba91e1bc5fcd6be5cc2bafce4c7d6645d2d2f |
| plan14-root-reads-demo-slice-adopt.tsv 707018faaa1fee3b47abb78389ae7854264e76621cc316889061adb69bf13e10 |
| plan14-root-reads-security-review-mitigations.tsv a6f3f9eec4aac5ea88f20d0e52eaa0651fce80c0d49b60883ff61ceade33d288 |
| plan14-root-reads-cli-registry-words.tsv 8924fafc5b6083858a72f45c764081abe3bcad6a6de71901470586c076c64bb6 |
| +plan14-root-reads-no-negative-prime-724.tsv f7eb15fc80af393e7da87f84e5b9bd8fe4803ffed533cfedf209a92dd53910ec |
diff --git a/internal/provision/testdata/plan14-root-reads-no-negative-prime-724.tsv b/internal/provision/testdata/plan14-root-reads-no-negative-prime-724.tsv| new file mode 100644 |
| index 000000000..5f5e32de3 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-no-negative-prime-724.tsv |
| @@ -0,0 +1,5 @@ |
| +# Census overlay no-negative-prime-724, written by census-propose (#369). census-ruling-no-negative-prime-724, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-no-negative-prime-724.md. |
| +# 0 body, 1 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +@legacy f632b5dfb6bece081019d31d35a6268a227e0d4289455a9266b0f996f6392bf2 internal/domains/reconcile.go StampHealth legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-dns-fresh-lookup-724;basis=section 4 now computes every cached verdict first, then freshUpgrade gives up to 64 randomly ordered names that could have a public zone (not under the apps domain, not special-use like .internal) and whose verdict is "" or "elsewhere" an uncached lookup (30 s pass budget) that may only upgrade to "pointing", then stamps; the extra sites are the indexed loops over the same rows (#724);rev3=census-ruling-no-negative-prime-724;basis=section 4 now hands each route and alias, with its previous stamp (the two new registry:DNSStatus reads, rt.DNSStatus and a.DNSStatus, same rows already listed), to dnsVerdicts: a name not "pointing" before this pass and eligible for a fresh lookup (public name, not under the apps domain, ResolveFresh set) is looked at uncached first within the same 64-lookup/30 s budget and stamped from it (edge address "pointing", other "elsewhere", authoritative not-found ""), falling back to the cached lookup on a fresh error or past the budget; a previously "pointing" name keeps cached-first plus the upgrade-only fresh look, so the fresh path still never unpublishes; no new file, path or command input; the dropped Alias/Host/Route/RouteAlias sites are the old indexed loops folded into the candidate build (#724) registry:Alias@3172,registry:Alias@3700,registry:Alias@3790,registry:Alias@4224,registry:Alias@4288,registry:Alias@4376,registry:DNSStatus@3053,registry:DNSStatus@3181,registry:DNSStatus@3349,registry:DNSStatus@3624,registry:Host@3044,registry:Host@3421,registry:Host@3505,registry:Host@3993,registry:Host@4052,registry:Host@4134,whole:Route@199,whole:Route@236,whole:Route@2871,whole:Route@2984,whole:Route@3277,whole:Route@3947,whole:RouteAlias@2917,whole:RouteAlias@3111,whole:RouteAlias@3551,whole:RouteAlias@4177,whole:RouteAlias@780 8a40c0797f5e0dd2598359a130eeea4e7770fc4208d1b20d501143dd9925549f |
| +internal/domains/reconcile.go StampHealth legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-dns-fresh-lookup-724;basis=section 4 now computes every cached verdict first, then freshUpgrade gives up to 64 randomly ordered names that could have a public zone (not under the apps domain, not special-use like .internal) and whose verdict is "" or "elsewhere" an uncached lookup (30 s pass budget) that may only upgrade to "pointing", then stamps; the extra sites are the indexed loops over the same rows (#724);rev3=census-ruling-no-negative-prime-724;basis=section 4 now hands each route and alias, with its previous stamp (the two new registry:DNSStatus reads, rt.DNSStatus and a.DNSStatus, same rows already listed), to dnsVerdicts: a name not "pointing" before this pass and eligible for a fresh lookup (public name, not under the apps domain, ResolveFresh set) is looked at uncached first within the same 64-lookup/30 s budget and stamped from it (edge address "pointing", other "elsewhere", authoritative not-found ""), falling back to the cached lookup on a fresh error or past the budget; a previously "pointing" name keeps cached-first plus the upgrade-only fresh look, so the fresh path still never unpublishes; no new file, path or command input; the dropped Alias/Host/Route/RouteAlias sites are the old indexed loops folded into the candidate build (#724) registry:Alias@3172,registry:Alias@3700,registry:Alias@3790,registry:Alias@4224,registry:Alias@4288,registry:Alias@4376,registry:DNSStatus@3053,registry:DNSStatus@3181,registry:DNSStatus@3349,registry:DNSStatus@3624,registry:Host@3044,registry:Host@3421,registry:Host@3505,registry:Host@3993,registry:Host@4052,registry:Host@4134,whole:Route@199,whole:Route@236,whole:Route@2871,whole:Route@2984,whole:Route@3277,whole:Route@3947,whole:RouteAlias@2917,whole:RouteAlias@3111,whole:RouteAlias@3551,whole:RouteAlias@4177,whole:RouteAlias@780 8a40c0797f5e0dd2598359a130eeea4e7770fc4208d1b20d501143dd9925549f |
| +@coverage internal/domains 168f90d4623a3ac1863b7241f49e28272f4a05cd0cab6b14699101c6a88dc83a |