-
Type: Bug
-
Resolution: Duplicate
-
Priority: 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:
- Creates a collection with a single document
- Starts a session and runs an autocommit:false update operation with an invalid readConcern level (which fails as expected)
- 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)}));
- duplicates
-
SERVER-34073 Allow creating transactions with readconcerns other than 'snapshot', upconvert to 'snapshot'
- Closed