mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
22 lines
762 B
JavaScript
22 lines
762 B
JavaScript
// Runner for checkOplogs() that compares the oplog on all replica set nodes
|
|
// to ensure all nodes have the same data.
|
|
'use strict';
|
|
|
|
(function() {
|
|
var startTime = Date.now();
|
|
assert.neq(typeof db, 'undefined', 'No `db` object, is the shell connected to a mongod?');
|
|
|
|
var primaryInfo = db.isMaster();
|
|
|
|
assert(primaryInfo.ismaster,
|
|
'shell is not connected to the primary or master node: ' + tojson(primaryInfo));
|
|
|
|
var cmdLineOpts = db.adminCommand('getCmdLineOpts');
|
|
assert.commandWorked(cmdLineOpts);
|
|
var testFixture = new ReplSetTest(db.getMongo().host);
|
|
testFixture.checkOplogs();
|
|
|
|
var totalTime = Date.now() - startTime;
|
|
print('Finished consistency oplog checks of cluster in ' + totalTime + ' ms.');
|
|
})();
|