Skip to content

update-l2-reporting: return a structured planes-added/removed summary, not just a raw positional diff #3038

Description

@jwhartley

Problem

/admin/update-l2-reporting returns doc::diff(proposed, current) of the L2 derivation specs (crates/control-plane-api/src/server/update_l2_reporting.rs, Response { diff }). That diff is effectively unreviewable for a routine single-plane change, and operators have stopped meaningfully checking it ("we're at a scale now where we kinda have to just trust that it works").

Three sources of noise dominate the output, so a one-plane add/remove produces a multi-hundred-line diff:

  1. Positional diff of a set. Each derivation's transforms are semantically a set keyed by data plane, but doc::diff compares arrays by index. Adding or removing one plane shifts every later transform's index, so each shifted slot reports name and source as "changed."
  2. Backfill counter churn. The endpoint regenerates every transform with backfill: 0; it doesn't track the live backfill counter, and the control plane reconciles the prior value. So backfill diff entries appear on essentially every call and are non-semantic.
  3. Disable churn. Transforms are generated with disable: !enable_l2, so every plane with enable_l2=false always diffs even though nothing meaningful changed.

(There is also expected module regeneration of the derivation TS, and currently an l2_stats vs l2_stats_new migration in flight, both of which add to the volume.)

What operators actually need

The only semantic question a dry run can answer is set-based: which data planes are added or removed as L2 sources? That is what you confirm before applying (exactly the plane you intend is added; nothing is unexpectedly removed). A wrong/missing plane is the real failure mode, since removing a still-live plane's L1 source can 500 the L2 rollups.

Today that answer is only recoverable by set-diffing the transform source collections out of the noise. That works but is fragile, because the diff omits unchanged positions, so boundary entries can produce false adds/removes.

Proposal

Compute the set difference server-side, where both full specs are in hand, and add it to the response:

{
  "diff": [...],                     // keep for debugging
  "planes_added":   ["ops/rollups/L1/<plane>/...", ...],
  "planes_removed": [...]
}

derived from the transform sources of proposed vs current. This is structurally immune to the index-shift artifact and gives operators a one-line "adds N, removes M" verdict to sanity-check before dryRun=false.

References

  • Endpoint: crates/control-plane-api/src/server/update_l2_reporting.rsResponse { diff }, built via doc::diff(next, previous); transforms generated with backfill: 0 and disable: !enable_l2.
  • Standing operator complaint that the diff is no longer reviewable at current data-plane count.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions