mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 08:36:54 +00:00
924958bab5
Every GET fans out a `read_version` across all disks to resolve xl.meta. Each fanout allocated an `Arc<ReadOptions>` (3 bools) plus four `Arc<String>` (`Arc::new(x.to_string())` = two allocations each) and cloned them into every spawned task. This trims the per-fanout allocation footprint. - `ReadOptions` is three bools, so it is now `Copy`. The fanout drops the `Arc<ReadOptions>` and hands each spawned task a copy; the two pre-existing `ReadOptions::clone()` sites (set_disk/read.rs, set_disk/ops/heal.rs) stop cloning a `Copy` type. - The four request strings use `Arc::<str>::from(&str)` (one allocation each) instead of `Arc::new(..to_string())` (string buffer + Arc = two each) — four fewer allocations per fanout, transparent to the `read_version(&str)` call. Behavior is unchanged: the fanout still spawns one task per disk (the spawn is deliberate — `read_version_call_counter_observes_spawned_fanout` verifies the process-global counter observes every per-disk increment across workers), quorum / early-stop / full-wait semantics are untouched, and no result ordering or error handling changed. Two larger items from the audit are intentionally NOT in this PR: - `tokio::spawn` -> `FuturesUnordered`: the spawn is a tested, deliberate design (cross-worker counter observation for #1309/#1314), and converting would also change panic isolation. Left as-is. - `vec![FileInfo::default(); N]`: `FileInfo`'s empty containers (String / HashMap / Vec) do not allocate, so this is one `Vec` allocation, not the per-element allocation the audit implied — not a real hot spot. `cargo fmt`, `cargo clippy -p rustfs-ecstore --lib` (0 warnings), `cargo check --lib --tests`, and the 26 fanout / call-counter unit tests pass on macOS (the change is fully cross-platform). Co-authored-by: heihutu <heihutu@gmail.com> Co-authored-by: zhi22915 <qiuzgang@gmail.com>
RustFS ECStore - Erasure Coding Storage
High-performance erasure coding storage engine for RustFS distributed object storage
📖 Documentation
· 🐛 Bug Reports
· 💬 Discussions
📖 Overview
RustFS ECStore provides erasure coding storage capabilities for the RustFS distributed object storage system. For the complete RustFS experience, please visit the main RustFS repository.
✨ Features
- Reed-Solomon erasure coding implementation
- Configurable redundancy levels (N+K schemes)
- Automatic data healing and reconstruction
- Multi-drive support with intelligent placement
- Parallel encoding/decoding for performance
- Efficient disk space utilization
📚 Documentation
For comprehensive documentation, examples, and usage guides, please visit the main RustFS repository.
📄 License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright 2024 RustFS Team
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
RustFS is a trademark of RustFS, Inc.
All other trademarks are the property of their respective owners.
Made with ❤️ by the RustFS Storage Team
