diff options
author | Tommaso Tocci <tommaso.tocci@mongodb.com> | 2020-07-22 10:13:21 +0200 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-22 08:36:04 +0000 |
commit | f853fe2eb7fd1918ff1f391f982499c49c006524 (patch) | |
tree | f48d323b9457589ac5eecfe90e2bf971a0c29c7f /jstests/sharding | |
parent | 1a8092b741ebd9d24122559648f14f5d3f37ba8a (diff) | |
download | mongo-f853fe2eb7fd1918ff1f391f982499c49c006524.tar.gz |
Revert "SERVER-49765 fail with MovePrimaryInProgress for dropIndexes, create view, modify view commands"
This reverts commit c0cc8994d2f8343a08928be10873f4ae3220fb45.
Diffstat (limited to 'jstests/sharding')
-rw-r--r-- | jstests/sharding/move_primary_with_writes.js | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/jstests/sharding/move_primary_with_writes.js b/jstests/sharding/move_primary_with_writes.js index 8baeb673811..7f0a9b63bcf 100644 --- a/jstests/sharding/move_primary_with_writes.js +++ b/jstests/sharding/move_primary_with_writes.js @@ -25,11 +25,11 @@ function createCollections() { let otherDb = st.getDB(otherDbName); const unshardedFooIndexes = [ - {key: {a: 1}, name: 'unshardedFooIndex'}, + {key: {a: 1}, name: 'fooIndex_a'}, {key: {c: 1}, name: 'fooTTL_c', expireAfterSeconds: 1800} ]; const shardedBarIndexes = [ - {key: {a: 1}, name: 'shardedBarIndex'}, + {key: {a: 1}, name: 'barIndex_a'}, {key: {c: 1}, name: 'barTTL_c', expireAfterSeconds: 1800} ]; @@ -136,10 +136,6 @@ function buildCommands(collName, shouldFail) { }, {command: {create: "testCollection"}, shouldFail: true}, { - command: {create: "testView", viewOn: collName, pipeline: [{$match: {}}]}, - shouldFail: shouldFail - }, - { command: {createIndexes: collName, indexes: [{key: {b: 1}, name: collName + "Idx_b"}]}, shouldFail: shouldFail }, @@ -147,22 +143,7 @@ function buildCommands(collName, shouldFail) { command: {collMod: collName, index: {keyPattern: {c: 1}, expireAfterSeconds: 3600}}, shouldFail: shouldFail }, - { - command: {collMod: collName + "View", viewOn: collName, pipeline: [{$match: {_id: 1}}]}, - shouldFail: shouldFail - }, - {command: {convertToCapped: "unshardedFoo", size: 1000000}, shouldFail: true}, - {command: {dropIndexes: collName, index: collName + "Index"}, shouldFail: shouldFail}, - { - command: {drop: collName}, - shouldFail: true, - errorCodes: [ErrorCodes.LockBusy, ErrorCodes.InterruptedDueToReplStateChange] - }, - { - command: {dropDatabase: 1}, - shouldFail: true, - errorCodes: [ErrorCodes.LockBusy, ErrorCodes.InterruptedDueToReplStateChange] - }, + {command: {convertToCapped: "unshardedFoo", size: 1000000}, shouldFail: true} ]; return commands; } @@ -201,13 +182,8 @@ function testMovePrimary(failpoint, fromShard, toShard, db, shouldFail, sharded) if (shouldFail && commandObj.shouldFail) { jsTestLog("running command: " + tojson(commandObj.command) + ",\nshoudFail: " + shouldFail); - if (commandObj.hasOwnProperty("errorCodes")) { - assert.commandFailedWithCode(db.runCommand(commandObj.command), - commandObj.errorCodes); - } else { - assert.commandFailedWithCode(db.runCommand(commandObj.command), - ErrorCodes.MovePrimaryInProgress); - } + assert.commandFailedWithCode(db.runCommand(commandObj.command), + ErrorCodes.MovePrimaryInProgress); } else if (!shouldFail && !commandObj.shouldFail) { jsTestLog("running command: " + tojson(commandObj.command) + ",\nshoudFail: " + shouldFail); |