You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Ashwani Raina (Code Review)" <ge...@cloudera.org> on 2025/11/08 14:51:12 UTC

[kudu-CR] [rpc] Fail ipv4 requests when ip mode is 'ipv6'

Ashwani Raina has uploaded this change for review. ( http://gerrit.cloudera.org:8080/23651


Change subject: [rpc] Fail ipv4 requests when ip mode is 'ipv6'
......................................................................

[rpc] Fail ipv4 requests when ip mode is 'ipv6'

As part of adding IPv6 support, a config flag was added to represent
the modes in which a Kudu cluster can be configured. Out of the three
possible modes, if user selects 'ipv6' mode, it should essentially
entertain tcp requests from only 'ipv6' clients and any incoming 'ipv4'
request should fail with 'address family not supported' error.

- This patch takes care of that by setting a socket option (IPV6_V6ONLY)
  at protocol level.
- Add a few unit tests to test the added code for different modes and
  clients from different families.
- Miscellaneous changes to improve readability.

Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
---
M src/kudu/rpc/messenger.cc
M src/kudu/rpc/rpc-test.cc
M src/kudu/util/net/sockaddr.cc
M src/kudu/util/net/sockaddr.h
M src/kudu/util/net/socket.cc
M src/kudu/util/net/socket.h
6 files changed, 140 insertions(+), 3 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 1
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 4:

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


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 4
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Fri, 02 Jan 2026 07:15:27 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 3: Code-Review+2

(4 comments)

Overall LGTM, just a couple of nits to address.

Thanks for revving this patch!

http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc
File src/kudu/rpc/rpc-test.cc:

http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2247
PS2, Line 2247:   case I
> ASSERT_OK returns status from ctor. I have removed the ctor and replaced wi
ASSERT_OK doesn't return Status, but a void expression.  But compilation would fail with ASSERT_OK() here, indeed.

Moving all the preparation steps into the SetUp() method is the best option, thanks.


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2329
PS2, Line 2329: }
              : 
> The error string :
Yes, this looks good to me.  Thanks for the update.


http://gerrit.cloudera.org:8080/#/c/23651/3/src/kudu/rpc/rpc-test.cc
File src/kudu/rpc/rpc-test.cc:

http://gerrit.cloudera.org:8080/#/c/23651/3/src/kudu/rpc/rpc-test.cc@2294
PS3, Line 2294:     Status s;
              :     s = s4.Connect(target_addr);
nit: could this be just

  Status s = s4.Connect(target_addr);

?


http://gerrit.cloudera.org:8080/#/c/23651/3/src/kudu/rpc/rpc-test.cc@2319
PS3, Line 2319:     Status s;
              :     s = s6.Connect(target_addr);
nit: please shorten to

  Status s = s6.Connect(target_addr);

?



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 3
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Wed, 31 Dec 2025 18:05:49 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 4: Verified-1

Build Failed 

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


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 4
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Fri, 02 Jan 2026 07:59:55 +0000
Gerrit-HasComments: No

[kudu-CR] [rpc] Fail ipv4 requests when ip mode is 'ipv6'

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

Change subject: [rpc] Fail ipv4 requests when ip mode is 'ipv6'
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/23651/1/src/kudu/rpc/rpc-test.cc
File src/kudu/rpc/rpc-test.cc:

http://gerrit.cloudera.org:8080/#/c/23651/1/src/kudu/rpc/rpc-test.cc@2326
PS1, Line 2326:     s = s6.Connect(target_addr);
Would it be valuable to also test an actual end-to-end RPC call (e.g., using DoTestSyncCall) to verify the full stack works, not just socket connection? The infrastructure already exists in RpcTestBase.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 1
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Mon, 10 Nov 2025 13:30:38 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 2:

(9 comments)

http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/messenger.cc
File src/kudu/rpc/messenger.cc:

http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/messenger.cc@267
PS2, Line 267: // IPV6_V6ONLY socket option is not applicable to Unix domain sockets.
It seems there is a difference in behavior between setting SO_REUSEPORT below and this IPV6_V6ONLY option.

Is there some rationale to have such a difference?  Why not to return back Status::ConfigurationError() as well if IPV6_V6ONLY is attempted to set on a Unix socket?


http://gerrit.cloudera.org:8080/#/c/23651/1/src/kudu/rpc/rpc-test.cc
File src/kudu/rpc/rpc-test.cc:

http://gerrit.cloudera.org:8080/#/c/23651/1/src/kudu/rpc/rpc-test.cc@2326
PS1, Line 2326:     s = s6.Connect(target_addr);
> It is important to have a control over what type of sockets we create in or
Right, it's important to have unit-style tests like this.

