[DOCS-9477] Docs for SERVER-26809: Update mongo shell sh.getBalancerHost() method for 3.4 Created: 02/Dec/16  Updated: 16/Jan/18  Resolved: 16/Jan/18

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Emily Hall Assignee: Kay Kim (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-26809 Update mongo shell sh.getBalancerHost... Closed
Participants:
Days since reply: 6 years, 4 weeks, 1 day ago
Epic Link: PM-229

 Description   

Engineering Ticket Description:

Since in 3.4, balancer runs on primary of CSRS and the lock document is:

db.locks.findOne( {_id: "balancer"})
{
	"_id" : "balancer",
	"state" : 2,
	"ts" : ObjectId("581178035b3b7dcb772022cd"),
	"who" : "ConfigServer:Balancer",
	"process" : "ConfigServer",
	"when" : ISODate("2016-10-27T03:44:03.007Z"),
	"why" : "CSRS Balancer"
}

The sh.getBalancerHost() method needs to be updated since it still expects the hostname for the mongos:

function (configDB) {
    if (configDB === undefined)
        configDB = sh._getConfigDB();
    var x = configDB.locks.findOne({_id: "balancer"});
    if (x == null) {
        print(
            "config.locks collection does not contain balancer lock. be sure you
are connected to a mongos");
        return "";
    }
    return x.process.match(/[^:]+:[^:]+/)[0];
}



 Comments   
Comment by Kay Kim (Inactive) [ 16/Jan/18 ]

This was done via DOCS-8140

Generated at Thu Feb 08 07:58:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.