-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29144 Client request fails for KERBEROS with RpcConnectionRegistry #7580
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
Conversation
|
As I said on the jira issue, we need to find out why we need to use a singleton instance... This PR just reverts the code change in HBASE-25051... |
This comment has been minimized.
This comment has been minimized.
Caused by: org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed contacting masters after 1 attempts. Exceptions: java.io.IOException: Call to address=192.168.35.34:57912 failed on local exception: java.io.IOException: Authentication provider class org.apache.hadoop.hbase.security.provider.SimpleSaslClientAuthenticationProvider returned a null SaslClient
…Jain" This reverts commit 8b46519ca6dbc2a05a5b083e182383a070763daa.
60e1c16 to
e057371
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@Apache9 Hi, thanks for taking a look.
I don't think this accurately describes the patch. Could you please take another look? This change does not revert what was done in HBASE-25051. Instead, it only changes how we instruct the RPC connection for obtaining the cluster ID to not use SASL. Previously, we used to achieve that by passing a modified Configuration object. With this patch, we explicitly choose not to use SASL when a valid cluster ID is not provided as a parameter. To my understanding, this only happens when obtaining the cluster ID. After all, this change doesn't break any existing tests. That said, I understand that you may want to take a different approach. However, I still believe it's preferable to avoid mutating the configuration object, as doing so can lead to unintended side effects elsewhere in the codebase. |
|
We do not want any authentications when fetching cluster id, so we create a new configuration instance and use it for the rpc connnection, this is a valid solution and should not have any side effect, as I do not modify the existing configuration object right? If this is not a valid usage, then how do our users try connecting to different hbase clusters in a single client process, where one cluster enables sasl, the other does not? As I said on the jira issue, the problem here is we should not have a singleton SaslProviders, as its intialization needs a Configuration object, but we allow our users to initialize different rpc connections with different Configurations right? This is what we need to fix here, I think. Thanks. |
You make a valid point. I initially thought that not modifying the original Configuration would free us from having to worry about how it's used downstream. But on second thought, that would only mask fundamental bugs like this, which can't really be considered a good thing. |
This comment has been minimized.
This comment has been minimized.
|
In the last commit, I extended the interface to accept a Alternatively, we could just remove the "singleton-ness" of |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The test failures are related. This is because the test-defined class |
|
Seems you misunderstand my point above... I mean we should just remove the getInstance method, initialize Providers everytime when creating a new RpcClient... Or at least, we should not use getInstance in our code base, but keep the method there for compatibility since the class is IA.LimitedPrivate. |
This comment has been minimized.
This comment has been minimized.
I explained why I didn't take the approach above.
If I'm not mistaken, the motivation behind HBASE-23347 was to allow users to implement their own Lines 34 to 39 in 130453d
That said, I can't decide if we should be concerned about the possibility. |
If user just initialize one RpcClient in their program, then removing the singleton pattern does not break anything, we still only initialize the provider once. And the old behavior is incorrect if users choose to connect to different hbase clusters in a single process, so it does not make sense to keep the old behavior and try to fix only one of the possible problems with a very hacky way and leave lots of potential problems out there... I prefer we just remove the singleton pattern, add release note and update the ref guide about this behavior change, and make new releases. About the test, please extend TestBasicReadWriteWithDifferentConnectionRegistries instead of TestRpcConnectionRegistry, as TestRpcConnectionRegistry does not have any table read write requests, it just tests connection registry APIs... |
We currently use |
|
Please let me know if the latest commits align with your vision. |
This comment has been minimized.
This comment has been minimized.
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
Yeah, I did that in the first commit, but I later removed it in the second commit as it became pointless.
I also considered that, but I decided it was unnecessary because Anyway, I'll fine with you taking over from here. I think we just need to mention that |
It is a Connection instance per HBase cluster, not a RpcConnection per region server, which should be OK I assume :) |
|
Yeah, that's what I meant by "connection" from the user's point of view. We still should mention the change though. |
This pull request is for exploring possible fixes for HBASE-29144.
However, I'm concerned about mutating a configuration object that could be reused in unintended ways later (e.g., being cached by a singleton, as in this case). So I also explored an alternative approach.
noAuthConf. And as expected, the test fails again.noAuthConf.