Skip to content
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

CXXCBC-172: refresh DNS SRV when cluster uncontactable #275

Conversation

avsej
Copy link
Member

@avsej avsej commented Oct 3, 2022

When DNS SRV records are used to connect to the SDK it's possible for the underlying addresses to change, i.e. the cluster to move. We need to detect this happening and react accordingly so that the SDK can continue to work correctly.

@avsej avsej requested review from brett19 and a team October 3, 2022 11:33
@avsej avsej force-pushed the CXXCBC-172-refresh-dns-srv-when-cluster-uncontactable branch from 368d563 to 8e81bec Compare October 3, 2022 11:49
When DNS SRV records are used to connect to the SDK it's possible for the
underlying addresses to change, i.e. the cluster to move. We need to detect
this happening and react accordingly so that the SDK can continue to work
correctly.
@avsej avsej force-pushed the CXXCBC-172-refresh-dns-srv-when-cluster-uncontactable branch from 8e81bec to a2fa7ef Compare October 3, 2022 11:58
@avsej
Copy link
Member Author

avsej commented Oct 3, 2022

Testing

brew install coredns

Create db.example.org with the following content

$ORIGIN example.org.
@	3600 IN	SOA sns.dns.icann.org. noc.dns.icann.org. (
				2017042745 ; serial
				7200       ; refresh (2 hours)
				3600       ; retry (1 hour)
				1209600    ; expire (2 weeks)
				3600       ; minimum (1 hour)
				)

	3600 IN NS a.iana-servers.net.
	3600 IN NS b.iana-servers.net.

_couchbase._tcp 10800 IN SRV 10 10 11210 localhost.

Create Corefile with the following content

example.org {
    file db.example.org
    log
}

Run coredns

$ coredns -dns.port=1053
example.org.:1053
CoreDNS-1.10.0
darwin/amd64, go1.19.1, 

Export the following environment variables

export TEST_DNS_NAMESERVER=127.0.0.1
export TEST_DNS_PORT=1053
export TEST_CONNECTION_STRING=couchbase://example.org

@avsej avsej force-pushed the CXXCBC-172-refresh-dns-srv-when-cluster-uncontactable branch 3 times, most recently from 4e2aeb8 to 182caa8 Compare October 3, 2022 16:45
@avsej avsej force-pushed the CXXCBC-172-refresh-dns-srv-when-cluster-uncontactable branch from 182caa8 to 956621a Compare October 3, 2022 16:45
Copy link
Contributor

@davidkelly davidkelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@avsej avsej merged commit 78e3e88 into couchbaselabs:main Oct 3, 2022
@avsej avsej deleted the CXXCBC-172-refresh-dns-srv-when-cluster-uncontactable branch October 3, 2022 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants