diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2022-12-14 15:58:06 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-12-14 17:06:57 +0000 |
commit | 22adda7d3824aef96e197606b02714bd6e02c91b (patch) | |
tree | 8ddb2a77ce1b6b2c26f5ee90de11ab03cb6342de /jstests/noPassthrough/transaction_write_with_snapshot_unavailable.js | |
parent | b379a035a5a62f006350b13912999fab36330d9d (diff) | |
download | mongo-22adda7d3824aef96e197606b02714bd6e02c91b.tar.gz |
SERVER-71287 Stash CollectionCatalog when starting multi-document transactions
This allows readers to use Collections fully in sync with the multi-document transaction snapshot and eliminates the need for the pessimistic "catalog conflicting timestamp".
Write operations checks that they are operating on the latest version of the collection and throw WCE if not.
Diffstat (limited to 'jstests/noPassthrough/transaction_write_with_snapshot_unavailable.js')
-rw-r--r-- | jstests/noPassthrough/transaction_write_with_snapshot_unavailable.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/jstests/noPassthrough/transaction_write_with_snapshot_unavailable.js b/jstests/noPassthrough/transaction_write_with_snapshot_unavailable.js index b1827e8f922..20bf20a55ca 100644 --- a/jstests/noPassthrough/transaction_write_with_snapshot_unavailable.js +++ b/jstests/noPassthrough/transaction_write_with_snapshot_unavailable.js @@ -11,6 +11,8 @@ (function() { "use strict"; +load("jstests/libs/feature_flag_util.js"); + const name = "transaction_write_with_snapshot_unavailable"; const replTest = new ReplSetTest({name: name, nodes: 1}); replTest.startSet(); @@ -24,6 +26,13 @@ const collNameB = collName + "B"; const primary = replTest.getPrimary(); const primaryDB = primary.getDB(dbName); +if (FeatureFlagUtil.isEnabled(primaryDB, "PointInTimeCatalogLookups")) { + // With the PointInTimeCatalogLookups feature this test doesn't make sense as the + // SnapshotUnavailable error will be removed + replTest.stopSet(); + return; +} + assert.commandWorked(primaryDB[collName].insertOne({}, {writeConcern: {w: "majority"}})); function testOp(cmd) { @@ -31,8 +40,7 @@ function testOp(cmd) { let session = primary.startSession(); let sessionDB = session.getDatabase(name); - jsTestLog( - `Testing that SnapshotUnavailable during ${op} is labelled TransientTransactionError`); + jsTestLog(`Testing that WriteConflict during ${op} is labelled TransientTransactionError`); session.startTransaction({readConcern: {level: "snapshot"}}); assert.commandWorked(sessionDB.runCommand({insert: collName, documents: [{}]})); |