perf: cache disk health and fail writes fast on quorum shortages #830
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Related Issues
Summary of Changes
set_disk.rs:新增 750 ms TTL 的磁盘健康缓存,只在缓存过期时对远端盘做is_online()探测,并在在线磁盘少于仲裁时立即返回ErasureWriteQuorum,避免反复触发慢速路径。set_disk.rs: Added a 750 ms disk-health cache so writes probe remote disks only when the cache expires, and now fail fast withErasureWriteQuorumwhen healthy disks are below quorum.set_disk.rs:补充DiskHealthEntry单测,验证缓存命中与过期语义。Added unit tests for
DiskHealthEntryto ensure cache hit/expiry semantics.net.rs:测试 DNS 解析器改为 RAII guard(MockResolverGuard),并按需导入MutexGuard,防止并发测试互相污染全局解析器。Updated the test DNS resolver to use an RAII
MockResolverGuardand gatedMutexGuardunder#[cfg(test)]to eliminate test races.Checklist
make pre-commitDiskHealthEntry单测,net测试仍可运行)Impact
ErasureWriteQuorumOther: Writes now fail fast with
ErasureWriteQuorumwhen quorum isn’t met.