summaryrefslogtreecommitdiff
path: root/jstests/hooks/run_check_repl_dbhash.js
diff options
context:
space:
mode:
authorVesselina Ratcheva <vesselina.ratcheva@10gen.com>2018-02-14 17:19:14 -0500
committerVesselina Ratcheva <vesselina.ratcheva@10gen.com>2018-02-21 10:38:49 -0500
commitfdfce7f6c24a676bd9e3eef36d273c98a9bb59ab (patch)
tree2d1d2301b4b228f579cadd413f2517f060690196 /jstests/hooks/run_check_repl_dbhash.js
parent6df7ca5841e2ffa40354975323e410796d952382 (diff)
downloadmongo-fdfce7f6c24a676bd9e3eef36d273c98a9bb59ab.tar.gz
SERVER-32143 Remove test coverage for master-slave
Diffstat (limited to 'jstests/hooks/run_check_repl_dbhash.js')
-rw-r--r--jstests/hooks/run_check_repl_dbhash.js100
1 files changed, 0 insertions, 100 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) {