diff options
author | Vesselina Ratcheva <vesselina.ratcheva@10gen.com> | 2018-02-14 17:19:14 -0500 |
---|---|---|
committer | Vesselina Ratcheva <vesselina.ratcheva@10gen.com> | 2018-02-21 10:38:49 -0500 |
commit | fdfce7f6c24a676bd9e3eef36d273c98a9bb59ab (patch) | |
tree | 2d1d2301b4b228f579cadd413f2517f060690196 /jstests/hooks | |
parent | 6df7ca5841e2ffa40354975323e410796d952382 (diff) | |
download | mongo-fdfce7f6c24a676bd9e3eef36d273c98a9bb59ab.tar.gz |
SERVER-32143 Remove test coverage for master-slave
Diffstat (limited to 'jstests/hooks')
-rw-r--r-- | jstests/hooks/run_check_repl_dbhash.js | 100 | ||||
-rw-r--r-- | jstests/hooks/run_check_repl_oplogs.js | 9 | ||||
-rw-r--r-- | jstests/hooks/run_initial_sync_node_validation.js | 2 |
3 files changed, 1 insertions, 110 deletions
diff --git a/jstests/hooks/run_check_repl_dbhash.js b/jstests/hooks/run_check_repl_dbhash.js index 06e626ba5cd..7e09c7ca6c8 100644 --- a/jstests/hooks/run_check_repl_dbhash.js +++ b/jstests/hooks/run_check_repl_dbhash.js @@ -6,100 +6,6 @@ load('jstests/libs/discover_topology.js'); // For Topology and DiscoverTopology. load('jstests/libs/parallelTester.js'); // For ScopedThread. - // A thin wrapper around master/slave nodes that provides methods necessary for checking data - // consistency between the master and slave nodes. - // - // DEPRECATED: This wrapper is only intended to be used for the master-slave deployment started - // by resmoke.py as part of the master_slave_jscore_passthrough.yml test suite and it shouldn't - // be used for any other master/slave tests. - // - // TODO SERVER-32143: Remove this wrapper. - function MasterSlaveDBHashTest(primaryHost) { - const master = new Mongo(primaryHost); - const masterPort = master.host.split(':')[1]; - const slave = new Mongo('localhost:' + String(parseInt(masterPort) + 1)); - - this.nodeList = function nodeList() { - return [master.host, slave.host]; - }; - - this.getHashes = function getHashes(db) { - const combinedRes = {}; - let res = master.getDB(db).runCommand('dbhash'); - assert.commandWorked(res); - combinedRes.master = res; - - res = slave.getDB(db).runCommand('dbhash'); - assert.commandWorked(res); - combinedRes.slaves = [res]; - - return combinedRes; - }; - - this.getPrimary = function getPrimary() { - slave.setSlaveOk(); - this.liveNodes = {master: master, slaves: [slave]}; - return master; - }; - - this.getSecondaries = function getSecondaries() { - return [slave]; - }; - - this.awaitReplication = function awaitReplication() { - assert.commandWorked(master.adminCommand({fsyncUnlock: 1}), - 'failed to unlock the primary'); - - print('Starting fsync on master to flush all pending writes'); - assert.commandWorked(master.adminCommand({fsync: 1})); - print('fsync on master completed'); - - const kTimeout = 5 * 60 * 1000; // 5 minute timeout - const dbNames = master.getDBNames(); - - for (let dbName of dbNames) { - if (dbName === 'local') { - continue; - } - - print('Awaiting replication of inserts into ' + dbName); - assert.writeOK(master.getDB(dbName).await_repl.insert( - {awaiting: 'repl'}, {writeConcern: {w: 2, wtimeout: kTimeout}}), - 'Awaiting replication failed'); - } - print('Finished awaiting replication'); - assert.commandWorked(master.adminCommand({fsync: 1, lock: 1}), - 'failed to re-lock the primary'); - }; - - this.checkReplicatedDataHashes = function checkReplicatedDataHashes() { - const msgPrefix = 'checkReplicatedDataHashes for master-slave deployment'; - const excludedDBs = jsTest.options().excludedDBsFromDBHash || []; - - // Since UUIDs aren't explicitly replicated in master-slave deployments, we ignore the - // UUID in the output of the 'listCollections' command to avoid reporting a known data - // inconsistency issue from checkReplicatedDataHashes(). - const ignoreUUIDs = true; - - new ReplSetTest({ - nodes: 0 - }).checkReplicatedDataHashes.call(this, msgPrefix, excludedDBs, ignoreUUIDs); - }; - - this.checkReplicaSet = function checkReplicaSet() { - new ReplSetTest({nodes: 0}).checkReplicaSet.apply(this, arguments); - }; - - this.dumpOplog = function dumpOplog() { - print('Not dumping oplog for master-slave deployment'); - }; - } - - function isMasterSlaveDeployment(conn) { - const cmdLineOpts = assert.commandWorked(conn.adminCommand({getCmdLineOpts: 1})); - return cmdLineOpts.parsed.master === true; - } - function checkReplicatedDataHashesThread(hosts, testData) { try { TestData = testData; @@ -116,12 +22,6 @@ let skipped = false; try { const conn = db.getMongo(); - - if (isMasterSlaveDeployment(conn)) { - new MasterSlaveDBHashTest(conn.host).checkReplicatedDataHashes(); - return; - } - const topology = DiscoverTopology.findConnectedNodes(conn); if (topology.type === Topology.kStandalone) { diff --git a/jstests/hooks/run_check_repl_oplogs.js b/jstests/hooks/run_check_repl_oplogs.js index a2875d61150..0e0ebadc897 100644 --- a/jstests/hooks/run_check_repl_oplogs.js +++ b/jstests/hooks/run_check_repl_oplogs.js @@ -3,11 +3,6 @@ 'use strict'; (function() { - // Master/Slave does not support oplog test, since the oplog.$main is empty on the Slave. - var MasterSlaveOplogTest = function() { - throw new Error('checkOplogs not supported for Master/Slave'); - }; - var startTime = Date.now(); assert.neq(typeof db, 'undefined', 'No `db` object, is the shell connected to a mongod?'); @@ -18,9 +13,7 @@ var cmdLineOpts = db.adminCommand('getCmdLineOpts'); assert.commandWorked(cmdLineOpts); - var isMasterSlave = cmdLineOpts.parsed.master === true; - var testFixture = - isMasterSlave ? new MasterSlaveOplogTest() : new ReplSetTest(db.getMongo().host); + var testFixture = new ReplSetTest(db.getMongo().host); testFixture.checkOplogs(); var totalTime = Date.now() - startTime; diff --git a/jstests/hooks/run_initial_sync_node_validation.js b/jstests/hooks/run_initial_sync_node_validation.js index 769409c534d..3ae954fe057 100644 --- a/jstests/hooks/run_initial_sync_node_validation.js +++ b/jstests/hooks/run_initial_sync_node_validation.js @@ -11,8 +11,6 @@ var cmdLineOpts = db.adminCommand('getCmdLineOpts'); assert.commandWorked(cmdLineOpts); - var isMasterSlave = cmdLineOpts.parsed.master === true; - assert(!isMasterSlave, 'Master/Slave is not supported with initial sync hooks'); // The initial sync hooks only work for replica sets. var rst = new ReplSetTest(db.getMongo().host); |