-
Notifications
You must be signed in to change notification settings - Fork 209
PHPC-361: Manager::getServers() should omit unknown servers #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm pretty sure we decided against that. getServers() was supposed to return you the currently known servers. |
I didn't recall any discussion about it. Before this patch, the behavior I observed was that This is distinct from the situation where we might return a Server for a replica set node that ends up being removed from the set (or shut down) before the user attempts to execute an operation on it directly. At least in that case, the Server object did have some known state and an isMaster record. |
See https://jira.mongodb.org/browse/PHPC-194 You describe yourself the difference of selectServer() and getServers(), seemingly firm on getServers() behaving correctly. |
@bjori: To quote that ticket:
At some point, this must have changed.
I suppose this PR is essentially adding that SDAM kickstart process we'd need to implement a userland selection process. |
Subject: Implement Manager::selectServer() method to wrap SDAM server selection
And thats exactly what we did. This was all argued from the standpoint of getServers() behaving correctly. |
There's benefit in I do see how |
Per discussion in IRC, I've revised PHPC-361 to state that I'll revise this PR after the 1.0.0-alpha release. |
Ready to be reviewed again. |
Pinging | ||
Known servers: 3 | ||
Found server: %s:%d | ||
Found replica set server type: %r(4|5|6)%r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if only we had realized the usefulness of %r()%r for the MongoLog tests!
No mongos test? lgtm |
LGTM too, but have a look at that mongos test that @bjori mentions :-) |
Created PHPC-402 to look into the shard cluster testing. We don't currently have a persistent cluster environment in the MO VM. As it relates to this PR, I don't see any reason why it wouldn't return mongos connections, so I'll merge as-is and we'll follow this up in the other ticket. |
https://jira.mongodb.org/browse/PHPC-361