diff options
-rw-r--r-- | src/mongo/shell/replsettest.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js index 3b0acbd5626..0beea48ed25 100644 --- a/src/mongo/shell/replsettest.js +++ b/src/mongo/shell/replsettest.js @@ -900,16 +900,17 @@ var ReplSetTest = function(opts) { } let dbHandle = primary.getDB(dbName); - dbHandle - .getCollectionInfos({ - $or: [{type: "collection"}, {type: {$exists: false}}], - name: {$not: /^system\./} - }) + dbHandle.getCollectionInfos({$or: [{type: "collection"}, {type: {$exists: false}}]}) .forEach(function(collInfo) { - // 'usePowerOf2Sizes' is ignored by the server so no actual collection - // modification takes place. - assert.commandWorked( - dbHandle.runCommand({collMod: collInfo.name, usePowerOf2Sizes: true})); + // Skip system collections. We handle here rather than in the getCollectionInfos + // filter to take advantage of the fact that a simple 'collection' filter will + // skip view evaluation, and therefore won't fail on an invalid view. + if (!collInfo.name.startsWith('system.')) { + // 'usePowerOf2Sizes' is ignored by the server so no actual collection + // modification takes place. + assert.commandWorked( + dbHandle.runCommand({collMod: collInfo.name, usePowerOf2Sizes: true})); + } }); } |