diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-09-05 19:35:51 -0400 |
---|---|---|
committer | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-09-19 13:20:05 -0400 |
commit | 3bab189695c705ff163721652add910b32c2659e (patch) | |
tree | 0c8a116ff0744c943ff5d7844395717fa7e81270 /jstests/core/txns/concurrent_drops_and_creates.js | |
parent | 5f61edb2c73e569cb4b265ca8f453536e7b7b016 (diff) | |
download | mongo-3bab189695c705ff163721652add910b32c2659e.tar.gz |
SERVER-35707 Allow mongos to retry on re-targeting errors in a transaction
Diffstat (limited to 'jstests/core/txns/concurrent_drops_and_creates.js')
-rw-r--r-- | jstests/core/txns/concurrent_drops_and_creates.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/jstests/core/txns/concurrent_drops_and_creates.js b/jstests/core/txns/concurrent_drops_and_creates.js index 5ddf7ca260b..8db02f1ae98 100644 --- a/jstests/core/txns/concurrent_drops_and_creates.js +++ b/jstests/core/txns/concurrent_drops_and_creates.js @@ -64,7 +64,9 @@ // since the transaction's read timestamp. Since our implementation of the in-memory collection // catalog always has the most recent collection metadata, we do not allow you to read from a // collection at a time prior to its most recent catalog changes. - assert.commandFailedWithCode(sessionCollB.insert({}), ErrorCodes.SnapshotUnavailable); + const isMongos = assert.commandWorked(db.runCommand("ismaster")).msg === "isdbgrid"; + const expectedCode = isMongos ? ErrorCodes.NoSuchTransaction : ErrorCodes.SnapshotUnavailable; + assert.commandFailedWithCode(sessionCollB.insert({}), expectedCode); assert.commandFailedWithCode(session.abortTransaction_forTesting(), ErrorCodes.NoSuchTransaction); |