diff options
author | Maria van Keulen <maria@mongodb.com> | 2017-10-09 14:48:46 -0400 |
---|---|---|
committer | Maria van Keulen <maria@mongodb.com> | 2017-10-09 14:49:16 -0400 |
commit | 9eba349099bdc58f3ad4e55aa2e846d6d0244f41 (patch) | |
tree | 678f5a046fbbb5bab30c70b608206957c32df6ac /jstests/multiVersion | |
parent | 29342abd41293c78104c288cb1c4807df94d8de2 (diff) | |
download | mongo-9eba349099bdc58f3ad4e55aa2e846d6d0244f41.tar.gz |
Revert "SERVER-30131 Ensure collections on local have UUIDs"
This reverts commit 84690cb878db1b231c00d3c9fcb0005ca7cb6361.
Diffstat (limited to 'jstests/multiVersion')
-rw-r--r-- | jstests/multiVersion/set_schema_version.js | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/jstests/multiVersion/set_schema_version.js b/jstests/multiVersion/set_schema_version.js index e7ee9079230..928d788e4a1 100644 --- a/jstests/multiVersion/set_schema_version.js +++ b/jstests/multiVersion/set_schema_version.js @@ -8,7 +8,7 @@ const latest = "latest"; const downgrade = "3.4"; - let checkCollectionUUIDs = function(adminDB, isDowngrade) { + let checkCollectionUUIDs = function(adminDB, isDowngrade, excludeLocal) { let databaseList = adminDB.runCommand({"listDatabases": 1}).databases; databaseList.forEach(function(database) { @@ -19,12 +19,19 @@ if (collectionInfos[i].name == "system.indexes") { continue; } - if (isDowngrade) { - assert(!collectionInfos[i].info.uuid, - "Unexpected uuid for collection: " + tojson(collectionInfos[i])); + if (excludeLocal) { + // Exclude checking all collections in local until SERVER-30131 is fixed. + if (currentDatabase != "local") { + assert(collectionInfos[i].info.uuid); + } } else { - assert(collectionInfos[i].info.uuid, - "Expect uuid for collection: " + tojson(collectionInfos[i])); + if (isDowngrade) { + assert(!collectionInfos[i].info.uuid, + "Unexpected uuid for collection: " + tojson(collectionInfos[i])); + } else { + assert(collectionInfos[i].info.uuid, + "Expect uuid for collection: " + tojson(collectionInfos[i])); + } } } }); @@ -85,13 +92,13 @@ insertDataForConn(conn, ["admin", "local", "test"]); // Ensure all collections have UUIDs in 3.6 mode. - checkCollectionUUIDs(adminDB, false); + checkCollectionUUIDs(adminDB, false, true); // Set featureCompatibilityVersion to 3.4. setFCV(adminDB, "3.4"); // Ensure no collections in a featureCompatibilityVersion 3.4 database have UUIDs. - checkCollectionUUIDs(adminDB, true); + checkCollectionUUIDs(adminDB, true, false); // Stop Mongod 3.6 MongoRunner.stopMongod(conn); @@ -105,7 +112,7 @@ checkFCV(downgradeAdminDB, "3.4", true); // Ensure there are no UUIDs - checkCollectionUUIDs(downgradeAdminDB, true); + checkCollectionUUIDs(downgradeAdminDB, true, false); // Stop 3.4 MongoRunner.stopMongod(downgradeConn); @@ -118,7 +125,7 @@ // Ensure all collections have UUIDs after switching back to featureCompatibilityVersion // 3.6. setFCV(adminDB, "3.6"); - checkCollectionUUIDs(adminDB, false); + checkCollectionUUIDs(adminDB, false, true); // Stop Mongod 3.6 for the last time MongoRunner.stopMongod(conn); @@ -150,10 +157,10 @@ } // Ensure all collections have UUIDs in 3.6 mode on both primary and secondaries. - checkCollectionUUIDs(primaryAdminDB, false); + checkCollectionUUIDs(primaryAdminDB, false, true); for (let j = 0; j < secondaries.length; j++) { let secondaryAdminDB = secondaries[j].getDB("admin"); - checkCollectionUUIDs(secondaryAdminDB, false); + checkCollectionUUIDs(secondaryAdminDB, false, true); } // Change featureCompatibilityVersion to 3.4. @@ -165,10 +172,10 @@ } // Ensure no collections have UUIDs in 3.4 mode on both primary and secondaries. - checkCollectionUUIDs(primaryAdminDB, true); + checkCollectionUUIDs(primaryAdminDB, true, false); for (let j = 0; j < secondaries.length; j++) { let secondaryAdminDB = secondaries[j].getDB("admin"); - checkCollectionUUIDs(secondaryAdminDB, true); + checkCollectionUUIDs(secondaryAdminDB, true, false); } // Stop 3.6 RS @@ -184,14 +191,14 @@ let downgradeSecondaries = downgradeRst.getSecondaries(); // Initially featureCompatibilityVersion document is 3.4 on primary and secondaries. - checkCollectionUUIDs(downgradePrimaryAdminDB, true); + checkCollectionUUIDs(downgradePrimaryAdminDB, true, false); checkFCV(downgradePrimaryAdminDB, "3.4", true); for (let j = 0; j < downgradeSecondaries.length; j++) { let secondaryAdminDB = downgradeSecondaries[j].getDB("admin"); checkFCV(secondaryAdminDB, "3.4", true); // Ensure no collections have UUIDs - checkCollectionUUIDs(secondaryAdminDB, true); + checkCollectionUUIDs(secondaryAdminDB, true, false); } downgradeRst.stopSet(); @@ -212,10 +219,10 @@ checkFCV(secondaryAdminDB, "3.6"); } - checkCollectionUUIDs(primaryAdminDB, false); + checkCollectionUUIDs(primaryAdminDB, false, true); for (let j = 0; j < secondaries.length; j++) { let secondaryAdminDB = secondaries[j].getDB("admin"); - checkCollectionUUIDs(secondaryAdminDB, false); + checkCollectionUUIDs(secondaryAdminDB, false, true); } rst.stopSet(); |