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

HBASE-28377 Fallback to simple is broken for blocking rpc client #5690

Merged
merged 2 commits into from Feb 19, 2024

Conversation

Apache9
Copy link
Contributor

@Apache9 Apache9 commented Feb 18, 2024

No description provided.

@Apache9 Apache9 self-assigned this Feb 18, 2024
@Apache9
Copy link
Contributor Author

Apache9 commented Feb 18, 2024

The fix itself is very simple, just set saslRpcClient to null when we want to fallback to simple auth at client side.

The most important changes are the newly added tests in AbstractTestSecureIPC. Also changed to throw FallbackDisallowedException instead of IOException in HBaseSaslRpcClient, to align with netty rpc client.

@Apache9
Copy link
Contributor Author

Apache9 commented Feb 18, 2024

@bbeaudreault We need to fix this before landing HBASE-28321.

@bbeaudreault
Copy link
Contributor

I'm not an expert on sasl. It makes some sense that if we fallback to simple, we don't need a saslRpcClient. But can you explain a little more what the issue was and why this change fixes it?

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 39s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for branch
+1 💚 mvninstall 2m 55s master passed
+1 💚 compile 3m 4s master passed
+1 💚 checkstyle 0m 54s master passed
+1 💚 spotless 0m 43s branch has no errors when running spotless:check.
+1 💚 spotbugs 2m 17s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for patch
+1 💚 mvninstall 2m 43s the patch passed
+1 💚 compile 3m 1s the patch passed
+1 💚 javac 3m 1s the patch passed
+1 💚 checkstyle 0m 16s hbase-client: The patch generated 0 new + 2 unchanged - 1 fixed = 2 total (was 3)
+1 💚 checkstyle 0m 36s The patch passed checkstyle in hbase-server
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 4m 46s Patch does not cause any errors with Hadoop 3.3.6.
+1 💚 spotless 0m 44s patch has no errors when running spotless:check.
+1 💚 spotbugs 2m 32s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 20s The patch does not generate ASF License warnings.
32m 19s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #5690
Optional Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
uname Linux f01c2d64ca0f 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 96a447f
Default Java Eclipse Adoptium-11.0.17+8
Max. process+thread count 80 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/1/console
versions git=2.34.1 maven=3.8.6 spotbugs=4.7.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 12s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for branch
+1 💚 mvninstall 2m 58s master passed
+1 💚 compile 1m 9s master passed
+1 💚 shadedjars 5m 13s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 43s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 14s Maven dependency ordering for patch
+1 💚 mvninstall 2m 48s the patch passed
+1 💚 compile 1m 8s the patch passed
+1 💚 javac 1m 8s the patch passed
+1 💚 shadedjars 5m 6s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 42s the patch passed
_ Other Tests _
+1 💚 unit 1m 42s hbase-client in the patch passed.
-1 ❌ unit 224m 30s hbase-server in the patch failed.
251m 26s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #5690
Optional Tests javac javadoc unit shadedjars compile
uname Linux b50cb63ec347 5.4.0-166-generic #183-Ubuntu SMP Mon Oct 2 11:28:33 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 96a447f
Default Java Eclipse Adoptium-11.0.17+8
unit https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-hbase-server.txt
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/1/testReport/
Max. process+thread count 4928 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/1/console
versions git=2.34.1 maven=3.8.6
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 36s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for branch
+1 💚 mvninstall 2m 40s master passed
+1 💚 compile 1m 1s master passed
+1 💚 shadedjars 5m 6s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 41s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 14s Maven dependency ordering for patch
+1 💚 mvninstall 2m 29s the patch passed
+1 💚 compile 1m 0s the patch passed
+1 💚 javac 1m 0s the patch passed
+1 💚 shadedjars 5m 4s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 40s the patch passed
_ Other Tests _
+1 💚 unit 1m 18s hbase-client in the patch passed.
-1 ❌ unit 238m 6s hbase-server in the patch failed.
263m 48s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #5690
Optional Tests javac javadoc unit shadedjars compile
uname Linux da91e08a466e 5.4.0-166-generic #183-Ubuntu SMP Mon Oct 2 11:28:33 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 96a447f
Default Java Temurin-1.8.0_352-b08
unit https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/1/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/1/testReport/
Max. process+thread count 4999 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/1/console
versions git=2.34.1 maven=3.8.6
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache9
Copy link
Contributor Author

Apache9 commented Feb 19, 2024

I'm not an expert on sasl. It makes some sense that if we fallback to simple, we don't need a saslRpcClient. But can you explain a little more what the issue was and why this change fixes it?

It is because here

When writing out connection header, we will test whether saslRpcClient is null to determine whether to do encryption, so if we want to fallback to simple, we need to set it saslRpcClient to null, otherwise we will get an exception like this:

