You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Alexey Serbin (Code Review)" <ge...@cloudera.org> on 2025/07/24 19:55:31 UTC

[kudu-CR] [net] use AF INET hint for GetFQDN()

Alexey Serbin has uploaded this change for review. ( http://gerrit.cloudera.org:8080/23213


Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................

[net] use AF_INET hint for GetFQDN()

I noticed that on nodes with not properly configured IPv6 DNS resolver
(e.g., my laptop) GetFQDN() would take quite a long time (~5 seconds)
even if it eventually returns the name.  This patch addresses the issue,
adding the AF_INET hint for 'ai_family' when invoking getaddrinfo().
Doing so is in sync with the set of hints provided for getaddrinfo()
invocation in the context of HostPort::ResolveAddresses().

Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
---
M src/kudu/util/net/net_util.cc
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/13/23213/1
-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>

[kudu-CR] [net] use AF INET hint for GetFQDN()

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/23213 )

Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................


Patch Set 2: Verified+1

DEBUG: unrelated test failure in Java test org.apache.kudu.backup.TestKuduBackup (known flaky test)


-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 25 Jul 2025 00:12:08 +0000
Gerrit-HasComments: No

[kudu-CR] [net] use AF INET hint for GetFQDN()

Posted by "Ashwani Raina (Code Review)" <ge...@cloudera.org>.
Ashwani Raina has posted comments on this change. ( http://gerrit.cloudera.org:8080/23213 )

Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................


Patch Set 2: Code-Review+1

> > Why did we not hit this issue before? Is it because we always
 > > tested on nodes with IPv6 disabled or something?
 > 
 > We have always been hitting this issue, even before.  At least I
 > have always had it on my laptop with Clodera's VPN enabled.  I've
 > just found it intolerable this time since it was slowing my
 > development cycle :)
 > 
 > > So is my understanding correct -  without the fix we end up
 > hitting
 > > both IPv6 and IPv4 resolvers at some point and the faulty IPv6
 > > resolver is causing the slowness? By explicitly declaring
 > AF_INET,
 > > we are not hitting that issues.
 > 
 > I didn't spend my time on doing the precise RCA, but I found that
 > limiting the DNS query just for IPv4 addresses solves the issue. 
 > If not adding the AF_INET family hint, adding extra records for
 > IPv6 addresses into the /etc/hosts would help in my particular case
 > as well.  Having this address family hint is a good option because:
 > (1) it allows for not hitting the issue with mis-configured IPv6
 > resolver without extra changes in /etc/hosts (2) it unifies the way
 > how IP addresses are resolved now in util/net (we limit everything
 > to IPv4 since we don't support IPv6 yet).

I didn't notice this during IPv6 testing (even with VPN enabled).
Maybe my laptop's name service switch order/local config allows
resolution to happen faster.

Maybe it is ok for now to look for IPv4 addresses only.
With IPv6 changes, we would need to change it back or maybe set the
hint to AF_UNSPEC (which is same as having nothing set).
Also, the signature of GetFQDN will probably change in order to ensure
both IPv4 and IPv6 address info. Caller will need to decide which one
to use. Currently, we are randomly returning first entry which is not
guaranteed to be IPv4 or IPv6 when hint is unspecified.


-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 25 Jul 2025 11:48:38 +0000
Gerrit-HasComments: No

[kudu-CR] [net] use AF INET hint for GetFQDN()

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Abhishek Chennaka, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/23213

to look at the new patch set (#2).

Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................

[net] use AF_INET hint for GetFQDN()

I noticed that on nodes with not properly configured IPv6 DNS resolver,
GetFQDN() would take quite a long time (~5 seconds) even if it
eventually returns the name.  This patch addresses the issue, adding
the AF_INET hint for 'ai_family' when invoking getaddrinfo().  Doing so
is in sync with the set of hints provided for the invocation of
getaddrinfo() in the context of HostPort::ResolveAddresses().

Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
---
M src/kudu/util/net/net_util.cc
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/13/23213/2
-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [net] use AF INET hint for GetFQDN()

Posted by "Abhishek Chennaka (Code Review)" <ge...@cloudera.org>.
Abhishek Chennaka has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/23213 )

Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................

[net] use AF_INET hint for GetFQDN()

I noticed that on nodes with not properly configured IPv6 DNS resolver,
GetFQDN() would take quite a long time (~5 seconds) even if it
eventually returns the name.  This patch addresses the issue, adding
the AF_INET hint for 'ai_family' when invoking getaddrinfo().  Doing so
is in sync with the set of hints provided for the invocation of
getaddrinfo() in the context of HostPort::ResolveAddresses().

Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Reviewed-on: http://gerrit.cloudera.org:8080/23213
Tested-by: Alexey Serbin <al...@apache.org>
Reviewed-by: Gabriella Lotz <lo...@gmail.com>
Reviewed-by: Ashwani Raina <ar...@gmail.com>
Reviewed-by: Abhishek Chennaka <ac...@cloudera.com>
---
M src/kudu/util/net/net_util.cc
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Alexey Serbin: Verified
  Gabriella Lotz: Looks good to me, but someone else must approve
  Ashwani Raina: Looks good to me, but someone else must approve
  Abhishek Chennaka: Looks good to me, approved

-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [net] use AF INET hint for GetFQDN()

Posted by "Abhishek Chennaka (Code Review)" <ge...@cloudera.org>.
Abhishek Chennaka has posted comments on this change. ( http://gerrit.cloudera.org:8080/23213 )

Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................


Patch Set 2:

Why did we not hit this issue before? Is it because we always tested on nodes with IPv6 disabled or something?
So is my understanding correct -  without the fix we end up hitting both IPv6 and IPv4 resolvers at some point and the faulty IPv6 resolver is causing the slowness? By explicitly declaring AF_INET, we are not hitting that issues.


-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 25 Jul 2025 01:54:23 +0000
Gerrit-HasComments: No

[kudu-CR] [net] use AF INET hint for GetFQDN()

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23213 )

Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................


Patch Set 1:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/1607/


-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 24 Jul 2025 19:55:37 +0000
Gerrit-HasComments: No

[kudu-CR] [net] use AF INET hint for GetFQDN()

Posted by "Gabriella Lotz (Code Review)" <ge...@cloudera.org>.
Gabriella Lotz has posted comments on this change. ( http://gerrit.cloudera.org:8080/23213 )

Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................


Patch Set 2: Code-Review+1


-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 25 Jul 2025 09:25:55 +0000
Gerrit-HasComments: No

[kudu-CR] [net] use AF INET hint for GetFQDN()

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/23213 )

Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................


Patch Set 1: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/1607/ : FAILURE


-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 24 Jul 2025 21:24:51 +0000
Gerrit-HasComments: No

[kudu-CR] [net] use AF INET hint for GetFQDN()

Posted by "Abhishek Chennaka (Code Review)" <ge...@cloudera.org>.
Abhishek Chennaka has posted comments on this change. ( http://gerrit.cloudera.org:8080/23213 )

Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................


Patch Set 2: Code-Review+2

Thanks for the explanation


-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 25 Jul 2025 17:12:38 +0000
Gerrit-HasComments: No

[kudu-CR] [net] use AF INET hint for GetFQDN()

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/23213 )

Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................


Patch Set 3:

> > > Why did we not hit this issue before? Is it because we always
 > > > tested on nodes with IPv6 disabled or something?
 > >
 > > We have always been hitting this issue, even before.  At least I
 > > have always had it on my laptop with Clodera's VPN enabled.  I've
 > > just found it intolerable this time since it was slowing my
 > > development cycle :)
 > >
 > > > So is my understanding correct -  without the fix we end up
 > > hitting
 > > > both IPv6 and IPv4 resolvers at some point and the faulty IPv6
 > > > resolver is causing the slowness? By explicitly declaring
 > > AF_INET,
 > > > we are not hitting that issues.
 > >
 > > I didn't spend my time on doing the precise RCA, but I found that
 > > limiting the DNS query just for IPv4 addresses solves the issue.
 > > If not adding the AF_INET family hint, adding extra records for
 > > IPv6 addresses into the /etc/hosts would help in my particular
 > case
 > > as well.  Having this address family hint is a good option
 > because:
 > > (1) it allows for not hitting the issue with mis-configured IPv6
 > > resolver without extra changes in /etc/hosts (2) it unifies the
 > way
 > > how IP addresses are resolved now in util/net (we limit
 > everything
 > > to IPv4 since we don't support IPv6 yet).
 > 
 > I didn't notice this during IPv6 testing (even with VPN enabled).
 > Maybe my laptop's name service switch order/local config allows
 > resolution to happen faster.
 > 
 > Maybe it is ok for now to look for IPv4 addresses only.
 > With IPv6 changes, we would need to change it back or maybe set the
 > hint to AF_UNSPEC (which is same as having nothing set).
 > Also, the signature of GetFQDN will probably change in order to
 > ensure
 > both IPv4 and IPv6 address info. Caller will need to decide which
 > one
 > to use. Currently, we are randomly returning first entry which is
 > not
 > guaranteed to be IPv4 or IPv6 when hint is unspecified.

I agree: we need to be more consistent with IPv4/IPv6 preference, especially when IPv6 support is explicitly enabled.

As for particular manifestation of the issue, the problem was visible when calling GetFQDN() for the local name of the machine that was originally assigned by local network's DHCP server, and then VPN of other outside network was enabled.


-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 25 Jul 2025 18:01:13 +0000
Gerrit-HasComments: No

[kudu-CR] [net] use AF INET hint for GetFQDN()

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/23213 )

