Expand description
COUNTS COME FROM EFFECTS — a change is counted only when a write landed.
★ THE DEFECT. A tick reports how many objects it changed, and every
site used to count the same way: propose a command, ? the transport
error, add one. The ResourceOp the store sent back was never read,
so a write the store answered with “nothing happened” was reported as a
change:
- GC deleting an orphan that bears a finalizer, with no clock to stamp
(the store leaves the object untouched:
NoOp), counted one change per tick, forever; - a delete of an object already gone (
NoOp) counted one; write_status_casread onlyConflict, so a status patch the store REFUSED (PatchRejected,ApplyConflict) came back asWritten;- a datapath removal whose error was discarded (
let _ = remove) counted one.
★ THE SHAPE.
Effect::ofreads the op by an exhaustive match with no wildcard, so a newResourceOpvariant does not compile (E0004) until someone says whether it changed the catalog.Effect::appliedis the same answer for a datapath backend (a router, an enforcer, a DNS table):Oklanded, and the error goes back to the caller uncounted.crate::ReconcileReport::recordcounts anEffect;ObjectOutcome::from(Effect)turns one into a sweep outcome.Landedhas no public constructor.ObjectOutcome::Changedholds one, so a sweep cannot report an object as changed without anEffectthat said a write landed.
Tier-honest, by path:
- Sweep (
crate::Sweep): reporting an objectChangedwithout aLandedis a compile error. ALandedis minted only by a named constructor that says where the answer came from (Effect::of,Effect::applied,Effect::answered); passing one a made-up answer (answered(true),applied(Ok(()))) compiles and is caught only by review. - Legacy counter (
ReconcileReportbuilt by hand):objects_changedis still a public field, because the kubelet and the scheduler (outside this crate) still write it directly. A bare write anywhere in the workspace’ssrc/is CI-caught, not a type:tests/t1_8_counts_come_from_effects.rsallows onlycrate::ReconcileReport::recordand the sweep conversion, and holds the not-yet-migrated kubelet and scheduler sites to a ceiling. When those reach zero the field goes private and that gate is deleted.
Structs§
- Landed
- Proof that a write landed. Its field is private:
Effect::of,Effect::appliedandEffect::answeredare the only ways to get one, and each names the answer it read (a store op, a backend result, a table’s reply). Holding aLandedmeans one of those said so.
Enums§
- Effect
- What one write did — to the store’s catalog, or to a datapath backend.
- Refusal
- Why the store refused a write. One arm per refusing
ResourceOp.