From 9a77424deeae44452042eed2c50747bd127b1b48 Mon Sep 17 00:00:00 2001 From: Esha Maharishi Date: Fri, 10 May 2019 15:59:06 -0400 Subject: Revert "SERVER-40996 abortTransaction in cleanup_txns.js does not handle different errors from different shards" This reverts commit ba844b4e81c3914b8a7017bd2a8c5ac4231c72ff. SERVER-40757 Fix snapshot_read_kill_operations.js to handle read-only transactions that are aborted The commit for SERVER-38369 made commands that return raw shard responses return the first non-ignorable error as the top-level error, even if different non-ignorable errors occurred. --- jstests/concurrency/fsm_workload_helpers/cleanup_txns.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'jstests/concurrency') diff --git a/jstests/concurrency/fsm_workload_helpers/cleanup_txns.js b/jstests/concurrency/fsm_workload_helpers/cleanup_txns.js index 34a9bc0dab7..9fb5a3f9a8d 100644 --- a/jstests/concurrency/fsm_workload_helpers/cleanup_txns.js +++ b/jstests/concurrency/fsm_workload_helpers/cleanup_txns.js @@ -26,19 +26,8 @@ function abortTransaction(sessionAwareDB, txnNumber) { autocommit: false }; const res = rawDB.adminCommand(abortCmd); - if (res.hasOwnProperty("raw")) { - // For sharded commands, we may get mismatched errors in which case there will be - // no top-level code. Instead, check each code from the shards. - for (let shardname in res.raw) { - let shardres = res.raw[shardname]; - assert.commandWorkedOrFailedWithCode( - shardres, abortErrorCodes, () => `cmd: ${tojson(abortCmd)}`); - } - return res; - } else { - return assert.commandWorkedOrFailedWithCode( - res, abortErrorCodes, () => `cmd: ${tojson(abortCmd)}`); - } + return assert.commandWorkedOrFailedWithCode( + res, abortErrorCodes, () => `cmd: ${tojson(abortCmd)}`); } /** -- cgit v1.2.1