[CSHARP-2888] Split-Horizon connection issue from outside Kubernetes Created: 26/Dec/19 Updated: 15/Jan/20 Resolved: 15/Jan/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | 2.10.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Andrii Litvinov | Assignee: | Dmitry Lukyanov (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Kubernetes, external replica set connectivity. ,NET Core |
||
| Description |
|
I have a ReplicaSet deployed with MongoDB Operator to Kubernetes and configured with Split-Horizon as follows:
I can connect to it from shell in a following connection way:
From C# I am trying following:
But it fails with connection timeout exception:
If I comment-out replica set line connection works, but then I am not connected to a replica set, but to a single node. Am I missing something or is it not yet supported? Is there a workaround?
|
| Comments |
| Comment by Dmitry Lukyanov (Inactive) [ 15/Jan/20 ] | |
|
This issue will be fixed in | |
| Comment by Andrii Litvinov [ 27/Dec/19 ] | |
|
I used this example https://github.com/mongodb/mongodb-enterprise-kubernetes/blob/master/samples/mongodb/external-connectivity/replica-set-external.yaml and is seems to be correct. Mongo shell works as expected with it. | |
| Comment by Andrey Belik (Inactive) [ 27/Dec/19 ] | |
|
This option configures Server Split Horizon feature to return different names for isMaster driver calls. ben.elgar Does this K8S config looks correct?
| |
| Comment by Andrii Litvinov [ 27/Dec/19 ] | |
|
Thank you for a reply, Andrew. When I run it with mongo shell I do see that server return hostnames from that horizon. I use MongoDB 4.2.2. As I wrote in the issue, it works perfectly well in mongo shell. Do you know why it might not be working with C# driver? From this I conclude that driver cannot recognize servers returned by mongodb:
| |
| Comment by Andrew Davidson [ 27/Dec/19 ] | |
|
This should not be a driver-relavent feature. It's server side--when a connection comes in using hostnames from a certain horizon, the server returns the hostnames from the replica set in that horizon. |