Skip to content

test: adding JSON files from sessions and causal consistency#6

Merged
paulocoghi merged 2 commits into
masterfrom
feat/sessions-and-causal-consistency
Jul 22, 2026
Merged

test: adding JSON files from sessions and causal consistency#6
paulocoghi merged 2 commits into
masterfrom
feat/sessions-and-causal-consistency

Conversation

@paulocoghi

@paulocoghi paulocoghi commented Jul 22, 2026

Copy link
Copy Markdown
Member

This PR delivers full compatibility for Sessions, Causal Consistency, and Snapshot Reads (MongoDB 5.0+):

  1. Snapshot Reads (snapshot-sessions.md):

    • Added support for snapshot: true and snapshot_time in Mongo::Session::Options and ClientSession.
    • Automated extraction and persistence of atClusterTime from server command responses (cursor.atClusterTime or top-level atClusterTime).
    • Automatically injects readConcern: { level: "snapshot", atClusterTime: ... } into all commands within snapshot sessions.
    • Enforced client-side wire version check (maxWireVersion >= 13) raising clean errors on pre-5.0 MongoDB versions.
    • Prohibited starting transactions inside snapshot sessions (Error::Transaction).
  2. Causal Consistency (causal-consistency.md):

    • Updated WithReadConcern.mix_read_concern to propagate readConcern.afterClusterTime on all write commands (insertOne, updateOne, deleteMany, bulkWrite, etc.) outside of transactions when an operation_time exists on the session.
  3. Unified Test Format Runner Updates:

    • Implemented new dispatcher operations: getSnapshotTime, assertSessionDirty, assertSessionNotDirty, assertSameLsidOnLastTwoCommands, and assertDifferentLsidOnLastTwoCommands.
    • Updated client and session entity instantiation in Runner to record CommandStartedEvents and resolve snapshotTime entity references.

Results:

  • Passed: 332 specification tests passing (324 before this PR)

@paulocoghi
paulocoghi merged commit b192c90 into master Jul 22, 2026
1 check passed
@paulocoghi
paulocoghi deleted the feat/sessions-and-causal-consistency branch July 22, 2026 19:44
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.

1 participant