HBASE-30257 Fix case-sensitive hostname check in region server#8413
HBASE-30257 Fix case-sensitive hostname check in region server#8413taklwu wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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.hostnamesEqualfor case-insensitive DNS hostname comparisons. - Update
HRegionServerto 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.
PDavid
left a comment
There was a problem hiding this comment.
Many thanks for fixing this. 👍
Minor: It seems spotless is complaining for formatting in the GH action build.
anmolnar
left a comment
There was a problem hiding this comment.
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. |
|
failure should not be related, but I triggered a rerun. |
No description provided.