Skip to content

Feature: query-and-write readConcern parameter#615

Open
imforster wants to merge 4 commits into
documentdb:mainfrom
imforster:forstaia/read_concern/query_and_write
Open

Feature: query-and-write readConcern parameter#615
imforster wants to merge 4 commits into
documentdb:mainfrom
imforster:forstaia/read_concern/query_and_write

Conversation

@imforster

@imforster imforster commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

#39
Test cases: 205 (+ 9 replica_set skipped on standalone)
Docs: https://www.mongodb.com/docs/v8.2/reference/read-concern/

Adds compatibility test coverage for the readConcern cross-cutting parameter, validating its full surface area across read commands (find, aggregate, count, distinct) and write commands (insert, update, delete, findAndModify) - from level acceptance and functional equivalence to full BSON type rejection matrix, invalid level strings, null coercion, snapshot/linearizable restrictions, command option interactions, empty/non-existent collections, views, cursor continuation (getMore), and afterClusterTime validation.

205 test cases across 9 files following project test guidelines.

@imforster imforster requested a review from a team as a code owner June 16, 2026 22:43
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 16, 2026
@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: compatibility test, enhancement
Project fields suggested: Component test-coverage · Priority P2 · Effort L · Status Needs Review
Confidence: 0.90 (mixed)

Reasoning

component from path globs (test-coverage); effort from diff stats (1313+0 LOC, 10 files); LLM: Adds 205 new compatibility test cases across 9 files covering the readConcern parameter surface area for multiple read/write commands, which is a substantial multi-file test coverage expansion.

If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

Test cases: 205 (+ 9 replica_set skipped on standalone)
Docs: https://www.mongodb.com/docs/v8.2/reference/read-concern/

Adds compatibility test coverage for the readConcern cross-cutting parameter,
validating its full surface area across read commands (find, aggregate, count,
distinct) and write commands (insert, update, delete, findAndModify) - from
level acceptance and functional equivalence to full BSON type rejection matrix,
invalid level strings, null coercion, snapshot/linearizable restrictions,
command option interactions, empty/non-existent collections, views, cursor
continuation (getMore), and afterClusterTime validation.

205 test cases across 9 files following project test guidelines.

Signed-off-by: Ian Forster <forstaia@amazon.com>
Adds test_read_concern_local.py covering the MongoDB spec properties
for readConcern level 'local':

- Local is the implicit default: verify omitting readConcern produces
  identical results to explicit {"level": "local"} for all 4 read
  commands (find, aggregate, count, distinct).
- Available without session/transaction: confirm all 4 commands succeed
  with 'local' in a plain context with no session, no transaction, and
  no replica set requirement.
- Reads local state immediately: verify freshly-inserted documents are
  visible under 'local' without propagation delay.
- Reflects mutations: verify 'local' sees in-place updates and deletions
  applied to the local instance right away.

18 tests total (14 parametrized + 2 standalone).

Signed-off-by: Ian Forster <forstaia@amazon.com>
Align with PR documentdb#617 which replaced topology-coupled markers with
capability-based precondition markers.

Signed-off-by: Ian Forster <forstaia@amazon.com>
@imforster imforster force-pushed the forstaia/read_concern/query_and_write branch from 6f26257 to 6fa1aef Compare June 23, 2026 23:53
…n=False

NOT_A_REPLICA_SET_ERROR for snapshot outside transaction is standalone-
specific. On a replica set, this produces a different error. Gate the
test so it only runs where cluster_read_concern is absent.

Signed-off-by: Ian Forster <forstaia@amazon.com>
@imforster imforster force-pushed the forstaia/read_concern/query_and_write branch from 866cfcd to 6ff7b8b Compare June 24, 2026 00:16

@eerxuan eerxuan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • Cut the multi-command fan-out for the acceptance/validation axis in the cross-cutting dir. LEVEL_ACCEPTANCE_TESTS, NON_DOCUMENT_READ_CONCERN_TESTS, INVALID_LEVEL_TYPE_TESTS, INVALID_LEVEL_STRING_TESTS, null-coercion — these iterate ["find", "aggregate", "count", "distinct"] and duplicate what the per-command files already cover exhaustively. They should live per-command (and largely already do for count/distinct/aggregate).
  • Keep the behavioral tests, collapsed to one representative command. The local/snapshot/linearizable semantic files are the legitimate cross-cutting content; pick one command (find is the natural representative) instead of repeating per command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility test Compatibility test related enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants