[SERVER-42052] Improve error message for using change streams in a transaction Created: 02/Jul/19  Updated: 29/Oct/23  Resolved: 03/Sep/19

Status: Closed
Project: Core Server
Component/s: Diagnostics, Usability
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Improvement Priority: Major - P3
Reporter: Charlie Swanson Assignee: Backlog - Query Team (Inactive)
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Query
Backwards Compatibility: Fully Compatible
Participants:

 Description   

The error message you get is something like

Operation not permitted in transaction :: caused by :: $changeStream cannot run with a readConcern other than 'majority', or in a multi-document transaction. Current readConcern: { readConcern: { level: "snapshot" } }

This doesn't make it clear that no type of transaction is supported with change streams. The word "nor" might be better, but it should be revisited as a whole.



 Comments   
Comment by Samyukta Lanka [ 03/Sep/19 ]

Fixed as a part of: https://github.com/mongodb/mongo/commit/720e7b216316eac5f5dc18f26684cd2ca1ed17e2

Comment by Justin Seyster [ 02/Jul/19 ]

If we decide to keep this as one sentence instead of splitting it into two separate errors, I think we should convert it to an "and" style, to make it clear the there are two requirements that both must be satisfied.

"$changeStream must run with a 'majority' readConcern and must not run within a transaction. Current readConcern: ..."

Generated at Thu Feb 08 04:59:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.