summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Guo <robert.guo@10gen.com>2016-09-27 17:16:14 -0400
committerRobert Guo <robert.guo@10gen.com>2016-09-30 17:27:17 -0400
commitcabfdfe829943440a5307335f2ebc0fc1286aa2d (patch)
tree6a3802d2e4daf0fe5bd5da230aea0676ada45e89
parent94e64d51137d66c3af56bc1d00a5c5ec77c8e55e (diff)
downloadmongo-cabfdfe829943440a5307335f2ebc0fc1286aa2d.tar.gz
SERVER-26298 include connection in response of ReplSetTest.getHashes()
-rw-r--r--src/mongo/shell/replsettest.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js
index 689e454b413..eef99ae5f65 100644
--- a/src/mongo/shell/replsettest.js
+++ b/src/mongo/shell/replsettest.js
@@ -853,11 +853,14 @@ var ReplSetTest = function(opts) {
this.getPrimary();
var res = {};
res.master = this.liveNodes.master.getDB(db).runCommand("dbhash");
+ Object.defineProperty(res.master, "_mongo", {value: this.liveNodes.master});
res.slaves = [];
this.liveNodes.slaves.forEach(function(node) {
var isArbiter = node.getDB('admin').isMaster('admin').arbiterOnly;
if (!isArbiter) {
- res.slaves.push(node.getDB(db).runCommand("dbhash"));
+ var slaveRes = node.getDB(db).runCommand("dbhash");
+ Object.defineProperty(slaveRes, "_mongo", {value: node});
+ res.slaves.push(slaveRes);
}
});
return res;
@@ -1058,12 +1061,7 @@ var ReplSetTest = function(opts) {
dbHashes.slaves.forEach(secondaryDBHash => {
assert.commandWorked(secondaryDBHash);
- var secondary =
- rst.liveNodes.slaves.find(node => node.host === secondaryDBHash.host);
- assert(
- secondary,
- 'could not find the replica set secondary listed in the dbhash response ' +
- tojson(secondaryDBHash));
+ var secondary = secondaryDBHash._mongo;
var primaryCollections = Object.keys(primaryDBHash.collections);
var secondaryCollections = Object.keys(secondaryDBHash.collections);