java.lang.IllegalStateException: SASL authentication not completed
	at com.sun.security.sasl.util.AbstractSaslImpl.getNegotiatedProperty(AbstractSaslImpl.java:157)
	at org.apache.hadoop.hbase.security.HBaseSaslRpcClient.getSaslQOP(HBaseSaslRpcClient.java:174)
	at org.apache.hadoop.hbase.ipc.BlockingRpcConnection.writeConnectionHeader(BlockingRpcConnection.java:551)
	at org.apache.hadoop.hbase.ipc.BlockingRpcConnection.setupIOstreams(BlockingRpcConnection.java:507)
	at org.apache.hadoop.hbase.ipc.BlockingRpcConnection.writeRequest(BlockingRpcConnection.java:623)
	at org.apache.hadoop.hbase.ipc.BlockingRpcConnection.access$2(BlockingRpcConnection.java:608)
	at org.apache.hadoop.hbase.ipc.BlockingRpcConnection$4.run(BlockingRpcConnection.java:757)
	at org.apache.hadoop.hbase.ipc.HBaseRpcControllerImpl.notifyOnCancel(HBaseRpcControllerImpl.java:276)
	at org.apache.hadoop.hbase.ipc.BlockingRpcConnection.sendRequest(BlockingRpcConnection.java:730)
	at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callMethod(AbstractRpcClient.java:448)
	at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:335)
	at org.apache.hadoop.hbase.ipc.AbstractRpcClient.access$0(AbstractRpcClient.java:331)
	at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:599)
	at org.apache.hadoop.hbase.shaded.ipc.protobuf.generated.TestRpcServiceProtos$TestProtobufRpcProto$BlockingStub.echo(TestRpcServiceProtos.java:490)
	at org.apache.hadoop.hbase.security.AbstractTestSecureIPC$TestThread.run(AbstractTestSecureIPC.java:448)

@Apache9
Copy link
Contributor Author

Apache9 commented Feb 19, 2024

Let me fix the failed UT, seems we could also have other types of exceptions when server close the connection.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 34s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for branch
+1 💚 mvninstall 2m 54s master passed
+1 💚 compile 3m 2s master passed
+1 💚 checkstyle 0m 55s master passed
+1 💚 spotless 0m 44s branch has no errors when running spotless:check.
+1 💚 spotbugs 2m 14s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 2m 44s the patch passed
+1 💚 compile 3m 5s the patch passed
+1 💚 javac 3m 5s the patch passed
+1 💚 checkstyle 0m 16s hbase-client: The patch generated 0 new + 2 unchanged - 1 fixed = 2 total (was 3)
+1 💚 checkstyle 0m 35s The patch passed checkstyle in hbase-server
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 4m 48s Patch does not cause any errors with Hadoop 3.3.6.
+1 💚 spotless 0m 43s patch has no errors when running spotless:check.
+1 💚 spotbugs 3m 5s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 21s The patch does not generate ASF License warnings.
32m 39s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #5690
Optional Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
uname Linux 955a15cbe32e 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / b5175ba
Default Java Eclipse Adoptium-11.0.17+8
Max. process+thread count 82 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/2/console
versions git=2.34.1 maven=3.8.6 spotbugs=4.7.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 13s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for branch
+1 💚 mvninstall 2m 43s master passed
+1 💚 compile 1m 7s master passed
+1 💚 shadedjars 5m 8s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 42s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 14s Maven dependency ordering for patch
+1 💚 mvninstall 2m 43s the patch passed
+1 💚 compile 1m 9s the patch passed
+1 💚 javac 1m 9s the patch passed
+1 💚 shadedjars 5m 4s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 43s the patch passed
_ Other Tests _
+1 💚 unit 1m 43s hbase-client in the patch passed.
+1 💚 unit 222m 54s hbase-server in the patch passed.
249m 11s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #5690
Optional Tests javac javadoc unit shadedjars compile
uname Linux 3fcae02d4d1e 5.4.0-166-generic #183-Ubuntu SMP Mon Oct 2 11:28:33 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / b5175ba
Default Java Eclipse Adoptium-11.0.17+8
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/2/testReport/
Max. process+thread count 5409 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/2/console
versions git=2.34.1 maven=3.8.6
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 44s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for branch
+1 💚 mvninstall 2m 35s master passed
+1 💚 compile 1m 1s master passed
+1 💚 shadedjars 5m 1s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 41s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 14s Maven dependency ordering for patch
+1 💚 mvninstall 2m 27s the patch passed
+1 💚 compile 1m 2s the patch passed
+1 💚 javac 1m 2s the patch passed
+1 💚 shadedjars 4m 59s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 40s the patch passed
_ Other Tests _
+1 💚 unit 1m 22s hbase-client in the patch passed.
-1 ❌ unit 241m 15s hbase-server in the patch failed.
267m 32s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #5690
Optional Tests javac javadoc unit shadedjars compile
uname Linux 7dbd9b371192 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / b5175ba
Default Java Temurin-1.8.0_352-b08
unit https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/2/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/2/testReport/
Max. process+thread count 5243 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5690/2/console
versions git=2.34.1 maven=3.8.6
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@bbeaudreault bbeaudreault left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation. Lgtm

@Apache9 Apache9 merged commit 7bc07a6 into apache:master Feb 19, 2024
1 check failed
Apache9 added a commit that referenced this pull request Feb 19, 2024
Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org>
(cherry picked from commit 7bc07a6)
Apache9 added a commit that referenced this pull request Feb 19, 2024
Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org>
(cherry picked from commit 7bc07a6)
Apache9 added a commit that referenced this pull request Feb 19, 2024
Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org>
(cherry picked from commit 7bc07a6)
Apache9 added a commit that referenced this pull request Feb 19, 2024
Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org>
(cherry picked from commit 7bc07a6)
Apache9 added a commit that referenced this pull request Feb 20, 2024
Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org>
(cherry picked from commit 7bc07a6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants