Skip to content

fix(transactions): harden Azure Table transactional state storage - #10376

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:reubenbond-fix-azure-transaction-conflicts
Aug 9, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:reubenbond-fix-azure-transaction-conflicts

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 8, 2026 •

Copy link
Copy Markdown
Member

Azure Table transactional state storage mutates its cached key and prepared-state records before submitting a transaction, so a failed write could leave the storage instance unsafe to reuse. A paginated entity query can also cross a concurrent multi-batch write because continuation pages are independent requests, while conflict failures previously exposed limited context.

Require a successful reload before reuse after a failed mutating store, preserve strict ETag conflict detection, and emit payload-free operation diagnostics with the failed action details supplied by Azure Table Storage. Load queries the key and state rows together. The normal single-page case returns the snapshot in one storage operation. Every physical write batch atomically upserts ! and ~ boundary rows with the same fresh fence value; their keys sort before and after all transactional rows, so matching values from a completed paginated query prove that no boundary-aware batch committed while its pages were read. Torn boundary values retry up to a bound without an additional key read.

Legacy partitions without boundary rows retain the previous one-query behavior. During a rolling upgrade, older writers do not advance existing boundary rows, so paginated torn reads remain intentionally possible until every writer is upgraded; the stronger boundary guarantee applies once the cluster has fully transitioned.

Each physical batch still conditionally advances the key and now reserves two boundary slots, including the final partial batch. A fresh key carries valid empty prior metadata before any split prepare batch can persist it, so a failure after the first physical batch leaves a recoverable intermediate snapshot without prematurely publishing incoming commit metadata or sequence position. Deterministic coverage exercises one-query loads, stable and torn boundary pagination, legacy no-boundary acceptance, bounded churn, fresh split recovery, per-batch fence uniqueness, no-change conflicts, stale-writer recovery, failed-store reuse rejection, and diagnostic redaction.

Azure entity group transactions atomically mutate up to 100 entities sharing a partition, and the transaction batch protocol plus TableTransactionActionType expose mutation actions but no transactional read batch. Query Entities can return a single strongly consistent response, but larger or slower queries resume through subsequent requests under the documented query timeout and pagination semantics. Once all writers maintain the boundary rows, paginated reads become self-validating without another storage request.

Microsoft Reviewers: Open in CodeFlow

@ReubenBond
ReubenBond force-pushed the reubenbond-fix-azure-transaction-conflicts branch 3 times, most recently from 7ec3570 to 4ac6249 Compare August 9, 2026 00:13
@ReubenBond
ReubenBond force-pushed the reubenbond-fix-azure-transaction-conflicts branch 6 times, most recently from 18ebcca to e213d9d Compare August 9, 2026 19:18
Fence paginated transactional state loads after boundary-aware rollout, retain legacy torn-read behavior during rolling upgrades, require reload after failed stores, and include the synchronizer key in every physical mutation batch.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: ee2af1fe-0eb6-41c4-a920-2ca59ba575e4
@ReubenBond
ReubenBond force-pushed the reubenbond-fix-azure-transaction-conflicts branch from e213d9d to 5f387cc Compare August 9, 2026 22:31
@ReubenBond ReubenBond changed the title fix(azure): harden transactional storage conflicts fix(transactions): harden Azure Table transactional state storage Aug 9, 2026
@ReubenBond
ReubenBond merged commit b684937 into dotnet:main Aug 9, 2026
66 of 67 checks passed
@ReubenBond
ReubenBond deleted the reubenbond-fix-azure-transaction-conflicts branch August 9, 2026 23:35
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant