Skip to content

fix(gateway): gate file-region adaptation on Unix - #1622

Merged
houseme merged 5 commits into
mainfrom
p9/9517-windows-file-fallback
Nov 19, 2026
Merged

houseme merged 5 commits into
mainfrom
p9/9517-windows-file-fallback

Conversation

@houseme

@houseme houseme commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The response adapter calls Unix-only file-region methods from its portable entry point. Windows builds of consumers such as rustfs/rustfs#9521 fail with two E0599 errors. Keep the file-copy implementation on Unix and return the existing response directly on platforms where Body has no file-region variant.

Refs rustfs/rustfs#9517 and rustfs/rustfs#9521.

The CI follow-up registers suites already present in the Gateway and HTTP integration targets, trims redundant service and rendering documentation to meet the existing file limits while keeping the guarded code and tests in their original locations, and updates the test-only ZIP dependency to 9.0.5. The response stamper transfers the formatted Date buffer to the header, keeping the warm request allocation budget intact.

Verification

  • Cross-checked the library with cargo +stable check --locked -p rustfs-gateway --no-default-features --target x86_64-pc-windows-msvc --lib. The base raised both E0599 errors, and the fixed library compiled.

  • All three file_fallback::tests passed. Replacing the ordinary response with an empty response made the new assertion fail with a 200 and empty body where it expects the original 206 and bytes.

  • The initial Windows revision reproduced the upstream GetObject allocation failure at 105 blocks against a ceiling of 104. The CI follow-up passes the existing allocation test with 104.0 blocks per GetObject and 109.01 per PutObject with the existing half-block tolerance. Upstream baseline

  • With Rust 1.97.1 on Linux, formatting, workspace Clippy with -D warnings, workspace tests, and cargo xtask verify --crate rustfs-gateway passed. The consolidation and target-coverage mutation suites passed 116 and 32 cases respectively. The file-size, module-documentation, handler-deadline and response-encoding guards also passed on the final layout. The configuration snapshot guard passed its positive controls and rejected a second allowlisted load.

  • The workspace dependency policy and AWS SDK Rust driver advisory checks pass. The policy allows RUSTSEC-2026-0543 because the pinned S3 compatibility baselines require chrono and the maintenance advisory has no patched release. RustSec advisory

Role Verdicts

  • simplicity-adversary: attacked Windows response passthrough, Unix file transfer, Date header byte preservation, and missing or duplicate test registration — no break found

Breaking Change

  • BREAKING — this PR touches a protected file or changes a public contract.

Checklist

  • The four-command gate passed (fmt, clippy, test, cargo xtask verify)
  • New or changed public API has rustdoc
  • Negative test cases outnumber positive ones
  • Every new assertion was mutated — the implementation was broken on purpose and the assertion went red. The PR description names which ones
  • No Protected File touched
  • No unsafe introduced
  • No inventory / linkme introduced
  • No #[non_exhaustive] added to a DTO
  • No s3s code copied
  • No credentials, signatures, or expected-signature values reachable from logs or error bodies
  • No plan document, analysis report, or working note committed
  • Commits follow Conventional Commits and the PR title fits within 72 characters
  • A Handoff comment has been appended to the issue

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the platform-specific response adaptation change.

No open issues 🎉

What changed in this PR

Fixes Windows consumer builds by keeping Unix-only file-region adaptation out of the gateway’s portable response path.

Changes:

  • Gates file-copy helpers and related imports on Unix.
  • Returns responses unchanged on non-Unix platforms.
  • Adds a test verifying that ordinary responses retain their status and body bytes.
File Description
crates/​gateway/​src/​file_fallback.rs Adds platform-specific adaptation and a response-preservation test.

Review effort: Balanced

@houseme
houseme merged commit d32f172 into main Nov 19, 2026
34 checks passed
@houseme
houseme deleted the p9/9517-windows-file-fallback branch November 19, 2026 18:00
RamakrishnaChilaka added a commit to RamakrishnaChilaka/rustfs that referenced this pull request Nov 19, 2026
…k cfg

Pulls in rustfs/gateway#1622 (d32f17219d75989167a05183dd3d04922615cbd5) which gates Unix-only file-region adaptation in rustfs-gateway so Windows Startup Smoke compiles cleanly.
overtrue pushed a commit to rustfs/rustfs that referenced this pull request Nov 19, 2026
…9498)

* perf(ecstore): trim redundant syscalls in multipart part preparation

Use io_get_object_open_path in the advisory clean-source cache probe, reuse validated part-path prefixes when constructing MultipartSourceAdmission in prepare_part_transaction, and create new.meta before snapshotting absent old-part markers so old.data.absent and old.meta.absent share new.meta's inode via linkat.

* test(ecstore): guard marker inode identity check on hardlink support

Probe hardlink support in the test fixture before asserting that old.data.absent and old.meta.absent share new.meta's inode, and assert empty fallback markers when hardlinking is unsupported.

* chore(storage): remove unused test helper PostObjectFormPolicy::with_metadata

Commit 5e55549 removed the last caller in rustfs/src/storage/access.rs, leaving with_metadata unused under #[cfg(test)].

* fix(rustfs): align control-plane speedtest, rebalance logging, and admin/auth tests

Register streaming PostV3SpeedtestClientDevnull on the gateway control-plane host, log error diagnostics on corrupt rebalance metadata loads, avoid 43-char OIDC parent key collisions in s3_extension_tests, align AddUser gate test with 88b90c1, and split auth.rs at mod tests.

* chore(deps): bump rustfs-gateway to d32f1721 for Windows file-fallback cfg

Pulls in rustfs/gateway#1622 (d32f17219d75989167a05183dd3d04922615cbd5) which gates Unix-only file-region adaptation in rustfs-gateway so Windows Startup Smoke compiles cleanly.

---------

Co-authored-by: Hauser Zhi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants