Skip to content

Backport "HBASE-30101 Move login() before RpcServer construction (#8122)" to branch-2#8173

Open
junegunn wants to merge 1 commit intoapache:branch-2from
junegunn:HBASE-30101-branch-2
Open

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

Conversation

@junegunn
Copy link
Copy Markdown
Member

Summary of resolution:

  • HBaseServerBase.java doesn't exist in branch-2; the constructor logic lives directly in HRegionServer. Kept the file deleted with git rm.
  • Adapted the master-branch changes (originally in HBaseServerBase) into HRegionServer:
    • Reordered the constructor: resolve hostname → ZK login → server login → createRpcServices().
    • Added resolveHostName() helper using DNS.getHostname(conf, getDNSServerType()).
    • Added getDNSServerType() returning REGIONSERVER (HMaster's MASTER override was already in the staged hunk).
    • Changed the UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY branch in getUseThisHostnameInstead to use DNS.getHostname instead of rpcServices.isa.getHostName().

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