diff --git a/docs/netlink/events-export-status.md b/docs/netlink/events-export-status.md index 858429d45..be0f77f40 100644 --- a/docs/netlink/events-export-status.md +++ b/docs/netlink/events-export-status.md @@ -22,7 +22,11 @@ `gen/` targets; the conversion (`pkg/xtcp/events_export_convert.go`) and the round-trip gate over every committed event pcap and crafted blob (458 link, 165 addr, 303 route, 107 neigh, 10 rule — all five families, - the totals pinned). Next: Tier EXD, the destination. + the totals pinned). Tier EXD is designed, its constraints measured in the + tree before written (see the decision log): the Handler interface carries + no nlmsghdr, Run's startup Snapshot is resync state the export must not + emit, and the destinations' factories are single-dest. Next: Tier EXD, the + destination. ## Contents @@ -45,7 +49,7 @@ |---|---|---|---|---| | [Tier EXM](events-export.md#tier-exm-the-policy-measured) | the constants, measured from the corpora | EXM-T02 | done | V403 | | [Tier EXP](events-export.md#tier-exp-the-proto) | the messages, the generation, the conversion | EXP-T02 | done | V404 | -| [Tier EXD](events-export.md#tier-exd-the-destination) | the producer, the config, the self-test gate | EXD-T03 | not started | — | +| [Tier EXD](events-export.md#tier-exd-the-destination) | the producer, the config, the self-test gate | EXD-T03 | in progress (designed, V404's findings) | — | | [Tier EXC](events-export.md#tier-exc-clickhouse) | the table, the topic, the flavor | EXC-T03 | not started | — | | [Tier EXU](events-export.md#tier-exu-the-close) | §14 resolved, the deferrals unwound | EXU-T01 | not started | — | @@ -74,6 +78,27 @@ ## Decision log +- **2026-12-04: EXD designed against three measured constraints (V404's + groundwork).** (1) `rtnlmon`'s `Handler.Event(ev any)` carries no + nlmsghdr — the wrapper's nlmsg_seq/nlmsg_pid (the originating process's + echo, the §13 note's own trap) vanish at the interface. The fix: an + optional header-carrying interface (`EventHdr(h, ev)`) the walk already + can hand the handler — it holds the header at the dispatch point. (2) + `Run` delivers a startup Snapshot (drain-then-dump resync); the export's + handler no-ops it — a namespace's whole table at startup is not events. + (3) The destinations' factories are single-dest — every one reads the + record's `-dest` at build (`newFileDest`, `newKafkaDest`), so a second + instance for `-eventsDest` cannot resolve through the registry as the + plan first said. The v1 exporter owns the file sink (the self-test + gate's destination); the factory generalization is EXC's measured need. + And the namespace question: the events listener needs an in-namespace + thread (a socket in the root namespace sees no other namespace's + notifications), and `netNamespaceInstance`'s wait-thread hosts one + listener — the locality fold when `-localityEvents` is on. The both-on + composition (the union of groups on one socket, the snapshot to the + fold alone) is the plan's own "shared listener" follow-up, promoted to + v1's design if the second in-namespace thread measures as a cost. + - **2026-12-04: the nests are presence bits, not payloads (EXP, V404).** The structs decode forty per-kind link nests and five route nests; the export's v1 carries their presence and the kind strings, not their payloads — each diff --git a/docs/netlink/events-export.md b/docs/netlink/events-export.md index 71c504537..cc1c7e8a6 100644 --- a/docs/netlink/events-export.md +++ b/docs/netlink/events-export.md @@ -230,22 +230,31 @@ producer and read the boot's own numbers back. #### EXD-T01: the producer -A second `rtnlmon` consumer per monitored - namespace (the `-localityEvents` wiring pattern: the injected `run`, the - off-by-default flag), whose Handler converts each event and appends to the - events envelope. Flush on rows cap, bytes cap, the time interval (armed like - the s3 staleness timer — the record path's cycle is the only trigger events - do not have) and shutdown; the constants are EXM's. The producer Sends the - marshaled rows (the ProtobufList wire — each row a message, no wrapper on - the wire, the record path's own form) through the existing `Destination` - registry: no destination code changes, and the bounded drop-oldest queue - answers the slow-sink question the same way it does for records. +The design is measured against three constraints the plan's first shape did +not survive (the status doc's decision log): a `rtnlmon` consumer per +monitored namespace, on the namespace's own in-namespace thread (the +`-localityEvents` wiring pattern: the injected `run`, the off-by-default +flag). Its Handler no-ops Run's startup Snapshot (the drain-then-dump is +resync state, not events — the export must not emit a namespace's whole +table at startup), and its Event is the header-carrying variant `rtnlmon` +gains for this: an optional interface, the existing walk hands the handler +the `nlmsghdr` it already holds at the dispatch point, so the wrapper's +nlmsg_seq/nlmsg_pid — the originating process's echo, the §13 note's own +trap — reach the export instead of vanishing at the interface. Flush on +rows cap, bytes cap, the time interval (armed like the s3 staleness timer +— the record path's cycle is the only trigger events do not have) and +shutdown; the constants are EXM's. + #### EXD-T02: the config and the flag -`-eventsEnable` with - `events_enable`, `-eventsDest` with `events_dest` (a destinations URL, - resolved through the same registry), and the three flush knobs, defaults - from EXM. The record path's flags, config and behavior untouched. +`-eventsEnable` with `events_enable`, `-eventsDest` with `events_dest` +(a destinations URL), and the three flush knobs, defaults from EXM. The +record path's flags, config and behavior untouched. The registry's +factories are single-dest — every one reads the record's `-dest` at build +(`newFileDest`, `newKafkaDest`), so a second instance for `-eventsDest` +cannot resolve through the registry as the plan first said: the v1 +exporter owns the file sink (the self-test gate's destination), and the +factory generalization is EXC's measured need, not this arc's refactor. #### EXD-T03: the gate The self-test's rtnl flavor grows