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

readConcern parse failure on start of multi-statement transaction does not abort

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • ALL
    • Repl 2018-04-23
    • 45

      The following when run under the core_txns executor will trigger an invariant. This test performs the following:

      1. Creates a collection with a single document
      2. Starts a session and runs an autocommit:false update operation with an invalid readConcern level (which fails as expected)
      3. Performs a find under the same txnNumber as the failed update. This find executes as if it is in a transaction, establishes a WriteUnitOfWork and fails later when a yield is attempted on an invariant that we are not yielding under a WriteUnitOfWork

      I would expect the find to error instead due to a previously aborted transaction.

      var collName = 'coll';
      
      assert.commandWorked(db[collName].insert([{}]));
      
      var session = db.getMongo().startSession({causalConsistency: false});
      var sessionDb = session.getDatabase('test');
      
      assert.commandFailedWithCode(sessionDb.runCommand({
          update: collName,
          updates: [{}],
          readConcern: {
              level: ""
          },
          txnNumber: NumberLong(0),
          autocommit: false
      }), ErrorCodes.FailedToParse);
      
      // The following fails due to: Invariant failure !_planYielding->getOpCtx()->lockState()->inAWriteUnitOfWork() src/mongo/db/query/plan_yield_policy.cpp 78
      assert.commandWorked(sessionDb.runCommand({find: collName, txnNumber: NumberLong(0)}));
      

            Assignee:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: