fix(transactions): scope storage fault injection - #10545
Merged
ReubenBond merged 1 commit intoAug 12, 2026
Merged
Conversation
Prevent cleanup writes from consuming transaction-specific prepare-and-commit faults by matching identifiable storage batches to the armed transaction. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses flaky transaction fault-injection behavior in the Transactions TestKit by ensuring one-shot storage faults armed for BeforePrepareAndCommit are scoped to the intended transaction, preventing unrelated/older storage writes from consuming the fault.
Changes:
- Added transaction-id-aware arming and injection APIs for controlled storage fault injectors, with optional transaction matching.
- Updated Azure Table and DynamoDB fault-injection storage wrappers to snapshot transaction IDs from commit records/prepared state and pass them into injector hooks.
- Added regression tests validating scoped faults ignore unrelated batches and unscoped faults still apply to unidentified batches.
Show a summary per file
| File | Description |
|---|---|
| test/Transactions/Orleans.Transactions.Tests/FaultInjectionControlTests.cs | Adds regression tests for scoped vs unscoped storage fault behavior. |
| src/Orleans.Transactions.TestKit.Base/FaultInjection/ControlledInjection/SimpleAzureStorageExceptionInjector.cs | Implements transaction-scoped matching and one-shot consumption protection for storage faults. |
| src/Orleans.Transactions.TestKit.Base/FaultInjection/ControlledInjection/IControlledFaultInjector.cs | Introduces internal scoped injector contract plus helper/extension methods to arm and pass transaction IDs. |
| src/Orleans.Transactions.TestKit.Base/FaultInjection/ControlledInjection/FaultInjectionTransactionReource.cs | Uses the new arming helper and enables transaction-match requirement for BeforePrepareAndCommit. |
| src/Orleans.Transactions.TestKit.Base/FaultInjection/ControlledInjection/FaultInjectionDynamoDBTransactionStateStorage.cs | Captures transaction IDs and routes them into injector Before/AfterStore hooks. |
| src/Orleans.Transactions.TestKit.Base/FaultInjection/ControlledInjection/FaultInjectionAzureTableTransactionStateStorage.cs | Captures transaction IDs and routes them into injector Before/AfterStore hooks. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Lite
This was referenced Aug 28, 2026
Merged
Merged
This was referenced Sep 4, 2026
This was referenced Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #9551
A controlled
BeforePrepareAndCommitstorage fault could be armed while an older cleanup write was still pending. That unrelated batch consumed the one-shot fault, so queue restore completed without correlation to the new transaction and the recovery observer waited until its watchdog.Snapshot transaction IDs from commit records and prepared states before each provider write, then require
BeforePrepareAndCommitfaults to match the armed transaction. Prepare and confirm retain next-write behavior because those provider batches are not always identifiable. Azure and DynamoDB wrappers share the same behavior, with regression coverage for unrelated and unidentified batches, all storage fault types, and one-shot consumption.All 10 Azure fault-injection matrix cases pass on both net8.0 and net10.0 with Azurite.
Microsoft Reviewers: Open in CodeFlow