-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Command Logging and Monitoring, Read and Write Concern
The causal consistency spec and transactions spec state that afterClusterTime must be added to the readConcern on the operation that starts a transaction if a session operationTime is present. There are transaction unified tests that test this specific case. However, our tests fail with:
[2024/02/12 13:40:07.660] 5) Transactions Spec Unified Tests [2024/02/12 13:40:07.660] transaction-options [2024/02/12 13:40:07.660] readConcern local in defaultTransactionOptions: [2024/02/12 13:40:07.660] AssertionError: object has more keys than expected. [2024/02/12 13:40:07.660] actual: [level,afterClusterTime] [2024/02/12 13:40:07.660] expected: [level] [2024/02/12 13:40:07.660] at resultCheck (test/tools/unified-spec-runner/match.ts:264:18) [2024/02/12 13:40:07.660] at checkNestedDocuments (test/tools/unified-spec-runner/match.ts:215:7) [2024/02/12 13:40:07.660] at resultCheck (test/tools/unified-spec-runner/match.ts:250:9) [2024/02/12 13:40:07.660] at compareCommandStartedEvents (test/tools/unified-spec-runner/match.ts:423:5) [2024/02/12 13:40:07.660] at compareEvents (test/tools/unified-spec-runner/match.ts:495:7) [2024/02/12 13:40:07.660] at matchesEvents (test/tools/unified-spec-runner/match.ts:647:5) [2024/02/12 13:40:07.660] at runUnifiedTest (test/tools/unified-spec-runner/runner.ts:221:22) [2024/02/12 13:40:07.660] at processTicksAndRejections (node:internal/process/task_queues:95:5) [2024/02/12 13:40:07.660] at async Context.<anonymous> (test/tools/unified-spec-runner/runner.ts:288:11)
This is because the first operation on a session would not have an operationTime as it is returned from the server, so the very first operation on the session would not have afterClusterTime on its readConcern. The driver actually behaves correctly in that when the command is sent, it is not present. However when the CommandStartedEvent is emitted, it is present, indicating that we've modified some instance of the read concern object after sending the message that is altering the events when actually reported.
- related to
-
NODE-5925 Don't Allow non-Primary Read Preference in Transaction
- Closed