Commit Graph

7028 Commits

Author SHA1 Message Date
唐小鸭 2f2e775655 fix(kms): refuse key ids that leave the key prefix on the Vault backends (#7727)
Only the Local backend refused a key identifier containing a path
separator. On Vault KV2 a create with the name bad/name succeeded and
produced a nested KV2 path that the listing then reported as a
directory rather than a key, and an identifier containing .. addressed
a record outside the configured key prefix once the HTTP client
normalised the URL; Vault Transit built its transit key name and its
metadata path from the same unchecked identifier.

Lift the Local backend's containment rule into a shared segment check
(empty, /, backslash, NUL, . and ..) and apply it at the single point
where each backend turns the identifier into a path or a Transit key
name, so create, describe, encrypt, delete and the metadata writes all
refuse with InvalidKey before any request reaches Vault. The admin API
already maps that to 400. The AWS backend is untouched: it addresses
keys by ARN and alias, both of which contain /.

Refs rustfs/backlog#2474 (KMS-213 CreateNegatives on vault-kv2).

Co-authored-by: Hauser <housemecn@gmail.com>
2026-09-14 12:37:45 +00:00
唐小鸭 1ef3974bad fix(replication): count a bodiless 405 as a replicated delete marker (#7756)
* fix(replication): accept a bodiless 405 as a replicated delete marker during resync

A resync verifies each delete marker with `HEAD ?versionId=<marker>` on the
target. S3 targets (RustFS, MinIO, AWS) answer that with 405 and no body,
and the SDK only synthesizes an error code for 404, so the error arrived
with `code() == None`. `is_retryable_delete_replication_head_error` then
treated it as an ambiguous failure: every delete marker counted as a failed
object with `target service error`, and a site resync over any bucket that
holds a delete marker reported the whole bucket as failed
(rustfs/backlog#2479, SITE-105 on rc.6 and nightly).

Use the raw HTTP status the way the 404 path already does: a 405 without a
code confirms the marker propagated. Ambiguous statuses still fail.

- Unit tests drive `verify_resync_head_result` against a scripted target
  answering 405 (accepted) and 503 (still failed).
- e2e `test_site_replication_resync_replicates_delete_marker` joins two
  sites, converges a live object and a delete marker, and requires the site
  resync to complete with zero failed objects; the repl-nightly selection
  digest is refreshed for the new case.

* fix(replication): verify marker-version purges by absence during resync

A delete-marker resync entry with a pending or failed version purge asks
the target to remove the marker, so the bodiless 405 that proves a
created marker propagated proves the purge did not happen. Accept the
405-as-success mapping only for marker creation (empty
version_purge_status); a purge counts as replicated only when the target
answers not found, and any other HEAD outcome stays failed. Unit tests
drive both purge statuses against the 405 fixture and the 404 fixture.
2026-09-14 11:41:35 +00:00
Chris 36227adc96 fix(io-metrics): drop the rustfs-common edge by injecting the S3 telemetry observer (#7795)
* fix(io-metrics): drop the rustfs-common edge by injecting the S3 telemetry observer

dc700d366 (#7775) made the io-metrics leaf crate depend on rustfs-common
to publish typed telemetry trace events from S3HttpRequestGuard, which
breaks the backlog#1834 leaf-crate rule (io-metrics may only depend on
rustfs-s3-ops).

S3HttpRequestGuard now takes an optional fn-pointer completion observer
(operation, latency, 2xx?) and knows nothing about the trace bus. The
server builds guards through rustfs::server::s3_http_request_guard, which
attaches the observer only while a telemetry subscriber exists and owns
the S3Operation -> TelemetryTraceOperation mapping.

* chore(guard): admit #7785 s3s ratchet growth (+1 file, +4 lines)

#7785 landed the gateway key inventory admin handler after the
baselines were verified, leaving check_s3s_footprint.sh red on main
and every branch cut from it (measured 210 files / 1592 lines vs
209/1588 baselines).

The handler follows the house admin convention whose Operation::call
signature is s3s-typed (S3Request/S3Result), so it cannot route
through a non-s3s seam until the s3gate admin migration replaces the
admin router (rustfs/backlog#1677 F1); no local refactor can shed the
file-level import. Record the measured growth with rationale:
files 209 -> 210, s3_error! lines 1588 -> 1592.

* fix

* fix: resolve clippy gate failures in connect and CLI surfaces

- Box the two large CommandResult performance variants and
  LicenseRenewalOutcome::Installed (clippy::large_enum_variant)
- Return RelayError instead of () from RelayTransport::deliver and the
  test destination (clippy::result_unit_err)
- Drop an unused mut on the protected relay file handle (unused_mut)
- Pass the digest by value to base64 encoding and drop a redundant
  result_json clone (clippy::needless_borrows_for_generic_args,
  clippy::redundant_clone)

* fix(connect): resolve the remaining site-replication clippy errors

- Group the endpoint credential triple into SiteReplicationCredentials
  so SiteReplicationEndpoint::new takes 6 arguments
  (clippy::too_many_arguments)
- Take the build-feature validator by &str (clippy::ptr_arg); the
  validator closure stays because &String needs the deref coercion

* style: apply rustfmt to the site-replication credential grouping

* fix(connect): keep the CPU profile fixture off the ecstore import scan

#7811 used "rustfs_ecstore::disk::read_object" as the raw-symbol fixture
of the profile redaction test, which the architecture guard counts as a
direct rustfs_ecstore reference outside the compatibility boundaries
(its scan deliberately includes inline test modules). The accumulator
treats symbols opaquely, so use the internal rustfs::storage:: path that
keeps the fixture realistic without matching the import scanner.

* fix

* fix

* fix

* fix

---------

Co-authored-by: Hauser <housemecn@gmail.com>
2026-09-14 10:23:52 +00:00
Chris cdf8a81c47 fix(connect): publish diagnostic producer capabilities (#7837) 2026-09-14 14:09:43 +08:00
Chris 6db5ac4968 fix(connect): emit canonical top envelope time (#7836) 2026-09-14 13:53:08 +08:00
Chris c842eed84c Upload diagnostic job results through support bundles (#7831)
feat(connect): upload diagnostic job results
2026-09-14 12:58:00 +08:00
Chris f59e6be338 fix(connect): emit canonical report manifest time (#7830) 2026-09-14 12:38:42 +08:00
Chris 17a9dff081 Run signed diagnostic jobs in the RustFS service (#7829)
feat(connect): run diagnostic jobs in service
2026-09-14 12:21:27 +08:00
Chris f8f2cb05fb fix(connect): accept KMS report upload authorization (#7828) 2026-09-14 12:18:58 +08:00
Chris 174948bd2a feat(connect): verify typed diagnostic jobs (#7827) 2026-09-14 12:11:54 +08:00
Chris 20f4c26417 fix(connect): parse inspect paths as paths (#7826) 2026-09-14 12:11:31 +08:00
Chris 0d322c5086 feat(connect): wrap diagnostic reports for upload (#7822) 2026-09-14 11:02:33 +08:00
Chris db9a420fd2 feat(connect): expose object inspect CLI (#7821) 2026-09-14 10:54:51 +08:00
Chris 9749447825 test(connect): retain CPU profile import bundle (#7820) 2026-09-14 10:54:25 +08:00
Chris 874d0d7b63 test(connect): retain CPU profile verification key (#7819) 2026-09-14 10:50:42 +08:00
Chris d2e2aa7d0b test(connect): verify profile cpu release artifacts (#7818) 2026-09-14 10:48:17 +08:00
Chris c1ecf7155b ci: enable CPU profiling in supported release builds (#7815) 2026-09-14 10:32:24 +08:00
Chris 3eb3213bca fix(connect): observe host traffic in top net (#7814) 2026-09-14 10:31:19 +08:00
Chris b391ec4f0e ci: retain top disk acceptance archive (#7812) 2026-09-14 10:29:28 +08:00
Chris 97ae2ca39a feat(connect): capture bounded local CPU profiles (#7811) 2026-09-14 10:28:39 +08:00
Chris a0bbcba2b9 test(connect): require native top.disk runner (#7809) 2026-09-14 10:24:28 +08:00
Chris dfcee45b98 test(connect): verify top.disk release artifacts (#7808) 2026-09-14 10:21:37 +08:00
Chris b2420a0761 feat(connect): capture live RPC activity (#7807) 2026-09-14 10:21:09 +08:00
Chris 1cd9d1ed5d feat(connect): collect native Linux thread states (#7806)
Collect bounded aggregate thread states from Linux procfs while preserving explicit unsupported outcomes for unavailable scopes.
2026-09-14 10:00:48 +08:00
Chris 797f5b88ad feat(connect): capture live API activity (#7804) 2026-09-14 09:58:43 +08:00
Chris 27b167b543 feat(connect): expose live lock count snapshots (#7801) 2026-09-14 09:40:40 +08:00
Chris b6fbe8f043 fix(release): serialize Linux binary links (#7797) 2026-09-14 08:11:54 +08:00
Chris 3d75acadd3 fix(release): include CLI in Linux artifacts (#7794) 2026-09-14 07:31:34 +08:00
Chris ecaf68d641 fix: skip IAM migration when legacy volume is absent (#7792) 2026-09-14 06:57:54 +08:00
Chris 2a4c13013a fix: classify explicit proxy failures (#7791) 2026-09-14 06:01:23 +08:00
Chris b5a915e338 fix(connect): capture telemetry from server runtime (#7790) 2026-09-14 05:53:00 +08:00
Chris 5d66e9e15b fix: retry interrupted uploads through proxies (#7789)
fix: retry proxied upload interruptions
2026-09-14 05:52:29 +08:00
Chris 4772095e86 fix: retry IAM migration quorum failures on startup (#7788) 2026-09-14 05:52:17 +08:00
Chris 64e0ac08ce revert: remove M1 gateway git dependency until CI can access rustfs/gateway (#7787)
Revert "feat(server): add RUSTFS_S3_STACK with a gateway GetBucketLocation path (#7786)"

This reverts commit b5c2e1da90.
2026-09-14 04:12:35 +08:00
Chris b5c2e1da90 feat(server): add RUSTFS_S3_STACK with a gateway GetBucketLocation path (#7786)
* fix(connect): restore the site replication producer build

The producer shadowed its object_url helper with a local of the same
name, and its test placed the consent nonce on the request, so neither
the rustfs library nor its tests compiled on main.

* feat(server): add RUSTFS_S3_STACK with a gateway GetBucketLocation path

RUSTFS_S3_STACK=legacy (default) keeps the s3s service as the whole S3
entry. RUSTFS_S3_STACK=gateway routes GetBucketLocation through the
RustFS Gateway pipeline pinned at rustfs/gateway@90b83a20 and falls back
to the same s3s service for every other request, decided before the
body is read. Refs rustfs/backlog#1752.
2026-09-14 04:02:20 +08:00
Chris 736e4fb8e8 feat(admin): add a gateway key inventory for the S3 stack switch (#7785)
GET /rustfs/admin/v3/gateway-key-inventory (admin:InspectData) lists
every stored object key the RustFS S3 gateway would refuse on every
operation, so an operator can copy those objects to a safe key before
switching stacks. The rules mirror the gateway key floor; . and ..
segments never appear because ecstore refuses them on every write.

Refs rustfs/gateway#754
2026-09-14 03:51:34 +08:00
Chris df6563e5c0 feat(connect): add service license relay import (#7784) 2026-09-14 03:17:57 +08:00
Chris 2fc3494efb refactor(filemeta): own RestoreStatus and drop the s3s dependency (A3c) (#7782)
Replace s3s::dto::{RestoreStatus, Timestamp} in filemeta with a
filemeta-owned RestoreStatus (same field names, OffsetDateTime expiry).
RestoreStatusOps and parse_restore_obj_status keep their signatures and
persisted rendering; the ecstore restore finalize / lifecycle restore
writers and rustfs RestoreObject now build the filemeta type.

- crates/filemeta: drop s3s; tokio "time" becomes a dev-dependency
  (the metacache tests got it through s3s feature unification).
- metadata_keys: drop the s3s half of the historical-source cross-check;
  PINNED, the pre-A3a fixture and per-character mutation still pin keys.
- new test re-renders the pre-A3a fixture restore value byte-for-byte.
- s3s footprint baselines 210 -> 209 files, ecstore 37 -> 36.

Refs rustfs/backlog#1735
2026-09-14 03:05:49 +08:00
Chris f417d67d96 feat(connect): sign site replication target pair (#7781) 2026-09-14 03:05:38 +08:00
Chris 478cce587d fix(rustfs): restore test compilation (#7780) 2026-09-14 02:59:39 +08:00
Chris 02b3cd3032 fix(connect): restore rustfs build after site replication perf producer (#7779)
#7769 left rustfs/src/connect/diagnostics/perf_site_replication.rs failing
to compile: a local binding named object_url shadowed the object_url()
helper in the same scope (E0618), and a test put the consent nonce on the
request instead of LocalSiteReplicationConsent (E0063/E0560).

Rename the binding to source_url and move the test nonce into the consent.
2026-09-14 02:56:45 +08:00
Chris e5d9c385bd fix(connect): restore site replication test nonce (#7778) 2026-09-14 02:54:25 +08:00
Chris 9ce1bccfb1 fix(connect): avoid shadowing replication URL helper (#7777) 2026-09-14 02:52:38 +08:00
Chris dc700d3662 feat(connect): add typed telemetry trace source (#7775) 2026-09-14 02:46:22 +08:00
Chris 44c49733fd feat(connect): add device report upload client (#7774) 2026-09-14 02:46:12 +08:00
Chris 136bb5de61 fix(connect): export relay CLI types (#7773) 2026-09-14 02:40:19 +08:00
Chris 2ac1a70e68 feat(connect): add approved artifact relay (#7772)
feat(connect): add approved artifact relay core
2026-09-14 02:33:12 +08:00
Chris ca20e06405 feat(connect): add device license renewal client (#7771) 2026-09-14 02:21:53 +08:00
Chris d99460ced0 refactor(ecstore): read persisted object-metadata keys from the filemeta authority (A3b) (#7770)
Migrate ecstore and rustfs-lifecycle consumers of the persisted xl.meta
meta_user keys (object lock, restore, replication status, storage class,
SSE read) from s3s::header / rustfs_utils header constants to
rustfs_filemeta::metadata_keys. HTTP header production is unchanged and
every lookup keeps its previous exact / case-insensitive mode.

- SSE key: persisted only as lowercase; the mixed-case spelling is
  outbound replication user metadata. Keep the case-insensitive read and
  pin it against the pre-A3a fixture.
- warm tier: strip promoted keys case-insensitively so the persisted
  X-Amz-Replication-Status is no longer forwarded to the tier.
- fix stale HashReader::add_checksum_from_s3s call in ecstore tests.

Refs rustfs/backlog#1735
2026-09-14 02:12:36 +08:00
Chris c1190c24e6 feat(connect): add site replication performance producer (#7769)
feat(connect): add site replication performance core
2026-09-14 01:42:53 +08:00