[SERVER-21047] Error message in rs.add() is confusing, should be just "Connection refused" Created: 21/Oct/15  Updated: 06/Dec/22  Resolved: 31/Oct/15

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 3.2.0-rc0
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Henrik Ingo (Inactive) Assignee: Backlog - Replication Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Participants:

 Description   

319test:PRIMARY> rs.add("ip-172-31-42-223")
{
	"ok" : 0,
	"errmsg" : "Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: ip-172-31-42-224:27017; the following nodes did not respond affirmatively: ip-172-31-42-223:27017 failed with Connection refused",
	"code" : 74
}

The above error is simple: mongod isn't running on the node I'm attempting to add. The error message about quorum check is confusing.

Two things need fixing or at least checking:

  • If the relevant code path (didn't read) really does some kind of quorum check, that is superfluous. A pre-condition to adding a node should be that I can connect to it. Doing any quorum check only makes sense after that condition is satisfied.
  • The error message is confusing and irrelavant. It should just say "Connection refused".


 Comments   
Comment by sidhant mahajan [ 09/Mar/17 ]

I got the same issue but in my case it is Ip is rightly specified. Still I am getting connection refused.

"respond affirmatively: "172.31.42.223:27017 failed with Connection refused",
"code" : 74
}

Comment by Henrik Ingo (Inactive) [ 23/Oct/15 ]

My argument is from a usability point of view. You could allow to add nodes that don't currently exist, but is there any benefit for allowing that? On the other hand typoing the hostname/ip-address is a very likely error, shouldn't we optimize for a simple error message in that case?

I realize my argument is subjective, this is a user experience feedback after having played with it. In theory (from an algorithm point of view) there's nothing wrong with the current behavior.

Comment by Eric Milkie [ 21/Oct/15 ]

Why should there be a new restriction that the node be up when you add it?
The current restriction for reconfig is that a majority of voting nodes in the new config are up; the error message you see here is reflective of that restriction.

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