-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Testing Infrastructure
-
Fully Compatible
-
ALL
-
-
TIG 2016-11-21
-
0
The getFeatureCompatibilityVersion() function in validate_collections.js does a findOne() on the admin.system.version collection rather than {getParameter: 1, featureCompatibilityVersion: 1} in order to be able to read the featureCompatibilityVersion from the config servers when running in a sharded cluster.
function getFeatureCompatibilityVersion(adminDB) { var res = adminDB.system.version.findOne({_id: "featureCompatibilityVersion"}); if (res === null) { return "3.2"; } return res.version; }
The view catalog of the admin database is only resolved when the admin.system.version collection doesn't exist. We can therefore interpret the featureCompatibilityVersion as 3.2 when the findOne() operation fails with InvalidViewDefinition. The error should only be handled in this fashion when skipValidationOnInvalidViewDefinitions is set to true.
Additionally, the filter to the "listCollections" command should be changed to
{$or: [{type: "collection"}, {type: {$exists: false}}]}
to avoid resolving the view catalog when skipValidationOnInvalidViewDefinitions is set to true.