diff options
author | Randolph Tan <randolph@10gen.com> | 2015-01-22 15:51:11 -0500 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2015-01-26 11:35:16 -0500 |
commit | 78390e4da7e48532194cba623c55d566bc09cc70 (patch) | |
tree | ed146f9e820fc6f7d332033c69c87c299a5a16fc /jstests | |
parent | c4ec7db6ce25e7147ae5f46ac0a7f6a52a0b4c3e (diff) | |
download | mongo-78390e4da7e48532194cba623c55d566bc09cc70.tar.gz |
SERVER-17000 Drop the { ts: 1 } index during --upgrade
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/multiVersion/upgrade_cluster_v5_to_v6.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/jstests/multiVersion/upgrade_cluster_v5_to_v6.js b/jstests/multiVersion/upgrade_cluster_v5_to_v6.js index 72d21219953..1b3daa44216 100644 --- a/jstests/multiVersion/upgrade_cluster_v5_to_v6.js +++ b/jstests/multiVersion/upgrade_cluster_v5_to_v6.js @@ -10,6 +10,7 @@ load( './jstests/multiVersion/libs/multi_cluster.js' ) * @param isSyncCluster {bool} use 3 config servers. */ var runTest = function(isRSCluster, isSyncCluster) { +"use strict"; jsTest.log( "Starting" + ( isRSCluster ? " (replica set)" : "" ) + " cluster" + ( isSyncCluster ? " (sync)" : "" ) + "..." ); @@ -46,7 +47,7 @@ jsTest.log("Starting v2.8 mongos in 2.4 cluster..."); var mongos = MongoRunner.runMongos({ binVersion : "2.8", configdb : configConnStr }); assert.eq(null, mongos); -mongos = MongoRunner.runMongos({ binVersion : "2.8", configdb : configConnStr, upgrade : "" }) +mongos = MongoRunner.runMongos({ binVersion : "2.8", configdb : configConnStr, upgrade : "" }); assert.eq(null, mongos); jsTest.log("2.8 mongoses did not start or upgrade in 2.4 cluster (which is correct)."); @@ -123,6 +124,24 @@ assert.eq(version.currentVersion, 6); assert.eq(clusterID, version.clusterId); // clusterId shouldn't change assert.eq(version.excluding, undefined); +// +// Verify that the config.locks { ts: 1 } index is not unique for all config servers. +// + +st._configServers.forEach(function(conn) { + var idxList = conn.getDB('config').locks.getIndexes(); + var foundIndex = false; + idxList.forEach(function(idxSpec) { + if (bsonWoCompare(idxSpec.key, { ts: 1 }) == 0) { + foundIndex = true; + assert.eq(idxSpec.unique, null); + return; + } + }); + + assert(foundIndex, '{ ts: 1 } index not found in ' + conn + ': ' + tojson(idxList)); +}); + // Make sure that you can't run 2.4 mongos mongos = MongoRunner.runMongos({ binVersion : "2.4", configdb : configConnStr }); assert.eq(null, mongos); |