[CSHARP-869] Stop Caching the IPEndPoint for a Server Instance. Created: 05/Dec/13 Updated: 04/Feb/20 Resolved: 20/Feb/14 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.8.3 |
| Fix Version/s: | 1.9 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Craig Wilson | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Currently, we cache the IPEndPoint after we have resolved a server's hostname from DNS. In some cases, if a machine is moved to a different IP address and DNS is updated, this will prevent the driver from reconnecting to this machine. |
| Comments |
| Comment by Igor Silva [ 04/Feb/20 ] | ||
|
It appears to have regressed in v2.7. We have a k8s cluster containing a mongo replicaSet (1 node right now) and a group of pods connecting into it via the cluster's DNS (my-db-0.my-db). Whenever the DB pod restarts - for any reason - and it's IP is changed, the dotnet app isn't able to connect anymore. The log we see is the following:
Note: 10.240.0.19 is the old IP (pre-restart). The new one is 10.240.0.21. I've been able to ping from one of the pods and it does correctly point to the new IP. The issue seems to be on the Mongo Layer. Restarting the application pod does solve as the cache is cleaned.
| ||
| Comment by Githook User [ 20/Feb/14 ] | ||
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: | ||
| Comment by Vincent [ 06/Dec/13 ] | ||
|
Thanks for the precision, Craig! | ||
| Comment by Craig Wilson [ 06/Dec/13 ] | ||
|
The machine is already caching this on some level, so any caching we do is redundant. In addition, we are pooling connections, so the amount of speed up is very minimal. | ||
| Comment by Vincent [ 06/Dec/13 ] | ||
|
You should probably keep this cache and simply make the driver try to update it every X seconds (because this cache is nice to speed up new connections/in case of DNS failures). |