diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-06-02 15:29:32 -0400 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-06-09 15:05:04 -0400 |
commit | 67500efdc1c677173c737ecde2b07b42015ae5fd (patch) | |
tree | 4a735cf4c6561e28b76f65117d47231e9a677d04 /jstests/hooks | |
parent | f9c36696a25d3837f512421755952736236bbed0 (diff) | |
download | mongo-67500efdc1c677173c737ecde2b07b42015ae5fd.tar.gz |
SERVER-29350 Bump featureCompatibilityVersion to 3.6
Diffstat (limited to 'jstests/hooks')
-rw-r--r-- | jstests/hooks/validate_collections.js | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/jstests/hooks/validate_collections.js b/jstests/hooks/validate_collections.js index bf2b7b06709..ac2382ae838 100644 --- a/jstests/hooks/validate_collections.js +++ b/jstests/hooks/validate_collections.js @@ -13,24 +13,6 @@ function validateCollections(db, obj) { } } - function getFeatureCompatibilityVersion(adminDB) { - var res = adminDB.system.version.findOne({_id: "featureCompatibilityVersion"}); - if (res === null) { - return "3.2"; - } - return res.version; - } - - function setFeatureCompatibilityVersion(adminDB, version) { - var res = adminDB.runCommand({setFeatureCompatibilityVersion: version}); - if (!res.ok) { - return res; - } - - assert.eq(version, getFeatureCompatibilityVersion(adminDB)); - return res; - } - assert.eq(typeof db, 'object', 'Invalid `db` object, is the shell connected to a mongod?'); assert.eq(typeof obj, 'object', 'The `obj` argument must be an object'); assert(obj.hasOwnProperty('full'), 'Please specify whether to use full validation'); @@ -41,43 +23,6 @@ function validateCollections(db, obj) { var adminDB = db.getSiblingDB("admin"); - // Set the featureCompatibilityVersion to its required value for performing validation. Save the - // original value. - var originalFeatureCompatibilityVersion; - if (jsTest.options().forceValidationWithFeatureCompatibilityVersion) { - try { - originalFeatureCompatibilityVersion = getFeatureCompatibilityVersion(adminDB); - } catch (e) { - if (jsTest.options().skipValidationOnInvalidViewDefinitions && - e.code === ErrorCodes.InvalidViewDefinition) { - print("Reading the featureCompatibilityVersion from the admin.system.version" + - " collection failed due to an invalid view definition on the admin database"); - // The view catalog would only have been resolved if the namespace doesn't exist as - // a collection. The absence of the admin.system.version collection is equivalent to - // having featureCompatibilityVersion=3.2. - originalFeatureCompatibilityVersion = "3.2"; - } else { - throw e; - } - } - - var res = setFeatureCompatibilityVersion( - adminDB, jsTest.options().forceValidationWithFeatureCompatibilityVersion); - // Bypass collections validation when setFeatureCompatibilityVersion fails with KeyTooLong - // while forcing feature compatibility version. The KeyTooLong error response occurs as a - // result of having a document with a large "version" field in the admin.system.version - // collection. - if (!res.ok && jsTest.options().forceValidationWithFeatureCompatibilityVersion === "3.4") { - print("Skipping collection validation since forcing the featureCompatibilityVersion" + - " to 3.4 failed"); - assert.commandFailedWithCode(res, ErrorCodes.KeyTooLong); - success = true; - return success; - } else { - assert.commandWorked(res); - } - } - // Don't run validate on view namespaces. let filter = {type: "collection"}; if (jsTest.options().skipValidationOnInvalidViewDefinitions) { @@ -111,11 +56,5 @@ function validateCollections(db, obj) { } } - // Restore the original value for featureCompatibilityVersion. - if (jsTest.options().forceValidationWithFeatureCompatibilityVersion) { - assert.commandWorked( - setFeatureCompatibilityVersion(adminDB, originalFeatureCompatibilityVersion)); - } - return success; } |