However, do you think we will need to eventually add coverage for the the whole stack end-to-end when setting particular IP mode for the server side?  I also don't expect too many surprises, but I agree with Marton that it should be great to have it covered at least to catch regressions, if any.


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc
File src/kudu/rpc/rpc-test.cc:

http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2247
PS2, Line 2247: CHECK_OK
Why not to use ASSERT_OK here?


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2258
PS2, Line 2258:   void TearDown() override {
              :     RpcTestBase::TearDown();
              :   }
What are you trying to achieve with this override if it simply calls the method that would be called without this overriding TearDown() method?


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2271
PS2, Line 2271:   Status s;
nit: when possible, having variables with smaller scope is preferred since it improves readability and brings less surprises


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2277
PS2, Line 2277: TestRpc.TestIpConfigModes
This doesn't seem to match the name of the test?


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2286
PS2, Line 2286:   // Target address is required mainly for dual mode. This is required to rule out
              :   // any possibility of 'connect' call failing due to invalid target address.
              :   Sockaddr target_addr = server_addr;
Move this under the first sub-scope with IPv4-related client scenarios to avoid shadowing the variable in the second sub-scope?


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2306
PS2, Line 2306:       ASSERT_FALSE(s.ok());
Consider be more explicit on the type of Status error, e.g. something like

  ASSERT_TRUE(s.IsInvalidArgument()) << s.ToString();


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2329
PS2, Line 2329:       ASSERT_FALSE(s.ok());
              :       ASSERT_STR_CONTAINS(s.ToString(), "Invalid argument");
Replace these two lines with one:

  ASSERT_TRUE(s.IsInvalidArgument()) << s.ToString();



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 2
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Tue, 16 Dec 2025 08:01:15 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 3:

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


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 3
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Mon, 29 Dec 2025 09:36:36 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 3: Verified-1

Build Failed 

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


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 3
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Mon, 29 Dec 2025 10:30:27 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

Posted by "Ashwani Raina (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Kudu Jenkins, 

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

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

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................

KUDU-1457 [5/n] Enable IPv6-only mode for rpc

As part of adding IPv6 support, a config flag was added to represent
the modes in which a Kudu cluster can be configured. Out of the three
possible modes, if user selects 'ipv6' mode, it should essentially
entertain tcp requests from only 'ipv6' clients and any incoming 'ipv4'
request should fail with 'address family not supported' error.

- This patch takes care of that by setting a socket option (IPV6_V6ONLY)
  at protocol level.
- Add a few unit tests to test the added code for different modes and
  clients from different families.
- Miscellaneous changes to improve readability.

Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
---
M src/kudu/rpc/messenger.cc
M src/kudu/rpc/rpc-test.cc
M src/kudu/util/net/sockaddr.cc
M src/kudu/util/net/sockaddr.h
M src/kudu/util/net/socket.cc
M src/kudu/util/net/socket.h
6 files changed, 140 insertions(+), 3 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 2
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>

[kudu-CR] [rpc] Fail ipv4 requests when ip mode is 'ipv6'

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

Change subject: [rpc] Fail ipv4 requests when ip mode is 'ipv6'
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/23651/1/src/kudu/rpc/rpc-test.cc
File src/kudu/rpc/rpc-test.cc:

