Skip to content

Integrate Gateway Maglev selection and direct server return #1438

Open

Description

@privateip

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) and internal/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 in docs/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-ipv4 and verify:gateway-restart still pass.
  • The delivering PR targets integration/galactic-worker, carries this evidence and says Fixes 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions