[CSHARP-1294] Fail to connect if seed name is different than host name Created: 22/May/15 Updated: 22/May/15 Resolved: 22/May/15 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | 2.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | tryshi | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
| Comments |
| Comment by Craig Wilson [ 22/May/15 ] |
|
Yes, we can certainly keep polling the public DNS name. Let's take that and run with it. 1. Our seedlist contains publicHostA, publicHostB, and publicHostC. The spec is just about conformity between the drivers and assures us that we are doing the right thing. In this case, there isn't another option. As illustrated in (4) and (6), the driver is effectively helpless. I understand the expectations thing and totally agree, but this particular case doesn't get to that ask that question. We do what we can do. However, we can try and figure out a way for you as a user to supply a mapping to us via code. We could do it via callback, so you might be able to query a configuration service or simply know about a well known translation between private host and public host names. But that's the best we'll be able to do here. If you think that it is worthwhile to pursue the "via code etc/hosts" configuration option, let's open another ticket to track that feature request. For now, I'm going to close this ticket as Works as Designed. |
| Comment by tryshi [ 22/May/15 ] |
|
Thanks Craig for the detailed explanation. I don't know much about mongodb internals, but just a naive answer to your below question: Also thanks for the workaround suggestion, that unblocks me now, but it will be a costly maintenance work. |
| Comment by Craig Wilson [ 22/May/15 ] |
|
Hi tryshi, I can't speak to the node driver, but there is a specification that exists which indicates our current behavior is correct. We take your seed list and use it to connect to the nodes initially. We then hear back from them and notice that none of the nodes in the seed list is what is configured in the replica set config, remove your seed list nodes and add the replica set nodes. If we don't do this, we couldn't respond to replica set changes. For instance, if you removed vmsec0521e:27000 from your replica set, how would we know that? Therefore, it is required that your client be able to resolve the hostnames as defined in the replica set configuration. There are certainly some ways to handle this. The easiest is to add entries to your etc/hosts file that will resolve those private dns names to their public dns equivalent. The problem here is that when you add a new node, you'll need to add that new node's entry into all your hosts files. I'm reading the documentation on our mongodb docs site and this is stated:
Does that explain it? Do you have any further questions? |
| Comment by tryshi [ 22/May/15 ] |
|
This repros in the C# Driver 2.0 |
| Comment by tryshi [ 22/May/15 ] |
Note:The client is not in the virtual network, so has no access to the private ip in the virtual network. |