Skip to content

[ENH](wal3): add optional upload fault injector#6849

Merged
rescrv merged 1 commit intomainfrom
rescrv/wire-up-faults
Apr 15, 2026
Merged

[ENH](wal3): add optional upload fault injector#6849
rescrv merged 1 commit intomainfrom
rescrv/wire-up-faults

Conversation

@rescrv
Copy link
Copy Markdown
Contributor

@rescrv rescrv commented Apr 8, 2026

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

@rescrv rescrv requested a review from sanketkedia April 8, 2026 20:07
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@propel-code-bot
Copy link
Copy Markdown
Contributor

propel-code-bot bot commented Apr 8, 2026

wal3 optional fragment upload fault injection and log-service wiring

This PR adds a new optional fault-injection path for fragment uploads in wal3 and threads it through log-service so upload operations can be delayed or failed using the wal3.fragment_upload label. The core change introduces fault-aware wrappers around fragment manager factories and uploaders, while preserving default behavior when no injector is configured.

To support this, the FragmentManagerFactory contract is expanded to expose make_fragment_uploader and write_options, and concrete implementations in rust/wal3/src/interfaces/s3/mod.rs, rust/wal3/src/interfaces/repl/mod.rs, and test factories were updated accordingly. log-service adds feature-gated integration with FaultRegistry, passes the injector through open/copy/fork/update/GC paths, and adds focused tests validating failure and recovery when faults are injected.

This summary was automatically generated by @propel-code-bot

propel-code-bot[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@propel-code-bot propel-code-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread rust/wal3/src/interfaces/s3/mod.rs Outdated
Comment thread rust/wal3/src/interfaces/repl/mod.rs Outdated
Comment on lines +129 to +136
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),
))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommended

[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: 136

Comment thread rust/wal3/src/interfaces/mod.rs Outdated
Copy link
Copy Markdown
Contributor

@propel-code-bot propel-code-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review found no issues; the changes appear well-implemented and low risk.

Status: No Issues Found | Risk: Low

Review Details

📁 14 files reviewed | 💬 0 comments

Base automatically changed from rescrv/fault-injection to main April 15, 2026 20:37
@rescrv rescrv force-pushed the rescrv/wire-up-faults branch from 605427f to 4780128 Compare April 15, 2026 20:40
@rescrv rescrv merged commit f9a7f68 into main Apr 15, 2026
63 checks passed
@rescrv rescrv deleted the rescrv/wire-up-faults branch April 15, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants