14 KiB
Rust Volume Server Parity Implementation Plan
Objective
Implement a native Rust volume server that replicates Go volume-server behavior for HTTP and gRPC APIs, so it can become a drop-in replacement validated by existing integration suites.
Current Focus (2026-02-16)
- Program focus is now Rust implementation parity, not broad test expansion.
test/volume_serveris treated as the parity gate.- Existing Rust launcher modes (
exec,proxy) are transition tools; they are not the final target.
Current Status
- Rust crate and launcher are in place.
- Integration harness can run:
- Go master + Go volume (default)
- Go master + Rust launcher (
VOLUME_SERVER_IMPL=rust)
- Rust launcher
proxymode has full-suite integration pass while delegating backend handlers to Go. - Rust launcher
nativemode is wired as the default Rust entrypoint and currently bootstraps via supervised Go backend delegation. - Native Rust HTTP handlers now serve control/surface paths in
nativemode:/status,/healthzOPTIONSadmin/public behavior (method allow-list + CORS preflight headers)/ui/index.htmlwith config-driven JWT/access-ui gating/favicon.icoand/seaweedfsstatic/*- public non-read methods (
POST/PUT/DELETE/unsupported verbs) as200no-op passthrough parity - admin unsupported verbs as
400parity
- Native Rust control-surface parity now also includes:
/healthzstatus mirroring from backend state transitions (e.g. leave/stopping =>503)- absolute-form HTTP request-target normalization before native route matching
- Native Rust HTTP data-path prevalidation now includes:
- early malformed vid/fid rejection (
400) for GET/HEAD/POST/PUT fid-route shapes before delegation - slash-form fid-route parsing for
/{vid}/{fid}and/{vid}/{fid}/{filename}with reserved-path exclusions (/status,/healthz,/ui/index.html,/stats/*, static assets) - write-path error prevalidation for fid routes:
- malformed multipart form-data requests without a boundary =>
400 - requests containing
Content-MD5header =>400mismatch parity branch - request bodies exceeding configured
-fileSizeLimitMB(byContent-Length) =>400
- malformed multipart form-data requests without a boundary =>
- early malformed vid/fid rejection (
- Native Rust API/storage handlers are not implemented yet.
Parity Exit Criteria
- Native mode passes:
env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/httpenv VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/grpc
- CI runs native Rust mode integration coverage (at least smoke, then expanded shards).
- Rust mode defaults to native behavior for integration harness.
- Go-backend delegation is removed (or retained only as explicit fallback mode).
Architecture Workstreams
A. Runtime and Configuration Parity
- Add
nativeruntime mode inweed-volume-rs(bootstrap delegation path). - Parse and honor volume-server CLI/config flags used by integration harness:
- network/bind ports (
-ip,-port,-port.grpc,-port.public) - master target/config dir/read mode/throttling/JWT-related config
- size/timeout controls and maintenance state defaults
- network/bind ports (
- Implement graceful lifecycle behavior (signals, shutdown, readiness).
B. Native HTTP Surface
- Admin/control endpoints:
GET /status(native Rust innativemode)GET /healthz(native Rust innativemode)OPTIONSadmin/public method+CORS control behavior (native Rust innativemode)- static/UI endpoints currently exercised
- Data read path parity:
- fid parsing/path variants
- conditional headers (
If-Modified-Since,If-None-Match) - range handling (single/multi/invalid)
- deleted reads, auth checks, read-mode branches
- chunk-manifest and compression/image transformation branches
- Data write/delete parity:
- write success/unchanged/error paths
- replication and file-size-limit paths
- delete and chunk-manifest delete branches
- Method/CORS/public-port parity for split admin/public behavior.
C. Native gRPC Surface
- Control-plane RPCs:
GetState,SetState,VolumeServerStatus,Ping,VolumeServerLeave- admin lifecycle: allocate/mount/unmount/delete/configure/readonly/writable
- Data RPCs:
ReadNeedleBlob,ReadNeedleMeta,WriteNeedleBlobBatchDelete,ReadAllNeedles- sync/copy/receive and status endpoints
- Stream RPCs:
- tail sender/receiver
- vacuum streams
- query streams
- Advanced families:
- erasure coding RPC set
- tiering/remote fetch
- scrub/query mode matrix
D. Storage Compatibility Layer
- Implement volume data/index handling compatible with Go on-disk format.
- Preserve cookie/checksum/timestamp semantics used by tests.
- Match read/write/delete consistency and error mapping behavior.
- Ensure EC metadata/data-path compatibility with existing files.
E. Operational Hardening
- Deterministic startup/readiness and shutdown semantics.
- Log/error parity sufficient for debugging and CI triage.
- Concurrency/timeout behavior alignment for throttling and streams.
- Performance baseline checks vs Go for key flows.
Milestone Plan
M0 (Completed): Harness + Launcher Transition
- Rust launcher integrated into harness.
- Proxy mode full-suite validation with Go backend delegation.
M1: Native Skeleton (Control Plane First)
nativemode boots and serves:/status,/healthzGetState,SetState,VolumeServerStatus,Ping,VolumeServerLeave
- Gate:
- targeted HTTP/grpc control tests pass in
nativemode (delegated backend path).
- targeted HTTP/grpc control tests pass in
M2: Native Core Data Paths
- Native HTTP read/write/delete baseline parity.
- Native gRPC data baseline parity (
Read/WriteNeedle*,BatchDelete,ReadAllNeedles). - Gate:
- core HTTP and gRPC data suites pass in
nativemode.
- core HTTP and gRPC data suites pass in
M3: Native Stream + Copy/Sync
- Tail/copy/receive/sync paths in native mode.
- Gate:
- stream/copy families pass in
nativemode.
- stream/copy families pass in
M4: Native Advanced Feature Families
- EC, tiering, scrub/query advanced branches.
- Gate:
- full
/test/volume_server/httpand/test/volume_server/grpcpass innativemode.
- full
M5: CI/Cutover
- Add/expand native-mode CI jobs (smoke matrix includes
native). - Make native mode default for Rust integration runs.
- Keep
exec/proxyonly as explicit fallback modes during rollout.
Immediate Next Steps
- Implement minimal native gRPC state/ping RPC handlers (
GetState,SetState,VolumeServerStatus,Ping,VolumeServerLeave). - Expand native HTTP parity from control/static surface into data-path handlers (read/write/delete variants) while preserving current native control behavior.
- Keep rerunning native-mode integration suites as each delegated branch is replaced.
- Add mismatch triage notes for each API moved from delegation to native implementation.
Risk Register
- On-disk format mismatch risk:
- Mitigation: implement format-level compatibility tests early (idx/dat/needle encoding).
- Behavioral drift in edge branches:
- Mitigation: use integration suite failures as primary truth; only add tests for newly discovered untracked branches.
- Stream/concurrency semantic mismatch:
- Mitigation: stabilize with focused interruption/timeout parity tests.
Progress Log
-
Date: 2026-02-15
-
Change: Added Rust launcher integration (
exec) and harness wiring. -
Validation: Rust launcher mode passed smoke and full integration suites while delegating to Go backend.
-
Commits:
7beab85c2,880c2e1da,63d08e8a9,d402573ea,3bd20e6a1,6ce4d7ede -
Date: 2026-02-15
-
Change: Added Rust proxy supervisor mode and validated full integration suite.
-
Validation:
env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=proxy go test -count=1 ./test/volume_server/httpenv VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=proxy go test -count=1 ./test/volume_server/grpc
-
Commits:
a7f50d23b,548b3d9a3 -
Date: 2026-02-16
-
Change: Re-focused plan from test expansion to native Rust implementation parity.
-
Validation basis: latest Rust proxy full-suite pass keeps regression baseline stable while native implementation starts.
-
Commits:
14c863dbf -
Date: 2026-02-16
-
Change: Added native Rust launcher mode bootstrap, set Rust launcher default mode to
native, and expanded CI Rust smoke matrix to includenative. -
Validation:
env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/httpenv VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/grpcenv VOLUME_SERVER_IMPL=rust go test -count=1 ./test/volume_server/http -run '^TestAdminStatusAndHealthz$'env VOLUME_SERVER_IMPL=rust go test -count=1 ./test/volume_server/grpc -run '^TestStateAndStatusRPCs$'
-
Commits:
70ddbee37,61befd10f,2e65966c0 -
Date: 2026-02-16
-
Change: Implemented first native Rust HTTP handlers in
nativemode for/statusand/healthzon the admin listener while preserving proxy delegation for other APIs. -
Validation:
env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http -run '^TestAdminStatusAndHealthz$'env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/httpenv VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/grpc
-
Commits:
7e6e0261a -
Date: 2026-02-16
-
Change: Implemented native Rust
OPTIONShandling for admin and public listeners innativemode, including method allow-list and origin-driven CORS response parity used by integration tests. -
Validation:
env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http -run '^TestOptionsMethodsByPort$|^TestOptionsWithOriginIncludesCorsHeaders$'env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/httpenv VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/grpc
-
Commits:
fbff2cb39 -
Date: 2026-02-16
-
Change: Added native Rust UI/static/public-surface handlers in
nativemode:/ui/index.htmlwith config-driven JWT/access-ui gating parity/favicon.icoand/seaweedfsstatic/*static endpoint parity- public non-read methods as
200no-op passthrough parity - admin unsupported methods as
400parity
-
Validation:
env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http -run '^TestAdminStatusAndHealthz$|^TestUiIndexNotExposedWhenJwtSigningEnabled$|^TestUiIndexExposedWhenJwtSigningEnabledAndAccessUITrue$|^TestStaticAssetEndpoints$|^TestStaticAssetEndpointsOnPublicPort$'env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http -run '^TestOptionsMethodsByPort$|^TestOptionsWithOriginIncludesCorsHeaders$|^TestPublicPortReadOnlyMethodBehavior$|^TestCorsAndUnsupportedMethodBehavior$|^TestUnsupportedMethodTraceParity$|^TestUnsupportedMethodPropfindParity$|^TestUnsupportedMethodConnectParity$|^TestUnsupportedMethodMkcolParity$'env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/httpenv VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/grpc
-
Commits:
23e4497b2 -
Date: 2026-02-16
-
Change: Hardened native Rust HTTP control-path parity:
/healthznow mirrors backend health status (200/503) in native mode- absolute-form request-target parsing (e.g.
GET http://host/path HTTP/1.1) now normalizes to route path parity
-
Validation:
env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http -run '^TestAdminStatusAndHealthz$'env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http/...env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/grpc/...
-
Commits:
d6ff6ed6d -
Date: 2026-02-16
-
Change: Added native malformed fid-route validation in
nativemode:- GET/HEAD/POST/PUT requests matching fid URL shapes now return Rust-native
400 Bad Requestfor invalid vid/fid tokens - valid fid-route requests still delegate to backend handlers for storage/data execution paths
- GET/HEAD/POST/PUT requests matching fid URL shapes now return Rust-native
-
Validation:
env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http -run '^TestInvalidReadPathReturnsBadRequest$|^TestWriteInvalidVidAndFidReturnBadRequest$|^TestMalformedVidFidPathReturnsBadRequest$|^TestDownloadLimitInvalidVidWhileOverLimitReturnsBadRequest$'env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http/...env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/grpc/...
-
Commits:
1ce0174b2 -
Date: 2026-02-16
-
Change: Added native Rust write-path prevalidation branches for fid routes in
nativemode:- multipart form uploads without boundary now return native
400 Content-MD5requests now return native400mismatch branchContent-Lengthover configured-fileSizeLimitMBnow returns native400limit branch
- multipart form uploads without boundary now return native
-
Validation:
env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http -run '^TestUploadReadRangeHeadDeleteRoundTrip$|^TestWriteMalformedMultipartAndMD5Mismatch$|^TestWriteRejectsPayloadOverFileSizeLimit$'env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http/...env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/grpc/...
-
Commits:
94cefd6f4 -
Date: 2026-02-16
-
Change: Broadened native fid-route parser to cover slash-form URLs:
/{vid}/{fid}and/{vid}/{fid}/{filename}now flow through native malformed vid/fid validation- added explicit non-fid exclusions for control/stats/static paths to preserve route parity
-
Validation:
env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http -run '^TestAdminStatusAndHealthz$|^TestReadPathShapesAndIfModifiedSince$|^TestMalformedVidFidPathReturnsBadRequest$'env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/http/...env VOLUME_SERVER_IMPL=rust VOLUME_SERVER_RUST_MODE=native go test -count=1 ./test/volume_server/grpc/...
-
Commits:
e66983e9b