[GODRIVER-976] Connect to passing hosts if one host fails SRV verification Created: 18/Apr/19  Updated: 27/Oct/23  Resolved: 08/Aug/22

Status: Closed
Project: Go Driver
Component/s: Core API
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Isabella Siu (Inactive) Assignee: Benji Rewis (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Currently, if one host retrieved from SRV DNS records fails verification we don't connect to any of the returned hosts. According to the spec, we should connect to the ones that pass.



 Comments   
Comment by Benji Rewis (Inactive) [ 08/Aug/22 ]

The behavior described is still present in the driver but is correct according to the spec.

There are two types of SRV polling that happen within the Go driver. The first is for initial seedlist discovery and is done with the call to ParseHosts here. The second is for mongos discovery and is done with the call to ParseHosts here. The former passes a value of stopOnErr true and the latter passes a value of stopOnErr false. stopOnErr is used in fetchSeedlistFromSRV to determine whether SRV polling should cease upon receiving an error from validateSRVResult.

The initial DNS seedlist discovery specification states that we should error on SRV verification failure (stopOnErr should be true):

A driver MUST verify that the host names returned through SRV records have the same parent {domainname}. Drivers MUST raise an error and MUST NOT initiate a connection to any returned host name which does not share the same {domainname}.

The polling SRV records for mongos discovery specification states that we should not error on SRV verification failure (stopOnErr should be false):

A driver MUST verify that the host names returned through SRV records have the same parent {domainname}. When this verification fails, a driver: ... MUST NOT raise an error.

Comment by Ian Whalen (Inactive) [ 18/Apr/19 ]

isabella.siu to also file a SPEC ticket so we add a prose test for all drivers.

Generated at Thu Feb 08 08:35:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.