Skip to content

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
junegunn:HBASE-30101-branch-2.5
Open

Backport "HBASE-30101 Move login() before RpcServer construction (#8122)" to branch-2.5#8175
junegunn wants to merge 1 commit intoapache:branch-2.5from
junegunn:HBASE-30101-branch-2.5

Conversation

@junegunn
Copy link
Copy Markdown
Member

Conflict in HRegionServer.java constructor. Two adaptations needed:

  1. Kept branch-2.5's initNamedQueueRecorder(conf) helper instead of the inline namedQueueRecorder = NamedQueueRecorder.getInstance(...) from the upstream commit.
  2. Stripped the HBASE-27304 useIp branch from resolveHostName(). HConstants.HBASE_SERVER_USEIP_ENABLED_KEY/DEFAULT don't exist in branch-2.5, so resolveHostName falls back to DNS.getHostname(conf, getDNSServerType()) directly.

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>
@junegunn junegunn added the backport This PR is a back port of some issue or issues already committed to master label Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a back port of some issue or issues already committed to master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant