Commit Graph

1188 Commits

Author SHA1 Message Date
icediceice 8863d2ddd0 fix(quota): let v1 recounts survive concurrent writes (#9789)
A v1 hard-quota bucket under steady writes could stay full after deletes: deletes give no credit, and every recount was dropped when a reservation was pending at its seed or any writer saved the ledger during its walk. Zero-growth overwrites save the ledger too.

On a single-pool store a recount now stores a scan_seed token at its seed and remembers the seed balance minus pending growth. If the token survives, it publishes the scan plus all growth admitted since the seed. Only reserve and abort move the v1 balance, so the write path is unchanged and the result can only over-count. Pending reservations and the reap cursor are kept; reconcile_required is cleared only when no writer saved since the seed.

The recount now sums usage over walk_authoritative, so all versions of a key come from one metadata entry; the paged version listing could skip a suspended null overwrite that re-sorted ahead of its version marker.

A recount is scheduled on every denial whose growth fits the limit and when an admission crosses 90% of it. Admission compares in u128, so a stale balance near u64::MAX is a quota denial, not corruption.

Multi-pool stores and mismatched or missing ledgers keep the strict path, since pool moves publish versions without a reservation. scan_seed is omitted while idle, so the ledger format is unchanged for older nodes, and an older node's rewrite drops it, which discards the in-flight recount. The vector maintenance quota observer accepts scan_seed in its strict ledger schema.

Co-authored-by: icediceice <icediceice@users.noreply.github.com>
2026-11-30 21:17:55 +08:00
cxymds c09643a2d9 feat(obs): export remote tier inventory and 24h transition gauges (#9803) 2026-11-30 20:35:53 +08:00
GatewayJ f6cee83802 docs(rdma): align NIXL and cuObject guides with flags and contracts (#9802)
Update NIXL, cuObject, and S3-over-RDMA architecture documentation to match current Cargo feature flags, environment defaults, wire contracts, passive client-window invariants, and GPUDirect Storage cufile.json configuration.
2026-11-30 20:35:37 +08:00
RustFS 54779fa132 feat(pools): add maintenance mode, config/preflight checks, and zero-downtime live hot-reload (#9755)
* feat(pools): add maintenance mode, config/preflight checks, and zero-downtime live hot-reload

* fix(admin): restrict pool check/preflight to DecommissionAdminAction and harden audit logging

* fix(pools): harden security, pending-commit retry convergence, cutover isolation, and subsystem handoff

* feat(gateway): bump rustfs/gateway pin to ac50e9af and mount pool hot-reload native routes

* style(ecstore): sort conditional import in local commit module

* fix(ecstore): replace Error::other(format!) in pool reload with stable typed errors

* test(pools): avoid literal PEM header in non-env config redaction test
2026-11-29 23:51:14 +08:00
GatewayJ 0b7988c37d feat: add S3 Vectors service integration (#9476)
* feat(vector): integrate S3 Vectors catalog and APIs

Add scoped Vector resources, managed Lance storage, IAM checks, and
Gateway REST JSON operations with compatibility and recovery tests.

* fix(vector): adapt owned requests and preserve native quota errors

* test(ci): exercise Vector KMS archive consumers

* feat(vector): add maintenance and recovery workflows

* test(multipart): assert typed quota refusal causes

Verify the retained quota cause and its current and limit values alongside the existing refusal-order assertions. Remove the retired authentication compatibility entry after the main rebase.

* fix(vector): move maintenance dispatch guard ownership

Retain the namespace guard in the returned maintenance owner. Synchronize Gateway dependencies for corpus recording and format the existing audit test in its external module.

* feat(vector): add shared pagination sessions

* fix(vector): bound managed request and catalog futures

* test(vector): adapt managed fixtures to Gateway request envelopes

* test(vector): verify maintenance across uniform deployments

* test: simplify SSE-C counting and Catalog fixture ownership

* fix(test): propagate owned device validation errors

* fix(auth): bound early authorization futures

* feat(vector): complete resource pagination and bucket retirement

* fix(vector): harden bucket lifecycle, retirement, authz, and layering

Preserve continuous bucket incarnation fencing across Vector bucket Catalog parent initialization, map deleted-bucket races during DeleteVectorBucket to NotFoundException, and re-evaluate IAM, resource policies, and ABAC bucket tags inside the storage bucket lock across all five Vector bucket mutations.

Scale used-bucket Catalog retirement proof, plan, and execution linearly across multi-resource multi-page histories, sweep uncommitted pre-authority page artifacts before rewriting authority records, enforce manifest completeness and immutable delete-intent source-copy identity, and allow same-name recreation over v4 deleted Vector tombstones.

Make ListVectorBuckets and ListIndexes resilient to concurrent deletions with single-pass bucket authorization and bounded sparse-prefix scan budgets, preserve literal plus characters when decoding UntagResource tagKeys query parameters to match Gateway SigV4 canonicalization, and normalize operation-scoped Kms*Exception codes across all 21 S3 Vectors APIs.

Extract ManagedLanceObjects into app::vector_usecase::managed_objects, inject background node admission into Vector maintenance startup to eliminate the app-composition cycle, and widen scripts/check_layer_dependencies.sh to detect inline reverse-layer crate paths while recording the 12 pre-existing non-Vector inline edges from main in scripts/layer-dependency-baseline.txt (backlog#1834) with zero Vector exemptions.

* chore(vector): remove Batch 1 dead code and test debug residue

* chore(vector): remove Batch 2 dead test code and gate test-only APIs

* refactor(vector,iam): simplify dead branches and pass-through wrappers

* fix(object,test): bound PutObject futures and cover reconciled routes

* feat(vector,object,connect): activate S3 Vectors and fix CI regressions

* test(object,vector): fix copy future size check and vector dispatch test
2026-11-29 18:07:23 +08:00
唐小鸭 fc3a216725 fix(ecstore,sse): close m-compatible interop gaps and rename feature (#9684)
* fix(ecstore,sse): close rio-v2 interop gaps on imported drive sets

A rio-v2 build that takes over a drive set written in the compatible format could not start once a KMS was configured, and several object reads and writes disagreed with what the other server stores or expects.

- Startup: the IAM migration now opens KMS-sealed IAM records. The record path is part of the key context, so the migration callback receives it, and the context text is escaped the way it was sealed.
- GET of a single-part encrypted object: whether an object holds one cipher stream per part is read from the marker the object records, not guessed from the ETag length. A sealed ETag is longer than an MD5 and sent these objects down the per-part path, which failed authentication.
- ETag: a sealed ETag is opened for GET and HEAD responses.
- HEAD: the public SSE headers are derived from the stored sealing metadata, and the KMS key id is answered in ARN form on GET and HEAD.
- Content length: an object sealed under an object key records no plaintext size when it is a single-part upload; the size is derived from the stored size of its parts.
- Compression: the compression and actual-size keys are also written in the casing the other server looks up.
- User metadata is stored under the x-amz-meta- prefix so it comes back as user metadata on both sides. Keys starting with "internal-" keep their bare form, because the prefixed form falls into a namespace reads hide.
- Replication: the metadata comparison skips the prefixed user metadata, which the target's HEAD answers without the prefix and which therefore never compared equal.
- ListObjectVersions and the metadata listing extension report the plaintext size of encrypted and compressed versions. This is the only intended behaviour change in a default build.

Three differences stay as they are: the other server cannot read SSE-S3 objects this build writes, listings do not open sealed ETags, and an SSE-KMS write is refused when only a static master key is configured.

Each fix has a regression test that fails without it.

* build: rename cargo feature rio-v2 to m-compatible

The feature selects the stored layout a build reads and writes, not a version of the stream crate, so it is named after that. The rename covers the feature key in every crate that forwards it, all cfg attributes, the CI job ids, names and artifacts, the CI gate and its tests, the validation scripts, the compat compose build argument, the debug launch configuration and the documentation.

The crate rustfs-rio-v2, its path and module name, the tests named after that reader implementation, and the backend_name() strings are unchanged. There is no alias: a build that passed --features rio-v2 must pass --features m-compatible.

No behaviour change in either build.

* refactor(ecstore,sse): select the build variant at one point per module

The m-compatible feature was tested at about 220 places, most of them inside function bodies. Each area that differs between the two builds now has a pair of modules exporting the same functions, and one place that picks between them, so call sites no longer name the build.

- ecstore: io_support/rio.rs selects rio/{native,m_compatible}.rs for the stream readers and writers, the compression scheme and index encoding, and the write-side encryptors. object_api/readers.rs selects readers/{native,m_compatible}.rs for range plans, the multipart layout, plaintext sizes that are not recorded, empty parts and the decompressed stream.
- sse: the sealed-ETag branch moves out of core/read.rs into core/keying/, where this crate keeps its build-specific code, and decrypt_kms_sealed_config is exported in both builds.
- utils: the four checks in metadata_compat.rs become one predicate.
- Tests that exist in only one build move to tests/native.rs and tests/m_compatible.rs child modules, gated once where they are declared. The set of test names is unchanged apart from one rename.

The attribute now appears 95 times; in ecstore it is left on the two selection points and on tests. crates/ecstore/AGENTS.md records the convention.

scripts/error-other-format-baseline.txt changes because that ratchet counts per file: 11 existing call sites moved from object_api/readers.rs (19 to 8) into the new readers/m_compatible.rs (11). The total stays at 564.

No behaviour change in either build. docs/architecture/minio-file-format-compat.md gains a table of where the variant lives and a corrected statement of what a default build can read.

* fix(s3): compare read preconditions with the answered ETag

A HEAD or GET of an object whose stored ETag is sealed answers with the ETag clients were shown for it, but If-Match and If-None-Match were still compared with the stored form. A client sending back the ETag HEAD answered with got 412 for If-Match and no 304 for If-None-Match.

- HEAD and GET compare the ETag conditions with the ETag the response carries, and a 304 carries that ETag.
- The storage layer ends a conditional read on the stored ETag before a body is opened, and cannot await the answered one. For a stored ETag in sealed form it no longer ends the read on an ETag condition and leaves the decision to the request layer. Without this a matching If-Match ended the read with no body to answer with.
- A default build stores no sealed ETag: the form test is constant false there and its behaviour is unchanged.

Tests: a round trip on a real store takes the ETag from HEAD and sends it back to GET and HEAD as If-Match and If-None-Match, and sends the stored form to show it matches nothing; unit tests cover the precondition helper, the storage-layer decision and the form test in both builds. With either half of the fix switched off the round trip fails.

* fix(s3): compare copy-source conditions with the answered ETag

x-amz-copy-source-if-match and x-amz-copy-source-if-none-match on CopyObject and UploadPartCopy were compared with the stored ETag of the source. For a source whose stored ETag is sealed that is not the ETag a read answers with, so the ETag from HEAD was refused with 412.

Both compare the ETag a read of the source answers with, as GET and HEAD do since the previous commit. It is resolved after the source's key authorization and only when the request names an ETag. A default build stores no sealed ETag and is unchanged.

Tests: on a real store, a customer-key source with a sealed stored ETag is copied with the ETag from HEAD as copy-source-if-match through both operations; the stored form as if-match and the answered ETag as if-none-match are refused. The fixture is shared with the read round trip. With either call site switched back the test fails.

* fix(s3): answer a date-conditioned GET 304 with the answered ETag

A GET that carried only If-Modified-Since resolved no answered ETag, because the lookup was limited to requests naming an ETag, and its 304 fell back to the stored ETag. For an object whose stored ETag is sealed the 304 then carried a different validator than HEAD answers with.

GET resolves the answered ETag for every conditional request, so a 304 carries it whichever condition produced it. HEAD already did. An unconditional GET still skips the lookup, and a default build stores no sealed ETag and is unchanged.

Tests: the sealed-ETag round trip takes Last-Modified from HEAD, sends it back as If-Modified-Since to GET and HEAD, and requires the 304 of both to carry the ETag HEAD answered with. With the lookup limited to ETag conditions again, the GET half fails.

---------

Co-authored-by: overtrue <anzhengchao@gmail.com>
2026-11-29 11:50:24 +08:00
Chris An b23f69402d fix(gateway): restore object retention and metadata listing admission (#9758) 2026-11-29 11:22:05 +08:00
Chris An 5a0bdfcf1c fix(security): harden RPC, proxies, egress DNS, and OIDC (#9682)
* fix(security): harden RPC, proxies, egress DNS, and OIDC

Harden internode RPC authentication/quotas, trusted-proxy allowlisting,
protocol IAM policy conditions, outbound DNS egress pinning, and OIDC
redirect and HTTPS enforcement:

- Trusted proxies: replace broad private/link-local peer trust in simple
  mode with the configured trusted-proxy allowlist (defaulting to
  loopback-only) and update proxy integration coverage.
- Protocol gateways & FTPS: populate standard IAM condition keys
  (SourceIp, SecureTransport, CurrentTime, EpochTime, UserAgent,
  Referer, principal metadata) in gateway authorization and replace the
  unchecked FTPS fallback IP parse with explicit connection context.
- Bucket listing RPC: fail closed with entry index diagnostics instead
  of silently dropping malformed BucketInfo entries on encode/decode.
- Internode RPC streams & replay cache: add framed HMAC-SHA256 response
  authentication with sequence/digest/EOF verification and
  post-verification endpoint pinning for read_file_stream and walk_dir,
  plus canonicalized per-peer entry and memory-budget replay cache
  isolation.
- Outbound DNS egress: unify storage/tier, remote S3 replication
  targets, on-demand migration HTTP, Azure Blob, GCS, Keystone, and OIDC
  outbound checks onto OutboundPolicy and connection-time
  OutboundDnsResolver (with redirect blocking on Keystone) to stop DNS
  rebinding to loopback/link-local/metadata targets.
- OIDC redirects & transport security: trust forwarded scheme/host only
  from verified trusted proxies, never reflect untrusted request headers
  into STS credential or logout redirects, and reject plaintext http://
  OIDC URLs for non-loopback hosts unless explicitly opted in via
  RUSTFS_IDENTITY_OPENID_ALLOW_INSECURE_TRANSPORT.

Refs: rustfs/backlog#1470, rustfs/backlog#1473, rustfs/backlog#1472, rustfs/backlog#1506

* fix(egress): restrict GCS endpoints and restore tier compatibility

* ci: tighten the GCS error-format baseline

* fix(ci): stop sending deprecated policy field in s3-tests add-user

rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.

Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.

Refs: rustfs/backlog#1246

* fix(ci): fail S3 user provisioning on HTTP errors without logging responses

* fix(iceberg): reject repeated warehouses before validating bucket names

* test(ecstore): wait for relaxed writes on the foreground lane

* test(quota): isolate concurrent real-disk probes in CI

* test(ecstore): scope upload lock identity helper to its Linux test

* fix(oidc): preserve HTTPS in dynamic callbacks

* ci: allow cold builds to finish all fuzz binaries
2026-11-29 10:23:40 +08:00
Chris An 21fc821938 chore(deps): bump rustfs/gateway pin to b6007d13 (#9683)
* chore(deps): bump rustfs/gateway pin to b6007d13

* fix(ci): stop sending deprecated policy field in s3-tests add-user

rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.

Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.

Refs: rustfs/backlog#1246

* fix(ci): fail S3 user provisioning on HTTP errors without logging responses

* fix(iceberg): reject repeated warehouses before validating bucket names

* test(ecstore): wait for relaxed writes on the foreground lane

* test(quota): isolate concurrent real-disk probes in CI

* test(ecstore): scope upload lock identity helper to its Linux test

* ci: allow cold builds to finish all fuzz binaries
2026-11-29 09:50:12 +08:00
唐小鸭 02981d3838 fix(sse): accept ARN-prefixed plain key names on SSE-KMS writes (#9679)
An SSE-KMS write whose x-amz-server-side-encryption-aws-kms-key-id header
carries a plain key name behind an AWS-style ARN prefix
(arn:aws:kms:<name>) failed with 400 KMS.NotFoundException, because the
whole header value was looked up as the key name. Bucket replication from
a source that sends key names in that form therefore left every SSE-KMS
object FAILED.

The request header is now reduced to <name> when the remainder after the
prefix is a non-empty name without ':' or '/'. Complete key and alias ARNs
keep further ':'-separated fields and are passed on unchanged. The
reduction runs on the request's own value before it is merged with a
bucket default and before the KMS authorization check, so PutObject,
CopyObject and CreateMultipartUpload authorize, seal and record one key
id. A bucket default KMSMasterKeyID is still used as configured.
2026-11-29 09:49:05 +08:00
Hauser Zhi 1171ac9be2 feat(ecstore): observe destination directory fsync batches (#9711)
Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
2026-11-29 09:47:48 +08:00
GatewayJ 2c46461ff9 fix(oidc): allow operator-configured outbound proxies in egress policy (#9709)
Separate operator-configured HTTP(S) forward-proxy resolution from direct target DNS filtering in `rustfs_utils::egress` and wire OIDC HTTP clients through `OutboundPolicy::configure_reqwest_client`. Target OIDC URLs are always validated up front, direct and `NO_PROXY`/loopback connections retain connection-time target DNS filtering, and matched `HTTP_PROXY`/`HTTPS_PROXY`/`ALL_PROXY` hops permit private, shared, and loopback proxy addresses while keeping metadata, link-local, unspecified, translation, and reserved addresses (plus SOCKS schemes) blocked fail-closed. `OutboundPolicyError` preserves its exact target-policy shape alongside orthogonal `OutboundClientError`, and proxy rejections identify the proxy configuration without emitting misleading `RUSTFS_OUTBOUND_ALLOW_ORIGINS` hints for the OIDC provider origin.

Fixes #9611
2026-11-29 09:47:13 +08:00
Hauser Zhi 16b449c61d feat(obs): trace slow synchronous rename slots (#9697)
Report the phase split and configured disk coordinates for a slow
direct unary slot. Reuse an available request trace ID across the
detached PUT commit without changing RPC metadata.

Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
2026-11-29 09:35:00 +08:00
Hauser Zhi b5e69531dc feat(ecstore): opt in to higher parity for degraded PUTs (#9692)
* feat(ecstore): opt in to higher parity for degraded PUTs

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* fix(ecstore): count recovering drives in degraded PUT parity

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* test(storage): exercise recovery and late quorum loss

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* test(e2e): bound startup during degraded parity checks

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* perf(ecstore): streamline degraded PUT and writer setup

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* perf(ecstore): avoid redundant PUT staging work

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

---------

Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
2026-11-29 09:34:50 +08:00
Chris An 97d30eaccf test(security): add fuzzing, rejection mutants, and obs fault tests (#9699)
* test(security): add fuzzing, rejection mutants, and obs fault tests

Add sigv4_request and notify_xml libFuzzer targets with seed corpora and
unit tests, wire fuzz.yml as a workflow_call security-input-gate in CI
with trusted changed-path selection, and add fixed rejection-branch
mutation verification in isolated workspaces.

Verify #[path] coverage attribution with canonical path merging in
coverage_per_crate.py, sanitize OTLP startup endpoint logging, and add
connect_logs lease/fault regressions, local fake-OTLP 401/500/refused/
timeout/redaction tests, and E2E observability export failure isolation
tests.

Refs: rustfs/backlog#2677, rustfs/backlog#2679

* fix(ci): stop sending deprecated policy field in s3-tests add-user

rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.

Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.

Refs: rustfs/backlog#1246

* fix(ci): run called validation gates and count wrapped coverage lines

* fix(ci): fail S3 user provisioning on HTTP errors without logging responses

* fix(iceberg): reject repeated warehouses before validating bucket names

* test(ecstore): wait for relaxed writes on the foreground lane

* test(quota): isolate concurrent real-disk probes in CI

* ci: budget for cold instrumentation builds and validation rebuilds

* test(ecstore): scope upload lock identity helper to its Linux test

* test(ecstore): isolate namespace lock checks from runner disk latency

* test(ecstore): wait for inline source publication before reading a disk

* test(connect): isolate the durable receipt integration test
2026-11-28 13:47:56 +00:00
Chris An 17808b9fe5 fix(heal): stop retrying committed deletes on generation conflicts (#9685) 2026-11-27 23:06:27 +08:00
Chris An fbe7471ba6 docs(security,kms): add KMS version policy and close doc/compat gaps (#9661) 2026-11-27 17:29:38 +08:00
hector 08575786c6 ci: remove schedule-only rio-v2 lanes from CI (#9652)
The rio-v2 test, debug-binary, and e2e jobs in ci.yml ran only on the
nightly schedule and manual dispatch. Drop them, the ci-feat-rio cache
warm job that existed for them, and the merge-gate entries that named
them. The rio-v2 feature and minio-interop workflow stay. Default debug,
e2e, and S3 lanes are unchanged.

Bump the CI plan contract so a base planner that still lists those jobs
cannot authorize the new required set.

Co-authored-by: hector <majinghe@users.noreply.github.com>
Co-authored-by: Hauser Zhi <housemecn@gmail.com>
2026-11-27 05:17:00 +08:00
Hauser Zhi 594488a650 fix(sosapi): distinguish pending and invalid usage proof (#9655)
* fix(sosapi): distinguish pending and invalid usage proof

Expose neutral bucket usage states from the existing snapshot cache. Maintain the legacy scalar projection and map only pending certification to undefined SOSAPI usage.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* ci(test): isolate three disk-bound ECStore probes

Reserve nextest capacity for the physical Apply barrier and the two same-name multipart probes in the CI profile. Preserve their deadlines, assertions, and internal concurrency.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

---------

Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
Co-authored-by: Chris An <anzhengchao@gmail.com>
2026-11-27 03:15:34 +08:00
overtrue 986fb4269b chore(deps): bump rustfs/gateway pin to b4ea5ca3 2026-11-26 17:52:41 +08:00
Chris An 854dd7d1ea fix(iam,admin,oidc): harden IAM, MFA, OIDC, and admin endpoints (#9641)
* fix(admin): validate bucket name in v3 inspect-data

Refs: rustfs/backlog#3320

* fix(admin): enforce SSE-KMS auth on zip download & inspect-data

Refs: rustfs/backlog#3316

* fix(admin): restrict site-replication peer routes to replicator

Refs: rustfs/backlog#3324

* fix(admin): bound ZIP download staging concurrency, size & idle

Refs: rustfs/backlog#3338

* fix(admin): redact sensitive headers in Object Lambda payload

Refs: rustfs/backlog#3360

* fix(iam): enforce session policy bounds on service accounts

Promote copied creator session policies into embedded service-account policies on create, block bounded non-federated callers from replacing their policy boundary, cap policy-bounded STS expiration, and prevent policy-bounded or non-owner root-parented updates from escaping via policy, secret, status, or expiration changes.

Refs: rustfs/backlog#3323

* fix(admin): block restricted STS service-account owner fallback

Reject STS sessions carrying sessionPolicy or sessionPolicy-extracted claims from owner self-service fallbacks in ListServiceAccount, InfoServiceAccount, InfoAccessKey, ListAccessKeysBulk, and DeleteServiceAccount while preserving revision-bound deletes, active policyless user handling, and unrestricted Console STS sessions.

Refs: rustfs/backlog#3334

* fix(iam): persist MFA lockout state on failed verifications

Persist mutated MfaRecord instances through the compare-and-set loop in mfa::store::update even when the mutation closure returns an error, so failed_attempts and locked_until survive across requests and engage rate-limit lockouts while unchanged rejections avoid creating records.

Refs: rustfs/backlog#3356

* fix(admin): deny restricted STS parent credential mutations

Add CredentialMutationDenial::RestrictedSession in CallerIdentity::from_credentials to reject STS sessions carrying sessionPolicy or sessionPolicy-extracted claims from mutating their parent's password or MFA, while preserving TableStorageSession precedence and unrestricted Console STS sessions.

Refs: rustfs/backlog#3353

* fix(iam): require step-up proof to re-enroll active MFA

Require proof of the active second factor inside mfa::service::enroll's CAS update and verify the current secret key in AccountMfaEnrollHandler when MFA is already enabled, preserving first-time enrollment without a current code and enforcing persisted failure lockouts on failed step-up codes.

Refs: rustfs/backlog#3346

* fix(oidc): use LRU state eviction and per-IP authorize limit

Switch OidcStateStore auth and logout caches from TinyLFU to LRU eviction so full caches admit new logins instead of discarding them while abandoned entries age out.

Add a bounded per-client-IP token-bucket rate limit to OidcAuthorizeHandler keyed on the verified peer/trusted-proxy IP so a single client cannot churn through the state store during another user's IdP round-trip.

Refs: rustfs/backlog#3337

* fix(oidc): bind callback provider to state before code exchange

Thread the callback route provider_id from OidcCallbackHandler through FederatedIdentityService::complete_authorization_code and StandardOidcAuthentication::exchange_identity into OidcSys::exchange_code.

Reject mismatched session.provider_id != provider_id immediately after consuming the single-use state and before constructing any client or sending any outbound token request (RFC 9700 section 4.4).

Refs: rustfs/backlog#3358

* fix(oidc,sts): sanitize public OIDC and STS verification errors

Stop echoing raw FederationError::CodeExchange diagnostics from OidcCallbackHandler so internal provider settings (config_url, token_endpoint, client_id) stay in server logs while preserving the invalid/expired state message and load-balancer affinity hint.

Sanitize FederationError::TokenVerification in AssumeRoleWithWebIdentity into fixed, actionable client-facing failure categories while stripping backend metadata-refresh diagnostics so internal discovery URLs are never exposed.

Refs: rustfs/backlog#3359

* fix(oidc): bind console OIDC login state to initiating browser

Have OidcAuthorizeHandler emit an HttpOnly, SameSite=Lax rustfs_oidc_state cookie (Secure over HTTPS, scoped to the callback path, 300s Max-Age) carrying the authorization state.

Verify the cookie against the callback state query parameter with constant_time_eq in OidcCallbackHandler before consulting the federation service or consuming the server-side state, and clear the cookie on callback completion.

Refs: rustfs/backlog#3363

* fix(idp,iam): classify listed STS sessions by claims for revoke

Add guess_sts_user_provider to classify listed STS accounts directly from decoded claims rather than requiring a non-empty session_token (which list_sts_accounts strips), and use it in revoke_matching_sts_accounts and collect_access_keys_for_user.

Return the store-loaded UserIdentity from verify_temp_user_persistence in set_temp_user_with_generation so freshly issued STS sessions cache decoded JWT claims on the issuing node while strictly preserving sts_generation.

Refs: rustfs/backlog#3365
2026-11-26 14:03:32 +08:00
Chris An ed6f9cbdc4 fix(authz,ecstore,protocols): harden S3 authz, WORM, storage & protocols (#9646) 2026-11-26 13:48:12 +08:00
overtrue bdcb29c2aa feat(gateway): verify SigV4 on S3-port reserved console paths via gateway@095d4763
Bump the pinned rustfs/gateway revision to 095d4763a3f58a5e1d22fe7a231bf1c105473de8
(#1620, independent service-scoped dialects with single-segment path claims) and
add an independent SigService::S3 reserved-console host for console-disabled
listeners (such as the S3 port when a dedicated console listener is enabled).

Both default (/rustfs/console) and custom single-segment console prefixes (/ui,
/UI_assets) plus root icon paths now bypass S3 bucket-name parsing while keeping
original-URI SigV4 verification intact: anonymous and SigV2 requests receive
403 AccessDenied and validly signed SigV4 requests receive 501 NotImplemented,
matching RustFS 1.0.5 while preserving extension/Object Lambda precedence and
dedicated console listener 200 responses (rustfs/backlog#2771).
2026-11-26 12:19:00 +08:00
Hauser Zhi 4a3f1d6f70 fix(ecstore): preserve bulk delete results and reduce allocations (#9628)
* fix(ecstore): use recovery deadline for bulk delete prepare

Wait for the complete per-drive batch response under the bounded delete recovery deadline. Preserve the ordinary control timeout for single-object preparation and discovery.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* perf(ecstore): defer batch marker cleanup after receipt quorum

Use the existing recovery worker for committed marker cleanup when the batch fits the hint queue and the current hint generation is present. Keep the existing inline path under backpressure.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* perf(ecstore): reduce bulk delete results once per key

Reuse the per-drive group results for quorum reduction, rollback, and marker purge, avoiding the per-object disk-error matrix. Keep certified cleanup inline after the crossover experiment increased immediate verification and cleanup time.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

---------

Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
2026-11-26 09:57:00 +08:00
overtrue 2fab66075f feat(gateway): mount remaining 5 GET native control-plane admin routes
Add GatewayStack::object_lambda_fallback backed by an Object Lambda
companion control-plane dialect and service that omits native admin
routes, mount all remaining 5 GET native control-plane admin operations
(completing 12/12 native claimed admin routes with pre-body IAM
enforcement) while preserving header-signed and presigned Object Lambda
requests (#1577), and bump the pinned rustfs/gateway revision to
ecafc085de850e1be0c22ba173bf1accc68e75c5 so admin route census enforces
the Object Lambda fallback invariants fail-closed.
2026-11-26 04:12:19 +08:00
overtrue 2180cb7f9b fix(testing): accept signed CreateBucket Location in wire replay
Record the maintainer-signed accepted-change ruling from rustfs/backlog#2684#issuecomment-7163283798 in gateway wire replay and the S3 stack rollback guide:

- Keep location in HEADERS in scripts/gateway_wire_replay.py so PostObject 303 redirects and all other operations still compare Location byte-for-byte.
- Exempt only CreateBucket PUT 200 responses where the only difference is candidate adding a single Location: /<bucket> header matching the canonical path-style or virtual-hosted target bucket, recording those entries under accepted_differences without wire data while keeping unruled differences fail-closed.
- Add positive and fail-closed negative regression tests (including a synthetic 93-CreateBucket + PostObject 303 batch check) in scripts/test_gateway_wire_replay.py.
- Document the signed PutBucketPolicy (8f81762a6) and CreateBucket (8676d2f3b) client-visible behavior changes in docs/operations/s3-stack-rollback.md.
2026-11-25 21:17:22 +08:00
overtrue fce1edbca6 chore(gateway): bump pinned gateway rev to 4a4360da
Bump rustfs/gateway pin from 6cb25e95ee33aefeacac057bebdc31344765238e
to 4a4360da67abb59868e57a8da5c0b64cf924ef0a (conformance external SigV2
clock fix, c-cred-0004 external skip, and difftest/fuzz tooling only;
zero runtime crate changes) and align docs/operations/s3-stack-rollback.md
to the current pinned conformance rulings URL.
2026-11-25 17:03:41 +08:00
overtrue cccc89476e test(app): retire legacy body, trailer, upload, and restore seams
Remove unused CreateMultipartUploadFields::from_legacy, UploadPartWriteInput::from_legacy, native_body::from_legacy, guard_upload_progress, trailer_adapter, restore_request_from_wire, storage_api::request_body legacy re-exports, and the retired s3gate-trailer-adapter register entry while migrating copy, native_body, put, and restore_conversion_tests directly onto owned gateway types.
2026-11-25 16:47:19 +08:00
overtrue 328d157f36 ci(mint): run nightly dual-stack comparison with diff-table gate
Upgrade .github/workflows/mint.yml from a weekly report-only single-stack run to a nightly dual-stack comparison between the pinned reference release (.config/reference-binary.toml) and the current checkout candidate, gated by a fail-closed (sdk, test, legacy, gateway) diff table (scripts/mint_stack_diff.py) for rustfs/backlog#2774 (T3.3).
2026-11-25 15:44:35 +08:00
cxymds 385ea6e460 fix(scanner): resume lifecycle scans after tier changes (#9609)
* fix(scanner): replan fenced cycles on tier registry mismatch

* fix(scanner): negotiate tier registry checks before remote walks

---------

Co-authored-by: Hauser Zhi <housemecn@gmail.com>
2026-11-25 07:06:01 +08:00
唐小鸭 2fd613157b refactor(sse): extract SSE into the rustfs-sse crate and layer it (#9574)
* refactor(sse): extract server-side encryption into rustfs-sse crate

Move the SSE-S3 / SSE-KMS / SSE-C key resolution, metadata and authorization logic out of rustfs/src/storage/sse.rs into a new crates/sse (rustfs-sse) so its outward references are explicit.

The crate depends only on rustfs-config, rustfs-kms, rustfs-policy, rustfs-s3-types and rustfs-utils. It does not reach the storage engine, IAM, the gateway or the server binary; scripts/check_architecture_migration_rules.sh now pins that dependency set.

Everything the crate needs from the running server arrives through the SseHost port (current KMS service, KMS manager state, bucket default encryption, per-key authorization). The host is an explicit parameter on every entry point that needs it rather than a global, so a missing installation cannot silently fall back to the local key provider.

The crate reports failures as SseError, which carries the S3 error code. The KMS-to-S3 error mapping moves with it and rustfs/src/error.rs reuses it, so response codes and messages are unchanged. The source of an SSE-internal error is no longer wrapped in StorageError::Io.

rustfs/src/storage/sse.rs stays as the adapter: it implements the host, binds the entry points to this server and converts back to ApiError, and keeps the conversions that cross the engine boundary (read-side resolver, multipart completion gate, reader error mapping).

Tests split with the code. Four provider round-trips over rio streams move to storage/sse_test.rs because the crate does not depend on rio. Cross-crate test seams sit behind the test-util feature, enabled only from the rustfs dev-dependencies. The rio-v2 CI lane and cache warm-up now include -p rustfs-sse so the rio-v2-only SSE tests keep running.

* refactor(sse): remove three unused configuration helpers

get_sse_type, sse_configuration_to_metadata and SseTypeV2::to_metadata have no caller in the crate, its tests, or the server. All three carried #[allow(unused)], which is what kept the compiler from reporting them.

* refactor(sse): split the crate root into core and kms modules

Move every item of the single-file crate into modules without changing
any of them:

- core/s3: what S3 defines for SSE (request headers, scheme selection,
  SSE-C validation, key-policy authorization)
- core/keying: how RustFS seals and records object keys (key material,
  direct and object-key forms, stored metadata, encryption context)
- core/{request,write,read,rewrap,audit}: the per-request entry points
- kms: data-key providers (KMS-backed, local master key, MinIO
  builtin-KMS ciphertext) and the provider registry

The rio-v2 only modules carry the feature gate at module level instead
of on each item. Inline tests move to a crate-level tests module. The
public surface is unchanged and is now an explicit re-export list in
lib.rs; visibility is otherwise tightened to pub(crate) or private.

Documentation that cited the old file now points at the module that
holds the symbol.

* refactor(sse): add an explicit startup step for process-level state

Give rustfs-sse one entry point, `startup::init`, for the state that is
fixed for the lifetime of the process. The server calls it where it used
to log the SSE-KMS key policy mode.

- Resolve the key policy enforcement switch once and log its mode.
- Check `RUSTFS_SSE_S3_MASTER_KEY` at startup and report it through the
  `sse_local_master_key` event as `loaded`, `not_set`, or `invalid`. An
  unusable value is logged as an error; startup still succeeds and
  requests fail exactly as before.
- Return a `StartupReport` so the caller can see both results. Repeated
  calls return the first report without logging again.

Anything that follows the KMS service state stays resolved per request:
the service follows configuration and can be started, restarted, or
stopped from the admin API while the process runs.

`get_local_sse_dek_provider` becomes synchronous, since it never awaited
anything. The "Using RUSTFS_SSE_S3_MASTER_KEY for SSE-S3" line that was
logged when the key was first used is replaced by the startup event.

* refactor(sse): split the write path into S3 scheme and keying mode

The write entry points mixed two questions: which SSE scheme S3 asks for,
and how this build forms and stores the object key. Give each a home.

- `core/s3/scheme.rs` gains `resolve_write_scheme`, which validates the
  headers and resolves the request, then the bucket default, to a
  `WriteScheme`. PutObject and CreateMultipartUpload now share it; the
  second copy of that decision (`SseTypeV2`,
  `prepare_sse_configuration_v2`) is removed.
- `core/keying/` gains one constructor per key source
  (`new_key_under_customer_key`, `new_session_key_under_customer_key`,
  `new_key_under_data_key`) in each mode. `keying/mod.rs` is the only
  place that says which mode a build writes.
- `core/write.rs` only orders the steps and no longer carries any
  `rio-v2` conditional compilation.

No behavior change. A multipart session still validates the SSE-C key at
creation only in the mode that seals the session key under it.

`SseTypeV2` leaves the public surface; nothing outside the crate used it.

* refactor(sse): split the read path into S3 scheme and keying mode

The read entry points decided the scheme, authorized the key, and
recovered the object key in one function, with the SSE-C preamble and
the managed key resolution written out twice. Separate the steps.

- `core/keying/stored.rs` (new) recognizes how a stored object was keyed
  (`recognize_stored_managed_key`) and recovers its key
  (`open_under_customer_key`, `open_under_stored_data_key`). The unwrap
  body moves there unchanged.
- `core/s3/ssec.rs` gains `require_matching_ssec_key` and
  `stored_ssec_algorithm`, shared by the unwrap and the response-header
  paths.
- `core/read.rs` orders the steps: recognize, name the key, authorize,
  recover. Both read entry points resolve the key through one helper, so
  authorization and the response header cannot name different keys.
- `core/keying/` no longer imports from `core/s3/`: the request check
  `reject_kms_context_location_override` moves to `core/s3/headers.rs`,
  and the legacy SSE-C nonce hashes with `md5` directly.

`rio-v2` conditional compilation is now confined to `core/keying/` and
`kms/`. No behavior change: the order of checks on a read is preserved.

* docs(sse): describe the module layout and its layer rules

Record in the crate instructions what the split settled: where startup
state, the entry points, the S3 layer, the keying layer, and the
data-key providers live, and the rules that keep them apart.

- `core/keying/` never imports from `core/s3/`; `core/s3/` reads stored
  metadata only through `core/keying/metadata.rs`.
- `rio-v2` conditional compilation stays under `core/keying/` and `kms/`.
- A new stored format is added under `core/keying/` without changes
  under `core/s3/`.

* refactor(sse): let each keying mode own its stored record

One function wrote the stored metadata of every keying mode, and one
function read it back, each switching on the mode and the build inline.
Give a mode both directions of its own record instead.

- `core/keying/direct.rs` records and reads the Direct record
  (`record_customer_key_nonce`, `record_wrapped_data_key`,
  `read_wrapped_data_key`).
- `core/keying/object.rs` records and reads the sealed-key record in
  MinIO's slots (`record_sealed_customer_key`,
  `record_data_key_in_minio_slots`, `read_sealed_data_key`).
- `encryption_material_to_metadata` records the scheme and hands the key
  to the mode that formed it.
- `core/keying/stored.rs` reads in three named steps: the recognition
  order of the modes (`read_stored_data_key`), the choice of the
  provider that unwraps the data key (`unwrap_stored_data_key`), and the
  opening of the object key. A stored key carries its mode as
  `StoredKeyMode` rather than as an optional sealed key.

No behavior change. The stored metadata is identical for every
combination of scheme, mode, sealed key, key id, context, and size in
both builds, and the order of the read-side failures is preserved.

* test(sse): add a black-box suite that compares two server binaries

Unit tests cannot show that moving SSE into its own crate left what a
client sees, and what lands on disk, unchanged. This suite drives a real
server process and can compare two binaries.

- 30 cases over six process configurations: no key source, a loaded and
  an invalid local master key, the Local KMS backend with per-key
  authorization off and enforced. They cover round trips and response
  headers, bucket default encryption, CopyObject, multipart uploads,
  run-time KMS stop and start, malformed requests and authorization.
- Every HTTP exchange inside a case is recorded as an observation:
  status, error code and message, SSE headers, response header names,
  body hash, and the encryption metadata key names stored for the
  object. `diff` compares two runs field by field against a closed list
  of accepted differences.
- `cross` has one binary write every stored form and another read the
  same data directory.
- A registered binary is pinned by SHA-256, and a run fails when the
  stored form does not match the build the binary was registered as.

Results for this branch against its base, default build: 93 verdicts and
252 exchanges equal, no blocking difference; the only accepted one is the
new `sse_local_master_key` startup event. Cross reads pass in both
directions, 42 objects each.

The suite also pins two behaviors that predate this branch. Multipart
responses for SSE-C uploads carry `x-amz-server-side-encryption: AES256`
besides the customer-key headers; MP-03 records that as a known deviation.
A `rio-v2` build cannot read back encrypted objects of roughly 64 to
128 KiB, or of 3 MiB and more, so under that build the comparison only
shows that both binaries fail the same cases.

* test(sse): stop the black-box suite from overlooking two regressions

The known-deviation marker in MP-03 accepted any SSE headers that
contained the expected ones, so an unrelated extra header, the raw
customer key included, was still reported as the known deviation. It now
tolerates exactly the one documented difference and fails on anything
else.

The observation of a result document kept only the set of element names.
A wrong part size, a missing part or reordered parts in a listing changed
nothing, so a comparison between two binaries could not see them. It now
keeps every leaf with its value in document order and reduces only the
elements that vary between runs: upload ids, timestamps, markers and
ETags of encrypted objects.

`suite.py selftest` checks both offline, together with the rules of the
comparison. Against the previous observation code it fails on the three
listing cases. The comparison of this branch with its base still shows no
blocking difference in either build.

* test(sse): prepare the black-box suite for P1 cases and more backends

The suite could only run P0 cases on six built-in configurations with one
shared site each. The next groups of cases need more than that:

- `run --level p0|p1|all`, and a `skip` verdict for a case the backend's
  capability table rules out.
- `register_config` lets a case module add a process configuration with
  what it needs before the process starts, once it answers, and at the
  end of the run. The two Local KMS configurations now use the same
  mechanism instead of special cases in the driver.
- `isolated` cases get a site of their own on a fresh data directory and
  may restart it with another configuration or environment.
- Exchange hooks and post-run checks, for modules that keep everything a
  run saw and judge it as a whole.
- Case modules are discovered by file name, and the binary registry can
  be shared between state directories.

The P0 results and the comparison with the base are unchanged.

* test(sse): cover run-time state, authorization, leaks and stored form

Three groups of cases are added to the black-box suite, with what they
need to run.

Run-time state (14 cases). A write follows the state the process is in
now, a read follows what the object recorded: the master key across
restarts, KMS stopped, started and configured at run time, a deployment
moving between key sources, a changed backend, and keys disabled,
destroyed and rotated. New configurations: Local KMS with a master key,
Vault Transit, Vault KV2 and the Static backend. Vault is a development
server started by the driver with a token generated per run; when it
cannot be started its cases report an environment error.

Authorization and leaks (18 cases). Per-key authorization on bucket
defaults, both ends of a copy, multipart uploads, every read entry point,
anonymous access, internal work and audit entries. Every exchange of a
run is archived with secrets redacted, and four checks over the whole run
look for key material in responses and server logs, for internal headers,
and for unexpected internal-error messages.

Stored form (8 cases). What an encrypted object looks like on disk is
read with the repository's `dump_fileinfo` tool and held to one manifest
per build: every metadata key with its exact value or, for random values,
its shape. The cases also search the drives for plaintext, customer keys
and unwrapped data keys. `cross` records the stored form of everything
the writer stored.

Compared with the base on the default build, all levels: 382 verdicts and
887 exchanges equal, no blocking difference; 86 case runs pass on each
side. Three cases report a known deviation that predates this branch: the
multipart SSE-C response header (MP-03), an SSE-KMS write that turns from
400 into 503 after a refused KMS start (KS-09), and a read by a caller
without a grant that reveals whether the key was destroyed or KMS is
stopped (SEC-05). The manifests were written from the base binaries and
the branch stores the same form in both builds.

Each group was shown to fail when it should: Vault unavailable gives
environment errors, the two authorization configurations swapped fail the
matrix both ways, a planted key is found in a log and in a response, a
`rio-v2` binary registered as the default build fails the manifest and
the build check.

* test(sse): expect only customer-key headers on SSE-C multipart replies

MP-03 recorded the extra `x-amz-server-side-encryption: AES256` header on
SSE-C CreateMultipartUpload and CompleteMultipartUpload responses as a
known deviation. The header is gone on main, so the case now checks the
intended headers directly; left as a marker it would report the deviation
as fixed and fail the run.

On both builds the base and this branch pass the case.

* test(sse): take the black-box suite out of this repository

The suite under `scripts/test/sse_blackbox/` drives a server binary from
the outside and compares two binaries. It is a product-level test
harness, not part of the server's own tests, and belongs with the other
external test suites rather than in this repository.

The directory is removed, with the paragraph in `crates/sse/AGENTS.md`
that pointed to it. No server code changes.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Hauser Zhi <housemecn@gmail.com>
2026-11-25 06:19:21 +08:00
Chris An 69fa5c7ec8 fix(storage): isolate scanner faults and bound recovery retries (#9507)
* docs(heal): distinguish task deadlines from token expiry

* docs(storage): attribute delete recovery work during restart

* test(scanner): measure checkpoint layout and replay costs

* fix(ecstore): back off repeated delete settlement failures

* fix(usage): distinguish carried values and quota reporting holds

* fix(scanner): retire faulted disk walks at their source

* fix(ecstore): retain drive return signals for active retries

* test(scanner): replay checkpoint segments with the storage codec

* fix: correct authorization architecture boundaries

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* fix: remove invalid authorization import

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* test(ecstore): retain backoff across queue eviction

* test(ecstore): check renewal registry after publication

* fix(ecstore): keep stop_monitoring separate from wrapper retirement

---------

Signed-off-by: Hauser Zhi <housemecn@gmail.com>
Co-authored-by: houseme <4829346+houseme@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Hauser Zhi <housemecn@gmail.com>
2026-11-25 06:19:07 +08:00
GatewayJ 47e27180f2 feat(signer): support optional FIPS signing for S3 SigV4 (#9219)
* feat(signer): support optional FIPS signing for S3 SigV4

* test(signer): verify AWS-LC services used by SigV4 hashing

---------

Co-authored-by: Chris An <anzhengchao@gmail.com>
2026-11-24 23:15:35 +08:00
Hauser Zhi 8ab751322b fix(s3): report partial Veeam SOSAPI capacity (#9598)
* fix(s3): report partial Veeam SOSAPI capacity

Keep live cluster capacity available while scanner usage is pending. Report quota headroom only when it can be determined for the current bucket.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* fix(s3): revalidate Veeam capacity freshness efficiently

Reuse the rendered capacity document when the figures match. Renew Last-Modified ahead of the Veeam freshness limit and use the final quota snapshot as the bucket incarnation fence.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* perf(ecstore): validate usage certification once per snapshot

Cache the certification decision with the immutable usage snapshot. Keep malformed inventories ineligible and use binary search and the current incarnation for each bucket projection.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* ci(e2e): record the native gateway smoke regression

Record the smoke membership added by 9b865db75. The failed Linux CI archive and a local archive select the same 258 tests. Removing only the new fake S3 target regression reproduces the previous digest.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

---------

Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
2026-11-24 21:43:19 +08:00
Chris An a7a1fdeb6a fix(compat): restore force-delete casing and long-root MRF refresh (#9612) 2026-11-24 21:17:22 +08:00
overtrue 33d86f35f9 Record native S3 traffic from isolated compatibility test servers 2026-11-24 13:08:13 +08:00
overtrue 88037b557b ci: retire the gateway integration branch workflow 2026-11-24 12:26:50 +08:00
cxymds 17946efa94 feat(scanner): expose durable bucket scan progress (#9556) 2026-11-24 03:30:15 +08:00
GatewayJ e7248f2801 fix(ecstore): verify EC:0 shards on the owning peer and enforce NIXL shard I/O (#9526)
* fix(ecstore): verify remote shards over strict NIXL reads

* fix(ecstore): preserve EOF and repair semantics for remote shards

* fix(storage): use native request bodies for RDMA uploads

* perf(ecstore): verify EC=0 shards on the owning peer

* fix(ecstore): bound staged shard reads and test failed uploads

* test(protos): pass explicit timeouts in channel reset tests

---------

Co-authored-by: overtrue <anzhengchao@gmail.com>
2026-11-23 07:29:10 +08:00
cxymds e48b3a4e0c fix(scanner): finish wide directory scans across cycle deadlines (#9516)
* fix(scanner): finish wide directory scans across cycle deadlines

* fix(scanner): resume durable per-disk progress across handoffs

* fix(scanner): bound checkpoint storage and resume verified page reads

* fix(scanner): keep recoverable pages across long cycle intervals

* test(scanner): share primary page fault injection

* fix(scanner): preserve progress across owner cancellation

Port the scanner fix from #9546.

* fix(scanner): recover abandoned checkpoint page bundles

Record staging before writing pages and persist cleanup with a replacement checkpoint. Restore checkpoints with background disk admission and update the affected tests to pass cancellation tokens.

* test(scanner): adapt cache and lifecycle cases to current scanner inputs

---------

Co-authored-by: overtrue <anzhengchao@gmail.com>
Co-authored-by: Hauser Zhi <housemecn@gmail.com>
2026-11-23 05:15:16 +08:00
cxymds 49db44d177 fix(scanner): bound retries and validate cached bucket identities (#9423)
* feat(scanner): expose scan work and reuse observations

* fix(scanner): preserve baselines during backup catchup

Require decoded-primary provenance before accepting an unchanged baseline after its backup catches up. Keep current-revision CAS and publication fences, and align the real checkpoint fixture with the bounded-cycle carry contract.

* fix(scanner): cap superseded retries at the nominal cycle

* fix(usage): validate cached statistics against bucket identity

* feat(scanner): observe bucket reuse and production proof gates

* fix(ci): give the multipart refusal fixture its storage stack

* test(admin): bind snapshot fixtures to current bucket identities

* fix(scanner): require a measured baseline for admin usage overlays

* fix(scanner): reject unmeasured admin usage snapshots

Validate the persisted scanner baseline before identity filtering can mark
it as displayable. Cover two buckets with only one current identity and
adapt the backup catchup cache save calls to the merged API.

---------

Co-authored-by: Chris An <anzhengchao@gmail.com>
Co-authored-by: houseme <4829346+houseme@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-11-23 04:34:14 +08:00
Chris An b19c06f4de fix(scanner): revisit compacted prefixes with active lifecycle rules (#9551)
Co-authored-by: cxymds <cxymds@gmail.com>
Co-authored-by: Hauser Zhi <housemecn@gmail.com>
2026-11-23 04:13:57 +08:00
Hauser Zhi 6d115aaec9 fix(heal): admit replacement data directories on configured mounts (#9519)
* fix(heal): admit replacement data directories on configured mounts

Verify the mount ID of the pinned data directory against the expected mount root and retain the existing physical-device checks. Reject the newly exposed directory when the intended mount is missing.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

* refactor(heal): probe replacement mounts as one pinned batch

Resolve each target once and check mount identity on the same handles before and after taking execution leases. Verify mount boundaries with bounded kernel lookups and resolve each local device once per batch.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

* test(heal): reuse the privileged replacement mount fixture

Exercise configured subdirectories and unmount rejection in the existing independent-mount case. Reuse the mount namespace and keep the existing ignored-test ceiling.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

* fix(ci): remove stale form helper and unused hotpath dependencies

Remove the test helper left by the gateway merge. Keep profiling feature forwarding in protos and activate rio instrumentation only for profiling builds.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

* perf(ecstore): reuse the pinned replacement mount identity

Capture device, inode, and mount ID when opening the pinned root. Reuse that identity for live endpoint checks and avoid a duplicate lookup when the endpoint is the expected mount root.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

* fix(heal): bind replacement intent to the execution lease

Persist the identity of the admitted mounts and keep the live fence immediately before formatting. Compare ordered identity snapshots without allocating on the scan path.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

* fix(ecstore): report missing native pool recovery evidence

Distinguish failed proof stages without changing repair admission. Exercise four-node subdirectory replacement below write quorum and after a third survivor returns.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

* perf(ecstore): inspect native pool recovery evidence in one pass

Preflight pool slots before disk I/O and use the authenticated Inspect RPC as the capability check. Stop on the first ordered read failure before planning or applying a repair.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

---------

Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: overtrue <anzhengchao@gmail.com>
2026-11-23 04:13:48 +08:00
GatewayJ 8c9fc97ae6 refactor(rdma): bind the NVIDIA cuObject server SDK in RustFS (#9563)
* refactor(rdma): bind the NVIDIA cuObject server SDK in RustFS

* fix(rdma): preserve channel capacity and reuse contiguous registrations

* perf(rdma): transfer ownership of cuObject upload buffers

* fix(rdma): validate cuObject routing fields before transfer

* refactor(rdma): isolate the cuObject server SDK in a sys crate

* docs(rdma): document the workspace cuObject server bindings

* perf(cuobject): reuse channels and completion registrations

* fix(rdma): release eager PUT staging before requesting more chunks

* fix(rdma): consume CQ readiness and copy only retained PUT frames

* fix(rdma): release consumed streaming PUT frames before the next read

---------

Co-authored-by: Hauser Zhi <housemecn@gmail.com>
Co-authored-by: overtrue <anzhengchao@gmail.com>
2026-11-23 04:13:17 +08:00
cxymds 1b2615cdb5 fix(replication): recover permanently decommissioned sites (#9491)
* fix(replication): durably decommission unreachable sites

* fix(replication): declare native error macro at removal boundary

* fix(replication): preserve removal state and edit execution context

* fix(replication): use storage boundary aliases in removal tests

* fix(replication): sign local removal probes with the admin session

* fix(admin): scope legacy test helper bounds to the method

* test(connect): stabilize concurrent rotation timeout coverage

---------

Co-authored-by: Chris An <anzhengchao@gmail.com>
2026-11-23 04:12:51 +08:00
cxymds 6256ea500e fix(ilm): continue tier recovery past unreadable objects (#9537)
Co-authored-by: Chris An <anzhengchao@gmail.com>
2026-11-23 03:49:24 +08:00
cxymds 40eea75614 fix(admin): report inventory coverage and cluster scanner activity (#9541)
* fix(admin): report inventory coverage and cluster scanner activity

Join the current bucket namespace with measured usage for matching bucket identities. Report the elected scanner coordinator and previous attempt to clients connected to any node, with explicit coverage when measurements are unavailable.

* fix(admin): verify scanner attempts and preserve inventory lookup budgets

Start identity validation after snapshot refresh. Record terminal scanner outcomes at the bounded wait boundary and trust the durable fence for successful completion. Assert that the real leader and followers agree on an active cycle and its completion.

* test(e2e): register the cluster scanner regression in distributed selection

The controlled follower test adds one unconditional case to the 4-node profile. Pin the resulting 111 test IDs so the distributed workflow reaches the test runner on both supported platforms.

---------

Co-authored-by: Chris An <anzhengchao@gmail.com>
2026-11-23 03:49:13 +08:00
GatewayJ 357c308ee1 fix(nixl): bound native transfers and reclaim idle peer registrations (#9542)
* fix(s3): build native RDMA upload bodies for PUT requests

* fix(nixl): reclaim idle peer registrations after native completion

* fix(nixl): start peer idle expiry after the last transfer finishes

* fix(nixl): retain transfer permits and preserve cached peers on failure
2026-11-23 03:49:01 +08:00
Hauser Zhi d4a5f8aeb6 fix(ecstore): back off blocked delete recovery per key (#9521)
* fix(ecstore): back off blocked delete recovery per key

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

* perf(ecstore): avoid redundant delete recovery inspections

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

* perf(ecstore): compact delete recovery decision evidence

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

* fix(build): restore Windows and workspace validation

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

* fix(test): remove unused POST policy metadata helper

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

---------

Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
2026-11-23 03:47:49 +08:00
Chris An 2381096448 fix(scanner): preserve restart progress and background admission (#9341)
* fix(scanner): retain unpublished bucket progress across leader changes

* test(scanner): verify remote completion reuse and publication floors

* fix(scanner): persist read-only checkpoint continuity

* test(scanner): avoid cloning the final activity fixture

* fix(scanner): resolve receipt owner before store startup

* fix(scanner): gate read-only handoff behind reader-first rollout

* test(scanner): accept consumed markers after heal startup

* test(scanner): run handoff rollback in the pinned release lane

* fix(scanner): preserve background admission during cache saves

* fix(scanner): admit remote cache publications as background I/O

* fix: handle disabled cgroup controllers in resource sampling

* fix(scanner): wait for namespace RPC preflight admission

* fix(scanner): align metric loops with current clippy

* fix: resolve Rust 1.100 workspace lint diagnostics

* fix(heal): simplify Linux test opt-in check

* chore(scanner): expose admission and allocator diagnostics

* fix(scanner): retry transient resource samples within one bracket

* fix(protos): retain cancelled RPC streams during response grace

* feat(diagnostics): track live Rust allocation bytes

* docs(diagnostics): explain unsafe allocator test scope

* fix(ecstore): reduce multipart recovery stack usage

* chore: refresh PR verification

* fix(protos): retain reset streams for the full cancelled burst

The branch's channel reset tests cancel 80 batches of 64 streams; main's 4096 cap spends the protocol-error budget on that burst, so keep the 8192 capacity under main's constant.

* fix(scanner): complete budget-stopped cycles with carried buckets pending

Align with main's partial-carry semantics: a work budget that stops a bucket whose certified value is carried completes the cycle with that bucket pending and the snapshot unconverged, instead of forcing the cycle incomplete.
2026-11-21 09:12:23 +08:00