Backport "HBASE-30101 Move login() before RpcServer construction (#8122)" to branch-2.5#8175
Open
junegunn wants to merge 1 commit intoapache:branch-2.5from
Open
Backport "HBASE-30101 Move login() before RpcServer construction (#8122)" to branch-2.5#8175junegunn wants to merge 1 commit intoapache:branch-2.5from
junegunn wants to merge 1 commit intoapache:branch-2.5from
Conversation
The RpcServer constructor calls userProvider.getCurrentUserName() (HBASE-28321) which triggers UserGroupInformation.getCurrentUser(). If the server has not logged in yet, UGI bootstraps from the ticket cache and spawns a TGT renewer for whichever principal happens to be there, regardless of the principal the server is configured to use. Resolve the hostname up front via DNS.getHostname(...) and run the ZK client and server logins before createRpcServices(), so that UGI is already bound to the keytab principal by the time the RpcServer constructor runs. HRegionServer.getUseThisHostnameInstead() previously fell back to rpcServices.getSocketAddress().getHostName() when the reverse-DNS disable flag was set; that branch now uses DNS.getHostname directly so it no longer depends on rpcServices being constructed. Signed-off-by: Duo Zhang <zhangduo@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Conflict in
HRegionServer.javaconstructor. Two adaptations needed:initNamedQueueRecorder(conf)helper instead of the inlinenamedQueueRecorder = NamedQueueRecorder.getInstance(...)from the upstream commit.resolveHostName().HConstants.HBASE_SERVER_USEIP_ENABLED_KEY/DEFAULTdon't exist in branch-2.5, soresolveHostNamefalls back toDNS.getHostname(conf, getDNSServerType())directly.