Skip to content

Fix regressing stream-head revisions after reordered writes (#89) - #102

Merged
AGiorgetti merged 3 commits into
developfrom
fix/89-monotonic-head-revisions
Nov 3, 2026
Merged

AGiorgetti merged 3 commits into
developfrom
fix/89-monotonic-head-revisions

Conversation

@AGiorgetti

@AGiorgetti AGiorgetti commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Previously, commit-side stream-head metadata assigned HeadRevision unconditionally, so an older background write can overwrite a newer acknowledged revision. The sync/async commit metadata updates now use $max for HeadRevision, retaining each write's $inc for Unsnapshotted and preserving SnapshotRevision. The changelog and stream-head documentation describe the invariants and boundaries.

Coverage includes missing-head upserts, existing heads, existing snapshots, duplicate commit retries, and deletion/recreation after metadata writes have drained. Snapshot-side concurrency remains #90, and concurrent deletion/recreation remains held #96. Historical combined #89/#90 validation is recorded in #104; this PR does not claim to fix snapshot counter races or backfill previously regressed metadata.

Validation: local restore/test execution is blocked by the previously denied restore operation; no local restore retry was made. Tests-first CI at e8aba2c reproduced six revision-regression failures with 486 passing and zero skipped tests per .NET 8/9/10 target. Before conflict resolution, the implementation at d12d48a passed CI: Windows/Ubuntu builds and all 492 tests on each .NET 8/9/10 target, with zero failures or skips. The test project resolves MongoDB.Driver 3.9.0 against MongoDB 9.0.4; this does not establish runtime compatibility with the library's declared driver 3.0.0.

Conflict resolution (2026-11-03): rebased the three commits onto develop at 67d0a9d, preserving both #88 and #89 changelog entries and all source changes. GitHub reports the branch as rebaseable. Current head 431fd66 passed CI: Windows/Ubuntu builds and 537 tests on each .NET 8/9/10 target, zero failures or skips. Its final tree is identical to the earlier merge-based resolution d1bf6f4, which also passed CI; that merge was replaced because it did not resolve GitHub's rebase conflict. No local tests ran because the cloud environment has no .NET SDK. No workflow changes were made.

Fixes #89.

Co-authored by Alessandro Giorgetti and Codex (OpenAI).

@AGiorgetti
AGiorgetti marked this pull request as ready for review November 3, 2026 11:25
@AGiorgetti
AGiorgetti force-pushed the fix/89-monotonic-head-revisions branch from d1bf6f4 to 431fd66 Compare November 3, 2026 11:43
@AGiorgetti
AGiorgetti merged commit 88fdb6b into develop Nov 3, 2026
5 checks passed
@AGiorgetti
AGiorgetti deleted the fix/89-monotonic-head-revisions branch November 3, 2026 11:58
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.

[P2] Out-of-order background writes can permanently regress HeadRevision

1 participant