[SERVER-35388] Improve misleading error messages for aggregation stages banned in transactions Created: 04/Jun/18  Updated: 29/Oct/23  Resolved: 25/Jun/18

Status: Closed
Project: Core Server
Component/s: Querying, Replication
Affects Version/s: None
Fix Version/s: 4.0.2, 4.1.1

Type: Improvement Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: Samyukta Lanka
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-35037 Create new concurrency suite that run... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: Repl 2018-06-18, Repl 2018-07-02
Participants:

 Description   

The error messages vary for the aggregation stages not allowed in transactions, as tested in read_concern_snapshot_aggregation.js. Since the readConcern level is upconverted to "snapshot" for transactions, and some of these stages only work with particular readConcern levels, they may error due to the readConcern, which could cause a user to think that the transaction would succeed if they specify a different readConcern level. It would be more helpful to provide an error message that the stage is banned in transactions.

Examples:

"errmsg" : "Aggregation stage $listLocalSessions requires read concern local but
found { readConcern: { level: \"snapshot\" } }",
 
"errmsg" : "$out can not be used with either a 'majority' or 'snapshot' read
concern level",



 Comments   
Comment by Githook User [ 03/Aug/18 ]

Author:

{'name': 'Samy Lanka', 'email': 'samy.lanka@gmail.com', 'username': 'lankas'}

Message: SERVER-35388 Improve misleading error messages for operations banned in transactions

(cherry picked from commit a21c7c7e0d0dcd7bd9b11d62f95ec6496bc617e8)
Branch: v4.0
https://github.com/mongodb/mongo/commit/f3db8e72cf3adfdb41ac2d38e0ef39365911b5f6

Comment by Githook User [ 25/Jun/18 ]

Author:

{'username': 'lankas', 'name': 'Samy Lanka', 'email': 'samy.lanka@gmail.com'}

Message: SERVER-35388 Improve misleading error messages for operations banned in transactions
Branch: master
https://github.com/mongodb/mongo/commit/a21c7c7e0d0dcd7bd9b11d62f95ec6496bc617e8

Comment by Tess Avitabile (Inactive) [ 04/Jun/18 ]

This came up in kay.kim's work documenting aggregation stages allowed in transactions.

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