Repository navigation
Closed
Description
Parent: Deliver Galactic Worker with Local and Fabric delivery for tenant services
Deliverable
External VIP traffic reaches a local or remote backend selected by Maglev and returns directly to the client (DSR). It satisfies the NLB part of the "Deliver service consumers" phase exit.
References:
- Datapath:
internal/plumbing/ebpf/edgeprog/edgedsr.c(edge_lb,edge_return). - Maglev:
internal/maglev,internal/gateway/kerneldatapath.go(buildMaglevTable,KernelDatapath.ApplyRule). - Attach:
cmd/galactic-gateway/gateway.go(joinDispatcher,attachDirect) andinternal/plumbing/ebpf/edgeattach(ResolveTargets). - Backend SID:
internal/plumbing/srv6/usid.go(ComputeBackendSID,BackendSlot).
#1411 (allocated backend SIDs) is related and does not block this Task. This Task works with today's hashed BackendSlot and must not prevent a later switch to allocated SIDs.
Work items
- Add backend destination resolution to Worker. Implement Worker reconciliation and its authenticated service API #1433 ships the backend destination kind as
Resolved=False/DestinationKindUnsupported; this Task replaces that with resolution from the gateway's backend SID and locator, and documents the source indocs/worker/contract.md. - Apply locality after the shared Maglev selection. Implement the dispatcher-claimed local handoff at each public RX path, keeping backend SID and translation bindings. Keep the existing remote encapsulation path.
- Coordinate NAT and gateway dispatcher claims on the shared NIC (slots
SlotGatewayLB,SlotGatewayReturn,SlotNAT). - Verify the DSR reverse binding, port restoration, public next hop and public-service policy on TAP ingress.
- Define per-family withdrawal when handoff coverage fails, including bond member changes and client-facing aggregate routes.
- Expose the gateway's Worker capability state and failure reasons through existing gateway diagnostics and metrics.
Dependencies
Blocked by #1434, #1435 and #1436. Runs in parallel with #1437, #1439 and #1440.
Acceptance
Run in the #1432 topology with external clients only:
- IPv4 and IPv6 VIPs carry TCP and UDP for every combination of gateway placement and local or remote backend placement. Each request reaches the correct TAP, and each public reply carries the VIP and service port.
- When a hook or a public neighbor is removed, captures show the withdrawal, the change in actual ingress reachability, and isolation from default NAT.
- The lab checks
verify:gateway,verify:gateway-ingress,verify:gateway-ingress-ipv4andverify:gateway-restartstill pass. - The delivering PR targets
integration/galactic-worker, carries this evidence and saysFixes datum-cloud/galactic#1438. GitHub does not auto-close from a non-default base, so close this issue explicitly when the PR merges and record the PR and merged SHA.
Activity
privateip commentedon Nov 19, 2026
Triage
Valid on
integration/galactic-workerat 0967308, confirmed by reading the source:resolveDestinationanswers every backend destination withDestinationKindUnsupported(internal/worker/reconcile.go).edge_lbalways encapsulates toward the backend SID (lb_forwardininternal/plumbing/ebpf/edgeprog/edgedsr.c), so a backend on the gateway's own node is never reached through the Local handoff.local_rxaccepts IPv6 only and applies no VIP translation, andlocal_meta.hcarries only the TAP, so a Local delivery could not keep the backend SID or its translation binding.Plan
Backend resolver. Worker resolves a
BackendRef{node, slot}from the BoundServiceVIPBindingthat galactic-router wrote for that node, whereBackendSlot(backendAddress, backendPort)equals the slot. The binding's target attachment supplies the VPC, TAP and addresses, andBGPRoutersupplies the node's locator. Worker recomputes the backend SID and takes nothing from the request. The backend resolves to Local on this node and to Fabric anywhere else. If the binding isn't Bound, or two bindings share a slot, the destination reports why. #1411 later changes only the slot lookup.Locality after Maglev. Every gateway keeps the same Maglev table. After a backend is selected, a per-node map from backend SID to TAP decides where it goes:
edge_lbhands off to Local through dispatcher metadata (version 2: TAP plus backend SID) and returnsXDP_PASS.The gateway fills the map only from Worker claim status that reports Ready.
local_rxthen:vip_xlat_tablerowusid_ingressuses, keyed on the slot (with SIIT for IPv4 VIPs);DSR return (D43). A guest's reply takes the existing VIP branch of
usid_egress:public_uplink_tablebefore anyegress_route_tablelookup.So a reply needs neither a default pass-through nor a Local branch in
usid_egress, and never reaches default NAT.Local backend not Ready. Worker never falls back from Local to Fabric. A Local backend whose handoff isn't Ready is reported through the existing backend-health mechanism, so it leaves Maglev selection on every gateway, as an unhealthy backend does today. Until that converges, its flows are dropped and counted (
DROP_REASON_LOCAL_UNAVAILABLE), and the VIP stays served.Per-family withdrawal (D44). Only a loss of public-path coverage withdraws anything: a public target losing load-balancer coverage (bond members included), or no
public_uplink_tablerow for a family. The gateway then withdraws that family's advertisement for each affected rule. A covering client-facing aggregate is reported asAggregateStillAttracts; the gateway doesn't suppress it.Dispatcher sharing. Gateway (
SlotGatewayLB,SlotGatewayReturn) and NAT (SlotNAT) keep separate slots and leases on the shared NIC. A root test checks that releasing either side leaves the other serving.Diagnostics. Gateway conditions and metrics report the Worker capability state, the Local handoff state and withdrawn families.
Lab. Combined placement is guests hosted on the gateway edge nodes (dfw-worker2, dfw-worker3). Compute workers (dfw-worker, dfw-worker4) host remote backends only; the gateway doesn't run on compute workers. The new check covers IPv4 and IPv6 VIPs over TCP and UDP from external clients, with every gateway placed against a local backend, the other edge node's backend and both compute workers' backends. It also shows:
The existing gateway checks are rerun.
Tests. Worker resolver unit tests,
edge_lb-to-TAP and reply root tests (IPv4 and IPv6, TCP and UDP), dispatcher slot sharing, backend-health feed and per-family withdrawal controller tests, plustask ciand the root suite.privateip commentedon Nov 19, 2026
Deviations from the approved plan
The coordinator has approved both.
public_uplink_tablehas no next hop, the gateway reports every backend on its node as not ready in NetworkGatewaystatus.localBackends, with reasonPublicUplinkMissing. galactic-router then publishesLocalHandoffNotReadyfor those backends, so every gateway takes them out of Maglev selection. This is in addition to the planned per-family withdrawal (D44). Those backends' replies leave through that single next hop, so they fail whichever gateway selected them.local_rxin the same resync pass that reads it back, so removing that hook never shows up as not ready. The lab therefore checks a different thing for each failure:local_rx: Worker repairs it within its resync, and no flow to the affected backend is encapsulated in the meantime.LocalHandoffNotReady, leaves selection on every gateway, the VIP is still served by its other backends, and the backend recovers.Two further points:
verify:gateway-localalso withdraws that aggregate for the family under test, through a lab-only fixture, so the change in actual ingress reachability is visible. The gateway cannot see aggregates originated in FRR config, soAggregateStillAttractsonly reports covering BGPAdvertisements.GALACTIC_GATEWAY_BACKEND_HEALTHbeing on for every gateway. Without it, the gateway only drops that backend's flows.privateip commentedon Nov 21, 2026
Draft PR #1474, stacked on #1461.
fix(worker): Run local_rx on bond members, ahead of the bond's tcx
privateip commentedon Nov 22, 2026
Delivered by #1474, merged into
integration/galactic-workeras e97daf7. The lab evidence for each acceptance bullet is on the PR. The change also fixes a Worker Local defect found during the lab runs: the public receive program sat behind a cluster CNI's tcx program on the bond master.docs(worker): Record the Worker API decisions made in #1433
fix(worker): Run local_rx on bond members, ahead of the bond's tcx
docs(worker): Record the Worker API decisions made in #1433
fix(worker): Run local_rx on bond members, ahead of the bond's tcx
docs(worker): Record the Worker API decisions made in #1433
fix(worker): Run local_rx on bond members, ahead of the bond's tcx