http://gerrit.cloudera.org:8080/#/c/23651/1/src/kudu/rpc/rpc-test.cc@2326
PS1, Line 2326:     s = s6.Connect(target_addr);
> Would it be valuable to also test an actual end-to-end RPC call (e.g., usin
It is important to have a control over what type of sockets we create in order to test and verify whether connection is accepted or refused based on the IP protocol compatibility as well socket options (e.g. IPv6 mode when only IPv6 connection are served).

There is no easy way to enforce the client socket protocol if we go by DoTestSyncCall route. The proxy sends outbounds requests via reactor threads that create client socket based on server family. I am not aware if we have a way to manipulate client socket init parameters so deep in the code from the test here.

I don't expect RPC to deviate from this behaviour unless you have some scenario where it could? If there is such a possibility, I would be happy to mull about introducing client socket level customisation code that can be used to verify same sub-test cases.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 1
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Tue, 11 Nov 2025 13:59:57 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/23651/3/src/kudu/rpc/rpc-test.cc
File src/kudu/rpc/rpc-test.cc:

http://gerrit.cloudera.org:8080/#/c/23651/3/src/kudu/rpc/rpc-test.cc@2294
PS3, Line 2294:     Status s;
              :     s = s4.Connect(target_addr);
> nit: could this be just
Done


http://gerrit.cloudera.org:8080/#/c/23651/3/src/kudu/rpc/rpc-test.cc@2319
PS3, Line 2319:     Status s;
              :     s = s6.Connect(target_addr);
> nit: please shorten to
Done



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 3
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Fri, 02 Jan 2026 06:56:02 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 4: Verified+1

unrelated test failure of a flaky test (TSAN): KUDU-3713


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 4
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Fri, 02 Jan 2026 18:39:03 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 4: Code-Review+2


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 4
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Fri, 02 Jan 2026 18:39:18 +0000
Gerrit-HasComments: No

[kudu-CR] [rpc] Fail ipv4 requests when ip mode is 'ipv6'

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

Change subject: [rpc] Fail ipv4 requests when ip mode is 'ipv6'
......................................................................


Patch Set 1: Verified-1

Build Failed 

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


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 1
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sat, 08 Nov 2025 16:34:02 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

Posted by "Ashwani Raina (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Alexey Serbin, Kudu Jenkins, 

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

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

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................

KUDU-1457 [5/n] Enable IPv6-only mode for rpc

As part of adding IPv6 support, a config flag was added to represent
the modes in which a Kudu cluster can be configured. Out of the three
possible modes, if user selects 'ipv6' mode, it should essentially
entertain tcp requests from only 'ipv6' clients and any incoming 'ipv4'
request should fail with 'address family not supported' error.

- This patch takes care of that by setting a socket option (IPV6_V6ONLY)
  at protocol level.
- Add a few unit tests to test the added code for different modes and
  clients from different families.
- Miscellaneous changes to improve readability.

Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
---
M src/kudu/rpc/messenger.cc
M src/kudu/rpc/rpc-test.cc
M src/kudu/server/server_base.cc
M src/kudu/util/net/sockaddr.cc
M src/kudu/util/net/sockaddr.h
M src/kudu/util/net/socket.cc
M src/kudu/util/net/socket.h
7 files changed, 159 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/51/23651/4
-- 
To view, visit http://gerrit.cloudera.org:8080/23651
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 4
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 2:

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


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 2
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Mon, 24 Nov 2025 20:20:52 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................

KUDU-1457 [5/n] Enable IPv6-only mode for rpc

As part of adding IPv6 support, a config flag was added to represent
the modes in which a Kudu cluster can be configured. Out of the three
possible modes, if user selects 'ipv6' mode, it should essentially
entertain tcp requests from only 'ipv6' clients and any incoming 'ipv4'
request should fail with 'address family not supported' error.

- This patch takes care of that by setting a socket option (IPV6_V6ONLY)
  at protocol level.
- Add a few unit tests to test the added code for different modes and
  clients from different families.
- Miscellaneous changes to improve readability.

Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Reviewed-on: http://gerrit.cloudera.org:8080/23651
Tested-by: Alexey Serbin <al...@apache.org>
Reviewed-by: Alexey Serbin <al...@apache.org>
---
M src/kudu/rpc/messenger.cc
M src/kudu/rpc/rpc-test.cc
M src/kudu/server/server_base.cc
M src/kudu/util/net/sockaddr.cc
M src/kudu/util/net/sockaddr.h
M src/kudu/util/net/socket.cc
M src/kudu/util/net/socket.h
7 files changed, 159 insertions(+), 13 deletions(-)

Approvals:
  Alexey Serbin: Looks good to me, approved; Verified

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 5
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has removed a vote on this change.

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/23651
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 4
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

Posted by "Ashwani Raina (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Alexey Serbin, Kudu Jenkins, 

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

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

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................

KUDU-1457 [5/n] Enable IPv6-only mode for rpc

As part of adding IPv6 support, a config flag was added to represent
the modes in which a Kudu cluster can be configured. Out of the three
possible modes, if user selects 'ipv6' mode, it should essentially
entertain tcp requests from only 'ipv6' clients and any incoming 'ipv4'
request should fail with 'address family not supported' error.

- This patch takes care of that by setting a socket option (IPV6_V6ONLY)
  at protocol level.
- Add a few unit tests to test the added code for different modes and
  clients from different families.
- Miscellaneous changes to improve readability.

Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
---
M src/kudu/rpc/messenger.cc
M src/kudu/rpc/rpc-test.cc
M src/kudu/server/server_base.cc
M src/kudu/util/net/sockaddr.cc
M src/kudu/util/net/sockaddr.h
M src/kudu/util/net/socket.cc
M src/kudu/util/net/socket.h
7 files changed, 161 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/51/23651/3
-- 
To view, visit http://gerrit.cloudera.org:8080/23651
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 3
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>

[kudu-CR] [rpc] Fail ipv4 requests when ip mode is 'ipv6'

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

Change subject: [rpc] Fail ipv4 requests when ip mode is 'ipv6'
......................................................................


Patch Set 1:

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


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 1
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sat, 08 Nov 2025 14:51:21 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 2: Verified+1

Build Successful 

http://jenkins.kudu.apache.org/job/pre_commit/2165/ : SUCCESS


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 2
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Mon, 24 Nov 2025 21:44:44 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-1457 [5/n] Enable IPv6-only mode for rpc

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

Change subject: KUDU-1457 [5/n] Enable IPv6-only mode for rpc
......................................................................


Patch Set 2:

(9 comments)

http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/messenger.cc
File src/kudu/rpc/messenger.cc:

http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/messenger.cc@267
PS2, Line 267: // IPV6_V6ONLY socket option is not applicable to Unix domain sockets.
> It seems there is a difference in behavior between setting SO_REUSEPORT bel
My intention was to allow further socket operations on a Unix domain socket even if the ip_config_mode is set to "ipv6". 

ip_config_mode is a server level setting and not a per socket configuration. In other words, it should be ok to have ip_config_mode set to "ipv6" and be able to create Unix domain sockets.

For example, using --rpc_listen_on_unix_domain_socket flag, if a RPC server is initialized to listen on a Unix domain socket, and if ip_config_mode happens to be set to "ipv6", the RPC server init will fail if we return with a config error.

reuseport is set on a messenger object that can potentially have multiple acceptor pools with dedicated socket and each socket can have distinct options set. Whereas ip_config_mode is set at server level and with this set to "ipv6", co-existence of Unix domain sockets and TCP sockets is possible (if such a requirement arises).
Maybe such a use case is not valid even for tests. Since FLAGS_rpc_reuseport is also set at server level i.e. it will be applicable to all sockets under a messenger object. I guess there is not much different between the two scenarios.

It makes sense to change this to reuseport like case and simply return Status::ConfigurationError() as you pointed out.

I have added a similar check in ValidateSocketOptionCompatibility() flag validator to report incompatibility between FLAGS_rpc_listen_on_unix_domain_socket and ip_config_mode set to 'ipv6'


http://gerrit.cloudera.org:8080/#/c/23651/1/src/kudu/rpc/rpc-test.cc
File src/kudu/rpc/rpc-test.cc:

http://gerrit.cloudera.org:8080/#/c/23651/1/src/kudu/rpc/rpc-test.cc@2326
PS1, Line 2326:     s = s6.Connect(target_addr);
> Right, it's important to have unit-style tests like this.
I can imagine some regression scenarios might arise in future where some RPC code modifications can lead to this socket option not getting set for some reason, especially from calling layers sitting above Socket class. In such cases, we would definitely need some end-to-end tests to catch such scenarios.

That additional set of tests would require additional customization code that is out of scope of this patch. I am happy to do it in a separate patch or upstream jira.


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc
File src/kudu/rpc/rpc-test.cc:

http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2247
PS2, Line 2247: CHECK_OK
> Why not to use ASSERT_OK here?
ASSERT_OK returns status from ctor. I have removed the ctor and replaced with SetUp() along with ASSERT_OK.


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2258
PS2, Line 2258:   void TearDown() override {
              :     RpcTestBase::TearDown();
              :   }
> What are you trying to achieve with this override if it simply calls the me
No idea why it was there. Removed.


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2271
PS2, Line 2271:   Status s;
> nit: when possible, having variables with smaller scope is preferred since 
Done


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2277
PS2, Line 2277: TestRpc.TestIpConfigModes
> This doesn't seem to match the name of the test?
Done


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2286
PS2, Line 2286:   // Target address is required mainly for dual mode. This is required to rule out
              :   // any possibility of 'connect' call failing due to invalid target address.
              :   Sockaddr target_addr = server_addr;
> Move this under the first sub-scope with IPv4-related client scenarios to a
Done


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2306
PS2, Line 2306:       ASSERT_FALSE(s.ok());
> Consider be more explicit on the type of Status error, e.g. something like
Done


http://gerrit.cloudera.org:8080/#/c/23651/2/src/kudu/rpc/rpc-test.cc@2329
PS2, Line 2329:       ASSERT_FALSE(s.ok());
              :       ASSERT_STR_CONTAINS(s.ToString(), "Invalid argument");
> Replace these two lines with one:
The error string :
Network error: connect(2) error: Invalid argument (error 22)

"Invalid argument" is the internal error (errno) and the one that is returned back to callers is kNetworkError.

How about this, check the error code as well as errno from status string. It aligns with above check at lines 2306-2307:
ASSERT_TRUE(s.IsNetworkError()) << s.ToString();      
ASSERT_STR_CONTAINS(s.ToString(), "Invalid argument");



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic84ba301d0faa36e928eec54872d02f28a4f793f
Gerrit-Change-Number: 23651
Gerrit-PatchSet: 2
Gerrit-Owner: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Mon, 29 Dec 2025 09:34:56 +0000
Gerrit-HasComments: Yes