[ENG-3999] Support IPv6 filer resolvers in drive mounts - #260
[ENG-3999] Support IPv6 filer resolvers in drive mounts#260SystemSculpt wants to merge 1 commit into
Conversation
🧪 Testing GuideWhat this PR addressesSandbox drive mounts failed on IPv6-only environments because Steps to reproduce the original issue
What to verify (expected behavior)
Note Posted by PR Testing Guide · Tag @mendral-app with feedback. |
|
✅ Linked to Linear issue ENG-3999 — status already In Progress. Note Posted by Linear Issue Enforcer · Tag @mendral-app with feedback. |
🔀 Interaction FlowHere's a sequence diagram showing how the drive mount components interact after this change: sequenceDiagram
participant Caller as Mount Handler
participant GFA as getFilerAddress()
participant PFA as parseFilerAddress()
participant RC as /etc/resolv.conf
participant NIP as net/netip.ParseAddr()
participant FMT as formatFilerServerAddress()
participant SW as SeaweedFS (blfs)
Caller->>GFA: getFilerAddress()
GFA->>PFA: parseFilerAddress(resolvConfPath)
PFA->>RC: Read resolv.conf lines
RC-->>PFA: nameserver entries + directives
loop Each resolv.conf line
PFA->>PFA: Match "nameserver" directive
PFA->>NIP: ParseAddr(candidate)
NIP-->>PFA: valid IPv4/IPv6 or error
Note over PFA,NIP: Supports IPv4, IPv6, and zoned IPv6
end
PFA-->>GFA: filer IP address (string)
GFA-->>Caller: filer address
Caller->>FMT: formatFilerServerAddress(addr)
FMT-->>Caller: "addr:49200.49201"
Note over FMT: SeaweedFS host:http.grpc format<br/>(IPv6 left unbracketed—SW adds brackets)
Caller->>SW: exec blfs mount -filer=addr:49200.49201
SummaryThe PR refactors the filer address resolution into two focused functions:
Previously, validation relied on splitting by Note Posted by PR Sequence Diagram · Tag @mendral-app with feedback. |
There was a problem hiding this comment.
LGTM
The change is correct and well-tested. The critical assumption—that SeaweedFS splits on the last colon in its host:http.grpc format—makes the unbracketed IPv6 representation safe (e.g., 2600:1f14:c75:3900::301:49200.49201 splits cleanly because the port segment 49200.49201 contains no colon). The netip.ParseAddr canonicalization is a strict improvement over the old dot-count heuristic. Test coverage is thorough.
Tag @mendral-app with feedback or questions. View session
|
Parking this pending owner review — @cploujoux, this is in your lane (ENG-3999), so handing it over rather than merging it myself. What is verified:
What is NOT verified, and why I stopped:
Pod One thing to weigh before merging: a push to |
Summary
host:http.grpcaddress format for both address familiesRoot cause
Sandbox drive mounts treated the first resolver in
/etc/resolv.confas the filer, but validated it by requiring four dot-separated components. Current Blaxel sandboxes receive IPv6-only resolver addresses (for example2600:1f14:c75:3900::301), so the parser rejected the valid filer address beforeblfscould start. The SDK integration failures were downstream symptoms of that sandbox-api defect.The change uses
netip.ParseAddrinstead of an IPv4 shape check. It keeps the raw IPv6 literal in SeaweedFS'shost:http.grpcrepresentation; SeaweedFS splits on the final colon and brackets the host when it constructs HTTP and gRPC endpoints.Verification
GOTOOLCHAIN=go1.25.0 SHELL=/bin/sh go test -count=1 ./...GOTOOLCHAIN=go1.25.0 go test -race -count=1 ./src/handler/driveGOTOOLCHAIN=go1.25.0 go vet ./...GOTOOLCHAIN=go1.25.0 GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build ./...The test matrix proves the former IPv6 input now resolves while IPv4 behavior remains unchanged. Drive listing already splits mount sources at the final colon, so IPv6 mount sources remain compatible there as well.
Scope
This changes only filer-address discovery and formatting for drive mounts. It does not change DNS injection, networking, drive authorization, retries, or error suppression.
Linear: ENG-3999
Note
Replaces IPv4-only nameserver validation with
netip.ParseAddrto support both IPv4 and IPv6 filer addresses, extractsparseFilerAddressfor testability, and adds a comprehensive test suite covering both address families and edge cases.Written by Mendral for commit 26e3793.