Commit Graph

3833 Commits

Author SHA1 Message Date
Zhengchao An ecbc5385d3 refactor(runtime): hide local disk id global (#4047) 2026-06-29 16:33:36 +08:00
Zhengchao An ad6be6a167 refactor(runtime): hide local disk map global (#4046) 2026-06-29 14:57:14 +08:00
Zhengchao An 4111ce1547 refactor(runtime): wrap tier config global (#4045) 2026-06-29 14:38:36 +08:00
Zhengchao An e012d1e799 refactor(runtime): wrap boot time global (#4044) 2026-06-29 14:21:31 +08:00
Henry Guo 809e77d5db fix(runtime): keep lock clients available during startup (#4042) 2026-06-29 14:14:26 +08:00
Zhengchao An 4567f6f521 refactor(runtime): guard rpc secret global (#4043) 2026-06-29 14:02:03 +08:00
Zhengchao An 6093eb0c9c refactor(runtime): wrap local node name global (#4041) 2026-06-29 13:13:54 +08:00
Zhengchao An 9c62a24efc refactor(runtime): wrap outbound tls globals (#4039) 2026-06-29 12:56:34 +08:00
Henry Guo de41303f3e feat(table-catalog): add durable backing migration guardrails (#4038)
Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com>
Co-authored-by: houseme <housemecn@gmail.com>
2026-06-29 12:39:04 +08:00
Zhengchao An 9414d645f4 refactor(runtime): wrap rustfs address globals (#4037) 2026-06-29 11:18:30 +08:00
Henry Guo c200dc10d2 fix(scanner): preserve partial scan progress (#3996) 2026-06-29 10:43:25 +08:00
Zhengchao An 9165de3241 refactor(runtime): wrap internode connection cache (#4036) 2026-06-29 10:43:13 +08:00
dependabot[bot] df82e3e645 build(deps): bump the dependencies group with 3 updates (#4030)
Bumps the dependencies group with 3 updates: [aes-gcm](https://github.com/RustCrypto/AEADs), [chacha20poly1305](https://github.com/RustCrypto/AEADs) and [arc-swap](https://github.com/vorner/arc-swap).


Updates `aes-gcm` from 0.11.0-rc.4 to 0.11.0
- [Commits](https://github.com/RustCrypto/AEADs/compare/aes-gcm-v0.11.0-rc.4...aes-gcm-v0.11.0)

Updates `chacha20poly1305` from 0.11.0-rc.3 to 0.11.0
- [Commits](https://github.com/RustCrypto/AEADs/compare/chacha20poly1305-v0.11.0-rc.3...chacha20poly1305-v0.11.0)

Updates `arc-swap` from 1.9.1 to 1.9.2
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/commits)

---
updated-dependencies:
- dependency-name: aes-gcm
  dependency-version: 0.11.0
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: chacha20poly1305
  dependency-version: 0.11.0
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: arc-swap
  dependency-version: 1.9.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: houseme <housemecn@gmail.com>
2026-06-29 10:32:52 +08:00
Zhengchao An 801838fdbd test(ecstore): guard replication facade boundary (#4035) 2026-06-29 10:32:09 +08:00
Zhengchao An 319497446b refactor(ecstore): add lifecycle runtime boundary (#4034)
Co-authored-by: houseme <housemecn@gmail.com>
2026-06-29 10:31:49 +08:00
Zhengchao An 5fc25eccb3 feat(io-core): add truthful buffered io aliases (#4032) 2026-06-29 10:01:59 +08:00
Zhengchao An 1e6f20912a test(ecstore): cover SetDisks storage contracts (#4033) 2026-06-29 10:01:42 +08:00
Zhengchao An ea88f5b67b refactor(obs): use lifecycle runtime facades (#4031) 2026-06-29 09:29:50 +08:00
Zhengchao An ed56ffb54a docs(io): clarify zero copy metric transition (#4029) 2026-06-29 08:21:07 +08:00
Zhengchao An 2d547de84a docs(architecture): inventory global state migration (#4028) 2026-06-29 08:20:32 +08:00
cxymds 0ff261864a fix(scanner): harden data scanner integrity handling (#4012)
* fix(scanner): heal metadata scan failures

* fix(scanner): preserve dirty buckets after scan failures

* feat(scanner): record leader lock liveness

* fix(scanner): preserve failed deep scan state

* fix(scanner): reject untimestamped stale usage

* fix(scanner): report topology-derived admission limit

* fix(scanner): accumulate tier usage stats

* fix(scanner): guard data usage cache recursion

* feat(scanner): expose startup enabled status

* fix(scanner): continue after heal admission rejection

* fix(scanner): avoid cyclic root usage double count

* fix(scanner): preserve dirty markers on cache save failure

* feat(scanner): expose leader liveness status

* fix(scanner): avoid heal escalation for transient metadata reads

* feat(scanner): persist rejected heal retry candidates

* test(scanner): satisfy freshness status clippy

* test(app): avoid global store reinit in context test

* test(app): gate global store helper to tests
2026-06-29 08:19:58 +08:00
Henry Guo cf7af17b43 feat(table-catalog): wire durable strong backing config (#3971)
* feat(table-catalog): wire durable strong backing config

* fix(table-catalog): guard strong backing warehouse prefixes

* fix(checksums): remove unused base64 decode helper

---------

Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com>
2026-06-29 07:58:14 +08:00
Zhengchao An 51d44f20c7 docs(ecstore): inventory replication split blockers (#4027) 2026-06-29 07:57:48 +08:00
Zhengchao An 763cbdd5b7 docs(ecstore): inventory lifecycle split blockers (#4026) 2026-06-29 07:57:22 +08:00
Zhengchao An aaef31d4dd docs(ecstore): inventory api facade boundaries (#4025) 2026-06-29 07:57:01 +08:00
Zhengchao An e1c1d8edcb test: expand snapshot coverage (#4024) 2026-06-29 07:56:37 +08:00
Zhengchao An 1104d630d1 docs(obs): inventory ecstore dependency boundary (#4023) 2026-06-29 07:07:47 +08:00
Zhengchao An 8284e6a75c config: add mmap read env alias (#4021) 2026-06-28 23:24:24 +08:00
Zhengchao An b37c8c6435 build: pin rc crypto dependency versions (#4020) 2026-06-28 22:52:20 +08:00
houseme 0485e5adf0 feat(get): Small-file GET performance optimization for 1KiB-1MiB objects (#4016)
* feat(get): SF01 - bucket validation cache

Add 5s TTL cache for bucket validation to avoid repeated stat_volume()
calls on every GET request.

Changes:
- Add BUCKET_VALIDATED_CACHE (OnceLock + RwLock + HashMap)
- Add invalidate_bucket_validation_cache() for cache invalidation
- Add invalidate_all_bucket_validation_cache() for bulk invalidation
- Update get_validated_store() to use cache
- Add cache invalidation in execute_delete_bucket()

Expected impact: 3-5x improvement for small file GET latency.

Closes rustfs/backlog#766

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

* feat(get): SF03 - metadata cache TTL increase

Increase metadata cache TTL from 250ms to 2s and capacity from 1024
to 4096 entries.

Changes:
- GET_OBJECT_METADATA_CACHE_TTL: 250ms -> 2s
- GET_OBJECT_METADATA_CACHE_MAX_ENTRIES: 1024 -> 4096

All mutation paths already call invalidate_get_object_metadata_cache,
so the longer TTL is safe.

Expected impact: 10-50x improvement for hot objects.

Closes rustfs/backlog#768

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

* feat(get): SF04 - remove unnecessary tokio::spawn in metadata fanout

Replace tokio::spawn with direct async future in read_all_fileinfo_full_wait.
join_all already provides concurrency, so tokio::spawn adds unnecessary
task creation and scheduling overhead.

Changes:
- Remove tokio::spawn from metadata fanout futures
- Update result handling for direct future results

Expected impact: 16-32us reduction per GET request.

Closes rustfs/backlog#769

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

* feat(get): SF06 - conditional lifecycle check

Only call resolve_put_object_expiration when the object has an
x-amz-expiration metadata marker. This avoids unnecessary lifecycle
configuration reads on every GET request.

Expected impact: 50-100us reduction per GET request.

Closes rustfs/backlog#771

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

* feat(get): SF07 - conditional metrics recording

Gate hot path metrics behind get_stage_metrics_enabled() to reduce
overhead when metrics are not needed.

Changes:
- Conditional record_zero_copy_read
- Conditional manager.record_disk_operation
- Conditional manager.record_access
- Conditional manager.record_transfer

Expected impact: 20-50us reduction per GET request.

Closes rustfs/backlog#772

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

* refactor(get): SF01 - use moka instead of dashmap for bucket cache

Replace OnceLock + RwLock + HashMap with moka::sync::Cache for bucket
validation cache. moka provides built-in TTL support and is already
available in the workspace.

Changes:
- Add moka dependency to rustfs crate
- Replace manual TTL management with moka's time_to_live
- Simplify cache operations

Closes rustfs/backlog#766

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

* feat(get): SF02 - inline data fast path

Add fast path for small inline objects that bypasses duplex pipe,
tokio::spawn, and bitrot reader creation when data is already in memory.

Changes:
- Add inline data detection before codec streaming gate
- Direct in-memory erasure decode for inline objects <= 128KB
- Add GET_OBJECT_PATH_INLINE_DIRECT metric path
- Skip duplex pipe and background task for inline data

Conditions for fast path:
- Single part object
- Inline data available
- Size <= 128KB
- Not encrypted/compressed/remote
- No range request

Expected impact: 2-3x improvement for small file GET latency.

Closes rustfs/backlog#767

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

* refactor: translate Chinese comments to English

Translate all Chinese comments to English in modified files:
- rustfs/src/storage/ecfs_extend.rs
- rustfs/src/app/bucket_usecase.rs

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

* fix

* add

* fmt and improve import

* fmt

* feat(get): SF05 skip IO planning + refactor inline detection + adaptive bucket cache

SF05: Skip disk I/O semaphore for inline data fast path
- Reorder prepare_get_object_read_execution: read first, then decide semaphore
- Inline objects skip acquire_disk_read_permit() entirely (saves 100-200us)
- Add is_inline_fast_path field to GetObjectReadSetup

Refactor: Unify inline detection logic
- Add ObjectInfo::is_inline_fast_path_eligible() as single source of truth
- Version-aware thresholds: non-versioned 128KB, versioned 16KB (matches PUT)
- Eliminates divergent conditions between set_disk/mod.rs and object_usecase.rs

Refactor: Restore fault tolerance in metadata fanout
- Restore tokio::spawn + JoinError handling in read_all_fileinfo_full_wait
- Prevents single disk read panic from unwinding the entire operation

Refactor: Restore lifecycle check correctness
- Remove incorrect SF06 conditional that skipped lifecycle for most objects
- Always call resolve_put_object_expiration (original behavior)

Fix: make_bucket cache invalidation
- Invalidate bucket validation cache on create_bucket

Fix: erasure decode written validation
- Check decode() return value; error if 0 bytes written for non-empty object

Adaptive bucket cache
- Default: RwLock<HashMap> for < 100 buckets (low overhead)
- Opt-in: starshard::ShardedHashMap via RUSTFS_BUCKET_CACHE_STARSHARD=1
- 5s TTL with manual timestamp checking

Benchmark results (warp get, concurrency 32, 10s, 3 rounds):
- 10KiB: 25.10 MiB/s (+28.2% vs SF01-07)
- 100KiB: 221.81 MiB/s
- 1MiB: 1972.78 MiB/s
- vs main: -10% to -12% (inline path not triggered by warp)

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

* fix(versioning): use read lock for versioning config query + five-expert analysis

P0 fix: BucketVersioningSys::get() was using write lock on
GLOBAL_BucketMetadataSys for a pure read operation. This serialized
all concurrent GET requests (3 write-lock acquisitions per request).

Changed to read lock — get_versioning_config() handles its own
internal locking via metadata_map RwLock.

Five-expert analysis identified top bottlenecks:
1. Versioning write lock (P0, fixed)
2. Inline fast path not triggered (P0, needs verification)
3. Metadata fanout no early-stop (P1, early-stop has bug, reverted)
4. Request-level versioning cache (P1, pending)
5. Duplex pipe for small objects (P2, pending)

Benchmark (read-lock fix, warp concurrency 32):
- 1KiB: 2.29 MiB/s (vs 2.53 before, within variance)
- 10KiB: 25.00 MiB/s (same as before)
- 100KiB: 246.72 MiB/s (+11% vs 221.81)
- 1MiB: 2039.95 MiB/s (+3% vs 1972.78)

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

* chore: remove benchmark results from git, keep locally only

Remove docs/benchmark/*.md from version control.
Files remain on disk but are no longer tracked by git.
Added docs/benchmark/*.md to .gitignore.

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

* fix(get): decode inline fast path through bitrot readers

---------

Co-authored-by: heihutu <heihutu@gmail.com>
2026-06-28 22:35:42 +08:00
Zhengchao An f5d7fea7a4 fix(ecstore): remove unused mirror fields (#4019) 2026-06-28 22:31:37 +08:00
Zhengchao An 0f3213a530 docs: update security advisory lessons (#4018) 2026-06-28 21:55:40 +08:00
Zhengchao An 99f981a868 docs: plan ecstore split boundaries (#4017)
docs: plan ecstore module split boundaries
2026-06-28 21:55:10 +08:00
Zhengchao An ed0f191e1a docs: document global singleton migration plan (#730) (#4015)
docs: document global singleton migration plan

Add comments documenting the Tier A/B classification and migration
plan for global singletons in ecstore runtime.

Refs #730
2026-06-28 21:25:42 +08:00
Zhengchao An 163e8089db fix: remove all backlog links from code and comments (#4013) 2026-06-28 20:55:25 +08:00
Zhengchao An aa8b8b5706 docs: document crypto RC version dependencies (#732) (#4011)
* docs: document crypto RC version dependencies

Add comment explaining why aes-gcm and chacha20poly1305 use RC
versions and the migration path when stable versions are released.

Refs #732

* fix: remove all backlog links from code and comments
2026-06-28 20:47:51 +08:00
Zhengchao An cd165ab181 docs: document obs reverse dependency on ecstore (#735) (#4010)
docs: document obs reverse dependency on ecstore

Add comment explaining why obs depends on ecstore and the scope
of work required to break this dependency.

Refs #735

Co-authored-by: houseme <housemecn@gmail.com>
2026-06-28 20:28:04 +08:00
Zhengchao An a37e918936 docs: document SHA-1 HMAC migration proposal (#747) (#4009) 2026-06-28 19:42:18 +08:00
Zhengchao An 8d0ba1cd3c docs: document deadlock detector mutex design rationale (#744) (#4008)
docs: document deadlock detector mutex design rationale

Add comment explaining why std::sync::Mutex is used instead of
tokio::sync::Mutex in the deadlock detector.

Refs #744

Co-authored-by: houseme <housemecn@gmail.com>
2026-06-28 19:29:50 +08:00
Zhengchao An 27b8592879 docs: add documentation to storage-api public types (#741) (#4007)
docs: add documentation to storage-api public types

Add doc comments to public structs, enums, and traits in
storage-api crate to improve documentation coverage.

Refs #741
2026-06-28 19:12:02 +08:00
Zhengchao An 1f56ddf913 docs: document table_catalog mutex design rationale (#739) (#4006)
docs: document table_catalog mutex design rationale

Add comment explaining why the single mutex is intentional and
what alternatives to consider if contention becomes a bottleneck.

Refs #739
2026-06-28 18:56:13 +08:00
Zhengchao An 710ae74cde perf: add S3 operations benchmark framework (#738) (#4005) 2026-06-28 18:02:41 +08:00
Zhengchao An 51acf2a99c feat: add rate limiting middleware framework (#737) (#4002)
* feat: add rate limiting middleware framework

Add rate limiting middleware with token bucket algorithm for
per-client request rate limiting. This provides the foundation
for DoS protection.

Refs #737

* fix: address clippy lints in rate_limit.rs

- Collapse nested if statements into single if-let chains
- Use .is_multiple_of() instead of manual modulo check
2026-06-28 17:48:40 +08:00
Zhengchao An ee82d6c026 test: add insta snapshot test for storage error display format (#740) (#4001)
test: add insta snapshot test for storage error display format

Add snapshot test to detect unexpected changes in StorageError
display format. This catches output format regressions that
traditional assert tests might miss.

Refs #740
2026-06-28 16:10:07 +08:00
Zhengchao An 84cdf12083 test(security): add security boundary tests (#748) (#3998)
test(security): add security boundary tests

Add e2e tests for security-sensitive scenarios:
- Large XML body handling (DoS protection)
- Excessive multipart parts (DoS protection)
- Concurrent object operations (race condition handling)
- Internal URL validation (SSRF prevention)

Refs #748
2026-06-28 15:17:30 +08:00
Zhengchao An c768a9c382 docs(storage-api): document filemeta dependency as known limitation (#731) (#3997)
* docs(storage-api): document filemeta dependency as known limitation

Add comment explaining why storage-api depends on filemeta and
the scope of work required to break this dependency (300+ files).

Refs https://github.com/rustfs/backlog/issues/731

* docs(storage-api): remove backlog link from comment
2026-06-28 14:59:24 +08:00
Zhengchao An c475d03b48 fix: replace unwrap() with expect() in more files (#729 batch 14) (#3994) 2026-06-28 11:45:23 +08:00
Zhengchao An 05d201679c fix: replace unwrap() with expect() in more files (#729 batch 13) (#3993) 2026-06-28 11:45:13 +08:00
Zhengchao An f0ab812213 fix: replace unwrap() with expect() in remaining files (#729 batch 12) (#3992) 2026-06-28 11:45:03 +08:00
Zhengchao An 1f8a5bc095 fix(ecstore): replace unwrap() with proper error handling in api_get_object_attributes (#729 batch 11) (#3991)
fix(ecstore): replace unwrap() with proper error handling in api_get_object_attributes

Replace unsafe unwrap() calls with proper error handling in
api_get_object_attributes.rs:
- HTTP header access now uses ok_or_else with descriptive messages
- String parsing now uses map_err with descriptive messages
- HeaderValue creation now uses expect with descriptive messages

Refs https://github.com/rustfs/backlog/issues/729
2026-06-28 11:23:41 +08:00