[ENH](wal3): add optional upload fault injector#6849
[ENH](wal3): add optional upload fault injector#6849rescrv wants to merge 1 commit intorescrv/fault-injectionfrom
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
|
This PR introduces a new optional fault-injection layer for fragment uploads in To support this, the This summary was automatically generated by @propel-code-bot |
There was a problem hiding this comment.
The PR is functionally solid, with minor recommendations to reduce duplicated factory logic and clarify public API visibility/docs for newly exposed fault-injection traits and types.
Status: Minor Suggestions | Risk: Low
Issues Identified & Suggestions
- Duplicate consumer construction logic; extract shared builder helpers.
rust/wal3/src/interfaces/s3/mod.rs,rust/wal3/src/interfaces/repl/mod.rs - Public
#[doc(hidden)]APIs are confusing; make crate-private or document.rust/wal3/src/interfaces/mod.rs,rust/wal3/src/lib.rs
Review Details
📁 6 files reviewed | 💬 3 comments
👍 / 👎 individual comments to help improve reviews for you
rust/wal3/src/interfaces/repl/mod.rs
Outdated
| async fn make_consumer(&self) -> Result<Self::Consumer, Error> { | ||
| let storages = Arc::clone(&self.storages); | ||
| Ok(FragmentReader::new( | ||
| self.repl.clone(), | ||
| self.preferred, | ||
| storages, | ||
| Arc::clone(&self.read_repair_semaphore), | ||
| )) |
There was a problem hiding this comment.
[Maintainability] [CodeDuplication] The make_consumer implementation in FragmentManagerFactoryWithUploader for ReplicatedFragmentManagerFactory (lines 129–137) is identical to the make_consumer in FragmentManagerFactory for ReplicatedFragmentManagerFactory (lines ~108–114 in the after state): both call FragmentReader::new(self.repl.clone(), self.preferred, storages, Arc::clone(&self.read_repair_semaphore)). The same duplication exists in rust/wal3/src/interfaces/s3/mod.rs for S3FragmentPuller. Extract a build_fragment_reader helper (matching build_fragment_uploader) to eliminate this duplication and prevent drift.
Context for Agents
[CodeDuplication] The `make_consumer` implementation in `FragmentManagerFactoryWithUploader for ReplicatedFragmentManagerFactory` (lines 129–137) is identical to the `make_consumer` in `FragmentManagerFactory for ReplicatedFragmentManagerFactory` (lines ~108–114 in the after state): both call `FragmentReader::new(self.repl.clone(), self.preferred, storages, Arc::clone(&self.read_repair_semaphore))`. The same duplication exists in `rust/wal3/src/interfaces/s3/mod.rs` for `S3FragmentPuller`. Extract a `build_fragment_reader` helper (matching `build_fragment_uploader`) to eliminate this duplication and prevent drift.
File: rust/wal3/src/interfaces/repl/mod.rs
Line: 136a22817f to
252e8a2
Compare
fbe720a to
6ef50b1
Compare
6ef50b1 to
605427f
Compare
Description of changes
Add a generic fragment-manager shim in wal3 that can wrap
fragment uploaders with an optional fault injector.
Wire chroma-log-service's FaultRegistry through the S3,
repl, and copy/open paths so fragment uploads can be
delayed or failed via the wal3.fragment_upload label.
Keep the injector optional for callers that do not want
fault injection, and add focused wal3 and log-service
coverage for the new path.
Test plan
CI
Migration plan
N/A
Observability plan
This is about fault injection.
Documentation Changes
N/A
Co-authored-by: AI