diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2019-03-07 17:29:24 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2019-03-13 12:15:11 -0400 |
commit | ac2e9336b62fc726b29aa624b8ac05bc045523e5 (patch) | |
tree | 9980721c51ba0baa24c57121ad292d8d4eae886a /jstests/concurrency | |
parent | 422e304a2b3514c1b3f8f3dd452fcd5fc598b51f (diff) | |
download | mongo-ac2e9336b62fc726b29aa624b8ac05bc045523e5.tar.gz |
SERVER-38297 Reenable FSM transactions tests with killOp
Diffstat (limited to 'jstests/concurrency')
4 files changed, 13 insertions, 9 deletions
diff --git a/jstests/concurrency/fsm_workload_helpers/cleanup_txns.js b/jstests/concurrency/fsm_workload_helpers/cleanup_txns.js index df44058f36b..c3e135c98d5 100644 --- a/jstests/concurrency/fsm_workload_helpers/cleanup_txns.js +++ b/jstests/concurrency/fsm_workload_helpers/cleanup_txns.js @@ -11,13 +11,14 @@ function abortTransaction(sessionAwareDB, txnNumber, errorCodes) { // Don't use the given session as it might be in a state we don't want to be and // because we are trying to abort with arbitrary txnNumber. let rawDB = sessionAwareDB.getSession().getClient().getDB(sessionAwareDB.getName()); - const res = rawDB.adminCommand({ + + const abortCmd = { abortTransaction: 1, lsid: sessionAwareDB.getSession().getSessionId(), txnNumber: NumberLong(txnNumber), autocommit: false - }); - + }; + const res = rawDB.adminCommand(abortCmd); return assert.commandWorkedOrFailedWithCode(res, errorCodes, () => `cmd: ${tojson(abortCmd)}`); } diff --git a/jstests/concurrency/fsm_workload_helpers/snapshot_read_utils.js b/jstests/concurrency/fsm_workload_helpers/snapshot_read_utils.js index a020855727b..8662e4f945e 100644 --- a/jstests/concurrency/fsm_workload_helpers/snapshot_read_utils.js +++ b/jstests/concurrency/fsm_workload_helpers/snapshot_read_utils.js @@ -83,7 +83,6 @@ function doSnapshotGetMore(collName, data, getMoreErrorCodes, commitTransactionE const commitCmd = { commitTransaction: 1, txnNumber: NumberLong(data.txnNumber), - stmtId: NumberInt(data.stmtId++), autocommit: false }; res = data.sessionDb.adminCommand(commitCmd); diff --git a/jstests/concurrency/fsm_workloads/multi_statement_transaction_atomicity_isolation.js b/jstests/concurrency/fsm_workloads/multi_statement_transaction_atomicity_isolation.js index 72cab1d2ffe..89ac177ad1c 100644 --- a/jstests/concurrency/fsm_workloads/multi_statement_transaction_atomicity_isolation.js +++ b/jstests/concurrency/fsm_workloads/multi_statement_transaction_atomicity_isolation.js @@ -35,6 +35,7 @@ * (b) transaction C's (tid, txnNumber, numToUpdate) element doesn't appear numToUpdate times * across a consistent snapshot of all of the documents. This would suggest that the database * failed to atomically update all documents modified in a concurrent transaction. + * * (c) transaction D's (tid, txnNumber) for a given (docId, dbName, collName) doesn't match the * (tid, txnNumber) for the thread with threadId == tid. This indicates that there are writes * that exist in the database that were not committed. diff --git a/jstests/concurrency/fsm_workloads/snapshot_read_kill_operations.js b/jstests/concurrency/fsm_workloads/snapshot_read_kill_operations.js index ca5afd928c3..6a68f7d93ad 100644 --- a/jstests/concurrency/fsm_workloads/snapshot_read_kill_operations.js +++ b/jstests/concurrency/fsm_workloads/snapshot_read_kill_operations.js @@ -6,7 +6,9 @@ * * @tags: [uses_transactions, state_functions_share_transaction] */ + load('jstests/concurrency/fsm_workload_helpers/snapshot_read_utils.js'); + var $config = (function() { const data = {numIds: 100, batchSize: 50}; @@ -24,11 +26,12 @@ var $config = (function() { snapshotFind: function snapshotFind(db, collName) { const sortByAscending = false; - doSnapshotFind( - sortByAscending, - collName, - this, - [ErrorCodes.NoSuchTransaction, ErrorCodes.LockTimeout, ErrorCodes.Interrupted]); + doSnapshotFind(sortByAscending, collName, this, [ + ErrorCodes.NoSuchTransaction, + ErrorCodes.LockTimeout, + ErrorCodes.Interrupted, + ErrorCodes.SnapshotTooOld, + ]); }, snapshotGetMore: function snapshotGetMore(db, collName) { |