Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-35388

Improve misleading error messages for aggregation stages banned in transactions

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.2, 4.1.1
    • Affects Version/s: None
    • Component/s: Querying, Replication
    • None
    • Fully Compatible
    • v4.0
    • Repl 2018-06-18, Repl 2018-07-02

      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.


      "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",

            samy.lanka@mongodb.com Samyukta Lanka
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            0 Vote for this issue
            6 Start watching this issue