Change subject: [net] use AF_INET hint for GetFQDN()
......................................................................


Patch Set 2:

> Why did we not hit this issue before? Is it because we always
 > tested on nodes with IPv6 disabled or something?

We have always been hitting this issue, even before.  At least I have always had it on my laptop with Clodera's VPN enabled.  I've just found it intolerable this time since it was slowing my development cycle :)

 > So is my understanding correct -  without the fix we end up hitting
 > both IPv6 and IPv4 resolvers at some point and the faulty IPv6
 > resolver is causing the slowness? By explicitly declaring AF_INET,
 > we are not hitting that issues.

I didn't spend my time on doing the precise RCA, but I found that limiting the DNS query just for IPv4 addresses solves the issue.  If not adding the AF_INET family hint, adding extra records for IPv6 addresses into the /etc/hosts would help in my particular case as well.  Having this address family hint is a good option because: (1) it allows for not hitting the issue with mis-configured IPv6 resolver without extra changes in /etc/hosts (2) it unifies the way how IP addresses are resolved now in util/net (we limit everything to IPv4 since we don't support IPv6 yet).


-- 
To view, visit http://gerrit.cloudera.org:8080/23213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibca0a3c1f7ad03a6f847057c38c00b42275dec8b
Gerrit-Change-Number: 23213
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 25 Jul 2025 02:35:04 +0000
Gerrit-HasComments: No