Skip to content

HBASE-30257 Fix case-sensitive hostname check in region server#8413

Open
taklwu wants to merge 2 commits into
apache:masterfrom
taklwu:HBASE-30257
Open

HBASE-30257 Fix case-sensitive hostname check in region server#8413
taklwu wants to merge 2 commits into
apache:masterfrom
taklwu:HBASE-30257

Conversation

@taklwu

@taklwu taklwu commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR (HBASE-30257) addresses a RegionServer startup failure scenario where the master-provided hostname check could incorrectly fail due to case-sensitive hostname comparisons. It introduces a shared utility for hostname equality and switches the RegionServer check to use it.

Changes:

  • Add Strings.hostnamesEqual for case-insensitive DNS hostname comparisons.
  • Update HRegionServer to use the new hostname comparison helper during report-for-duty handling.
  • Add unit tests covering the new hostname comparison behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java Uses Strings.hostnamesEqual to avoid case-sensitive hostname mismatch during RS startup.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Strings.java Introduces hostnamesEqual helper for hostname/IP identifier comparison.
hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestStrings.java Adds unit tests for Strings.hostnamesEqual.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hbase-common/src/main/java/org/apache/hadoop/hbase/util/Strings.java Outdated

@vaijosh vaijosh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@PDavid PDavid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Many thanks for fixing this. 👍

Minor: It seems spotless is complaining for formatting in the GH action build.

@anmolnar anmolnar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's concern is valid.

@anmolnar

anmolnar commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Copilot's concern is valid.

Just noticed that you've already applied the fix. Still reusing stuff in HBaseHostnameVerifier is worth to consider.

@taklwu

taklwu commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Copilot's concern is valid.

Just noticed that you've already applied the fix. Still reusing stuff in HBaseHostnameVerifier is worth to consider.

HBaseHostnameVerifier is a private class in hbase-common, your comment for reusing the those functions e.g. parseIpAddress would require moving/refactoring those functions into a public class e.g. Strings that HRegionServer can access.

I will give a try, but if that refactoring is not what you expected, please let me know.

@taklwu taklwu requested a review from anmolnar June 25, 2026 20:34
@taklwu

taklwu commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

failure should not be related, but I triggered a rerun.

[ERROR] Failures: 
[ERROR] org.apache.hadoop.hbase.replication.TestEditsBehindDroppedTableTiming.testEditsBehindDroppedTableTiming
[ERROR]   Run 1: TestEditsBehindDroppedTableTiming.testEditsBehindDroppedTableTiming:107->ReplicationDroppedTablesTestBase.verifyReplicationProceeded:161 Waited too much time for put replication
[ERROR]   Run 2: TestEditsBehindDroppedTableTiming.testEditsBehindDroppedTableTiming:107->ReplicationDroppedTablesTestBase.verifyReplicationProceeded:161 Waited too much time for put replication
[ERROR]   Run 3: TestEditsBehindDroppedTableTiming.testEditsBehindDroppedTableTiming:107->ReplicationDroppedTablesTestBase.verifyReplicationProceeded:161 Waited too much time for put replication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants