Commit Graph

6024 Commits

Author SHA1 Message Date
houseme 76a861f815 fix(health): align ready with lock quorum (#6554)
Treat lock quorum as part of node readiness for both /health and /health/ready response bodies while preserving the /health liveness HTTP 200 contract.

Add focused regression coverage for lock-quorum-only degradation and make the public /health layer fixture independent from process-global readiness state.

Refs: rustfs/backlog#2011

Co-authored-by: heihutu <heihutu@gmail.com>
2026-08-25 14:26:14 +08:00
houseme 5ce884f605 chore(deps): update s3s revision (#6545)
* chore(deps): update s3s revision

Pin the workspace s3s dependency to rustfs/s3s commit 39080d610e0560c55f068f6dd76b976e267b2f67 and refresh compatible dependencies with cargo update and cargo upgrade.

Co-authored-by: heihutu <heihutu@gmail.com>

* fix(s3): preserve SigV4 body validation errors

Map s3s upload stream body validation failures into existing RustFS client-error types before the PUT body readers consume them. This keeps tampered single-chunk payload hashes from surfacing as InternalError after the s3s revision update.

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

* chore(deps): use s3s 0.15.0 release

Switch the workspace dependency from the temporary s3s git revision to the published 0.15.0 crate and refresh the lockfile updates that come with the release.

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

---------

Co-authored-by: heihutu <heihutu@gmail.com>
2026-08-25 13:01:53 +08:00
houseme 0c4c1caef8 perf(ecstore): add Vec<u8> buffer pool for EC operations (#6538)
* feat(mimalloc): add arena diagnostics and configuration

Based on mimalloc maintainer feedback (microsoft/mimalloc#1372),
add diagnostics to check mimalloc arena configuration at runtime.

Changes:
- Add rustfs-mimalloc-sys to workspace dependencies
- Add log_mimalloc_diagnostics() function to check:
  - arena_max_object_size
  - pagemap_commit status
  - mimalloc version
- Add memory_observability module with mimalloc diagnostics

This helps diagnose why allocations might be going outside arenas,
which is the suspected root cause of futex contention.

Ref: rustfs/backlog#2005
Ref: microsoft/mimalloc#1372

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

* perf(ecstore): add Vec<u8> buffer pool for EC operations

Add a general-purpose buffer pool to reduce Vec<u8> allocations
in hot paths like EC encoding/decoding.

Changes:
- Add BufferPool struct in crates/ecstore/src/erasure/codec/buffer_pool.rs
- Thread-safe pool with capacity-based bucketing (power-of-two)
- Global EC_BUFFER_POOL instance with 16 buffers per bucket
- Add buffer_pool module to codec/mod.rs

Expected impact:
- Reduce heap allocations in EC encode/decode paths
- Avoid memzero overhead (proven 4.8% CPU saving in ShardBufferPool)
- Reduce mimalloc lock contention

Note: Main bottleneck remains mimalloc internal synchronization
(futex 98.64% time). Buffer pool provides modest improvement (+2-5%).

Ref: rustfs/backlog#2005

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

* style: apply cargo fmt to buffer pool and related files

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

* fix(ecstore): add #[allow(dead_code)] to buffer pool

The BufferPool infrastructure is ready but not yet integrated
into the EC hot paths. Add #[allow(dead_code)] with clear
documentation about integration status.

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

* perf(ecstore): integrate BufferPool into bitrot verify path

Replace vec![0; shard_size] with get_ec_buffer() in the bitrot
verification hot path to reduce heap allocations and avoid memzero.

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

* style: apply cargo fmt to buffer pool and bitrot changes

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

* refactor(ecstore): clean up buffer pool code

- Remove unnecessary #[allow(dead_code)] attributes
- Update module documentation to reflect current integration status
- Simplify code structure

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

* perf(runtime): cap default worker threads at 16

Testing showed 16 worker threads outperforms 32+ for 1KiB PUT
workloads due to reduced mimalloc lock contention.

A/B test results (testing 4-node cluster, c=64):
- worker_threads=32: 740 obj/s (baseline)
- worker_threads=16: 785 obj/s (+6.1%)

The default was detect_cores() which returned 32 on our testing
nodes. Cap at 16 for optimal small-object performance.

Ref: rustfs/backlog#2005

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

* style: apply cargo fmt to buffer pool and runtime changes

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

* fix(ecstore): remove unused BufferPool::new() function

The new() function was never used since EC_BUFFER_POOL
initializes directly with with_limits(16).

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

* fix(ecstore): update buffer_pool tests to use with_limits

Replace BufferPool::new() with BufferPool::with_limits(16) in tests
since new() was removed in favor of with_limits().

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

---------

Co-authored-by: hector <hetor@rustfs.com>
Co-authored-by: heihutu <heihutu@gmail.com>
2026-08-25 10:45:44 +08:00
houseme d9cd04e94e fix(config): enable allocator reclaim by default (#6566)
Co-authored-by: heihutu <heihutu@gmail.com>
2026-08-25 10:44:18 +08:00
Zhengchao An 017ffb92f7 test: add live Keycloak OIDC gate (#6562) 2026-08-25 04:34:46 +08:00
Zhengchao An 40f1356831 test(e2e): tighten control character rejection oracle (#6561) 2026-08-25 04:34:35 +08:00
Zhengchao An 619f0fd9e8 test(iam): verify JWKS rotation refresh (#6559) 2026-08-25 04:34:24 +08:00
Zhengchao An 9d68d63802 test(e2e): fail closed on tampered payloads (#6558) 2026-08-25 04:34:13 +08:00
Zhengchao An f41014ede7 test(e2e): require bucket policy denial code (#6557) 2026-08-25 04:34:02 +08:00
Zhengchao An 68dd5bfb9f test(e2e): require exact versioning oracles (#6556) 2026-08-25 04:33:50 +08:00
Zhengchao An 77d7404d77 test(e2e): add pinned direct upgrade gate (#6555) 2026-08-25 04:33:38 +08:00
Zhengchao An 97d2d344b2 test(kms): require exact fault recovery errors (#6553) 2026-08-25 04:33:26 +08:00
Zhengchao An 3da319624f ci: preserve failure verdict before early stop (#6552) 2026-08-25 04:33:16 +08:00
Zhengchao An bb9491f782 test(heal): wait for fixture writes before corruption (#6549) 2026-08-25 04:33:04 +08:00
Zhengchao An 9f12f344c9 test(e2e): require exact checksum errors (#6548) 2026-08-25 04:32:53 +08:00
Zhengchao An 82df9ec4fa test(fuzz): record reproducible run seeds (#6547) 2026-08-25 04:32:41 +08:00
Zhengchao An 40e6decc93 test(e2e): require exact SSE-C errors (#6546) 2026-08-25 04:32:30 +08:00
Zhengchao An 116119d93a test(e2e): require exact quota errors (#6544) 2026-08-25 04:32:19 +08:00
Zhengchao An 6f39765498 test(e2e): require exact bucket compatibility errors (#6540) 2026-08-25 04:32:08 +08:00
Zhengchao An d63ca1f5f5 test(e2e): require exact retention errors (#6535) 2026-08-25 04:31:29 +08:00
houseme 4d43f1ea8a perf: optimize cgroup resource detection with single System instance (#6550)
* perf: optimize cgroup resource detection with single System instance

Consolidate two sysinfo::System instantiations into one for CPU and
memory detection. Pre-compute the metrics basis string ("cgroup"/"host")
in ContainerResources to avoid per-snapshot String allocations in the
memory observability hot path.

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

* style: apply cargo fmt formatting

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

---------

Co-authored-by: heihutu <heihutu@gmail.com>
2026-08-24 20:07:02 +00:00
Zhengchao An 5c6e1abe7e feat(connect): persist sanitized inventory snapshot (#6537)
* feat(connect): persist sanitized inventory snapshot

* fix(connect): harden inventory persistence boundary

* fix(connect): harden inventory path anchors

* fix(connect): fail closed outside Linux

* fix(connect): gate inventory persistence to Linux

* fix(connect): keep runtime failure codes stable

* fix(connect): satisfy cross-platform lint

* fix(connect): preserve inventory persistence invariants

* fix(connect): preserve newer local inventory

* fix(connect): retain legacy inventory capture age

* chore(connect): document unsafe boundaries

* test(connect): secure inventory state fixtures

* fix(connect): preserve heartbeat runtime status
2026-08-25 03:23:02 +08:00
houseme 3b0a28dd9b fix(memory): cgroup-aware resource detection for container environments (#6536)
* fix(iam): raise recursion limit for migration test

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

* fix(memory): cgroup-aware resource detection for container environments

Issue #5803 reported memory RSS regression since beta.9:
- RSS memory steps ~+300 MiB on tiny S3 bursts and never returns
- Daily OOMKills in 1 GiB containers
- Root cause: RustFS uses host memory/CPU instead of container cgroup limits

Changes:
- Add cgroup_resources.rs: cgroup v1/v2 CPU and memory detection
- Add container_config.rs: container configuration with env overrides
- Fix memory_observability.rs: use effective memory (cgroup-aware)
- Fix server/runtime.rs: use cgroup-aware CPU detection for Tokio
- Cap max_blocking_threads to 256 for small containers (<=4 cores)
- Add new metrics: rustfs_memory_effective_total_bytes, rustfs_cgroup_*
- Add startup logging of detected container resources

New environment variables:
- RUSTFS_DISABLE_CGROUP_DETECTION: disable cgroup detection
- RUSTFS_OVERRIDE_CPU_CORES: override detected CPU cores
- RUSTFS_OVERRIDE_MEMORY_BYTES: override detected memory limit

Fixes: rustfs/rustfs#5803
Tracking: rustfs/backlog#2012

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

* style: apply cargo fmt formatting

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

* fix: cross-platform compatibility for cgroup detection

- Move CHANGES_SUMMARY.md and FINAL_SUMMARY.md to docs/operations/
- Add platform-specific cgroup detection (Linux only)
- Non-Linux platforms (macOS, Windows) fall back to host values
- Add platform-specific tests for cgroup detection
- Remove unused imports for non-Linux builds

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

* fix: clippy warnings for cgroup_resources

- Remove unused import super::CgroupResources
- Use derive(Default) instead of manual impl
- Remove redundant trim() before split_whitespace()
- Fix absurd_extreme_comparisons (quota <= 0 for u64)
- Use div_ceil() instead of manual implementation

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

* refactor: consolidate cgroup detection into single module

- Merge cgroup_resources.rs and container_config.rs into unified module
- Remove duplicate test file cgroup_resources_test.rs
- Remove redundant CHANGES_SUMMARY.md and FINAL_SUMMARY.md
- Simplify memory_observability.rs to use unified API
- Simplify server/runtime.rs to use unified API
- All cgroup detection logic now in single source of truth
- Environment variable overrides integrated into main module
- Clippy and fmt clean

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

---------

Co-authored-by: heihutu <heihutu@gmail.com>
2026-08-25 00:45:30 +08:00
Zhengchao An 7be0d56be8 fix(storage): stabilize nextest regressions (#6543) 2026-08-24 23:34:18 +08:00
Zhengchao An dcdaa37b84 fix(e2e): box delete object errors (#6534) 2026-08-24 22:24:37 +08:00
Zhengchao An ea07c781c4 test(ilm): isolate suspended restore stack (#6533) 2026-08-24 22:08:55 +08:00
Zhengchao An 7a7871ca67 test(e2e): require exact object lock errors (#6532) 2026-08-24 22:08:07 +08:00
Henry Guo c80d970d58 fix(table-catalog): classify storage quorum as unavailable (#6531)
Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com>
2026-08-24 21:52:53 +08:00
Zhengchao An 1f40c3ecd0 test(e2e): require remaining 404 absence oracles (#6530) 2026-08-24 21:25:27 +08:00
Zhengchao An 102fb767ce test(ci): stabilize Connect and health fixtures (#6529) 2026-08-24 21:10:33 +08:00
Zhengchao An afb2e4f728 fix(multipart): enforce complete part number limit (#6528) 2026-08-24 21:03:13 +08:00
唐小鸭 3d75e7b51f fix(ecstore): heap-allocate durable ILM receipt futures (#6527)
PR #6369 awaits record_durable_ilm_decommission_progress/terminal inline
from save/delete_transition_transaction_record. Their state machines are
large and sit on the already-deep transition worker poll chain
(worker -> transition -> transaction record -> delete_config -> full
store delete fanout), which overflowed the default 2 MiB tokio worker
stack in debug builds: app::lifecycle_transition_api_test::
compensation_driven_complete_multipart_upload_still_transitions died
with SIGABRT in under a second (first-bad commit via git bisect
1.0.0-rc.3..1ec1a8d90: 34bbc1adb, #6369).

41546dee5 already unblocked the test by moving it onto a dedicated
32 MiB thread; this change removes the underlying stack growth so every
caller of the transaction-record helpers keeps its previous headroom.
With it, the test also passes on a plain 2 MiB tokio worker.
2026-08-24 20:38:46 +08:00
Zhengchao An e4dfc6f45b fix(quota): release reconciled delete holds (#6526) 2026-08-24 20:34:42 +08:00
Zhengchao An c1c6a1e23f fix(storage): stabilize main regressions (#6525) 2026-08-24 20:26:03 +08:00
houseme a8be4f2695 fix(iam): raise recursion limit for migration test (#6524)
Co-authored-by: heihutu <heihutu@gmail.com>
2026-08-24 20:23:21 +08:00
Zhengchao An a1ebe9a3b3 test(ci): stabilize main fixture paths (#6523) 2026-08-24 19:34:02 +08:00
Zhengchao An e2193cc42c fix(ecstore): enforce monotonic transition cursors (#6522) 2026-08-24 19:33:58 +08:00
Zhengchao An 6f14a79089 fix(quota): reconcile matching scanner usage (#6521) 2026-08-24 19:33:53 +08:00
houseme de9e8faa27 fix(health): reflect node readiness in /health response body (#6520)
The /health endpoint (liveness) was returning a hardcoded `ready: true`
in its response body regardless of actual node readiness state. This
caused a semantic contradiction with /health/ready (readiness), which
correctly reported readiness based on storage, IAM, lock quorum, and
peer health.

This led to confusing behavior in Kubernetes deployments where:
- /health returned 200 with `ready: true` (liveness)
- /health/ready returned 503 (readiness)
- Pods remained Running but were removed from Service endpoints

Changes:
- readiness_source_for_probe(Liveness) now returns Node readiness source
- health_check_state() for Liveness reflects actual readiness in body
  while keeping HTTP 200 status (process is alive)
- build_health_response_parts() for Liveness now includes dependency
  details and degradedReasons when readiness report is available

This ensures the `ready` field in /health body is truthful while
maintaining backward compatibility for liveness probe behavior.

Refs: rustfs/backlog#2011

Co-authored-by: heihutu <heihutu@gmail.com>
2026-08-24 18:51:59 +08:00
houseme 2251f22c1a fix(test-utils): raise recursion limit for lib tests (#6518)
Co-authored-by: heihutu <heihutu@gmail.com>
2026-08-24 18:41:49 +08:00
Zhengchao An 70a6a9e8dc fix(ci): repair main test regressions (#6519) 2026-08-24 18:41:26 +08:00
Zhengchao An fe453b7f5b test(iam): create legacy migration bucket through store (#6517) 2026-08-24 18:33:08 +08:00
Zhengchao An ade7e320da test(scanner): align pristine startup fixtures (#6516) 2026-08-24 18:29:47 +08:00
Zhengchao An f6d69ce643 test(connect): use protected home for bootstrap fixtures (#6515) 2026-08-24 18:21:53 +08:00
houseme 762431c0c7 fix(tests): raise recursion limit for rustfs e2e crates (#6513)
Co-authored-by: heihutu <heihutu@gmail.com>
2026-08-24 18:12:28 +08:00
RustFS 1fb5d5a19d docs: remove ROSS Index badge from README (#6514)
Drop the expired Q4 2025 Runa Capital badge from the English and Chinese project READMEs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 18:04:46 +08:00
Zhengchao An 8bd6d8c4db fix(build): restore mimalloc workspace dependency 2026-08-24 17:26:54 +08:00
Zhengchao An 8f2b91f79b fix(ci): refresh e2e full selection 2026-08-24 17:25:45 +08:00
cxymds c2b2b4ffd4 fix(ci): repair post-merge test gates 2026-08-24 17:01:29 +08:00
Zhengchao An 4ceed58be4 docs(operations): document rebalance impact assessment 2026-08-24 17:00:19 +08:00