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

Aggregation error aborts the transaction without letting the shell helper know

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: Needs Triage
    • Component/s: Replication
    • None
    • Replication
    • ALL
    • Hide

      Extract from read_concern_snapshot_aggregation.js
      // Test that $changeStream is disallowed with snapshot reads.
      session.startTransaction({readConcern: {level: "snapshot"}});
      assert.commandFailedWithCode({aggregate: coll, pipeline: [{$changeStream: {}], cursor: {}});
      session.commitTransaction();

      Show
      Extract from read_concern_snapshot_aggregation.js // Test that $changeStream is disallowed with snapshot reads. session.startTransaction({readConcern: {level: "snapshot"}}); assert.commandFailedWithCode({aggregate: coll, pipeline: [{$changeStream: {}] , cursor: {}}); session.commitTransaction();

      Error due to aggregation not supporting snapshot reads will abort the transaction. So if we commit/abort the transaction from the shell helper, we will get an “transaction has been aborted” error. And the shell helper doesn’t know about the abort, so starting a new transaction triggers an error: `There is already an active transaction on this session`.
      I think the fix would be either handling the aggregation error differently or letting shell helper end the transaction quietly with commit/abortTransaction even when there is an "transaction has been aborted" error.

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            xiangyu.yao@mongodb.com Xiangyu Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: