You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Sigma-Ma (via GitHub)" <gi...@apache.org> on 2026/07/19 15:16:06 UTC
[PR] HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup [hbase]
Sigma-Ma opened a new pull request, #8483:
URL: https://github.com/apache/hbase/pull/8483
### What changes were proposed in this pull request?
Make `HRegionServer#getBootstrapNodes` return an empty iterator when `bootstrapNodeManager` has not been initialized yet.
Declare `bootstrapNodeManager` as volatile to ensure safe publication between the RegionServer startup thread and RPC handler threads.
Add a regression test covering calls to `getBootstrapNodes` before `bootstrapNodeManager` initialization.
### Why are the changes needed?
The RPC server can start accepting connections before `preRegistrationInitialization()` assigns `bootstrapNodeManager`.
If a `GetBootstrapNodes` RPC arrives during this startup window, `HRegionServer#getBootstrapNodes` dereferences a null `bootstrapNodeManager` and throws a `NullPointerException`.
Returning an empty iterator during this window avoids the startup race and allows callers to continue bootstrap-node discovery normally.
### How was this patch tested?
```bash
mvn -pl hbase-server -am \
-Dtest=TestBootstrapNodeManager \
-Dsurefire.failIfNoSpecifiedTests=false \
-DskipITs \
test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup [hbase]
Posted by "Sigma-Ma (via GitHub)" <gi...@apache.org>.
Sigma-Ma commented on PR #8483:
URL: https://github.com/apache/hbase/pull/8483#issuecomment-5020560648
Hi maintainers, the three GitHub Actions workflows for this fork PR are awaiting approval. This PR does not modify any workflow files.
Could someone with write access approve them when convenient? Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup [hbase]
Posted by "Sigma-Ma (via GitHub)" <gi...@apache.org>.
Sigma-Ma commented on PR #8483:
URL: https://github.com/apache/hbase/pull/8483#issuecomment-5435035986
> Hi @Sigma-Ma, apologies for the delay on this PR. I don't see an option to enable the Github Action, maybe it was idle for too long. Could you do a force push? Hopefully that will help.
Thanks @petersomogyi. I applied the suggestion, amended the commit.
Could you please check whether the GitHub Actions approval option is available now?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup [hbase]
Posted by "petersomogyi (via GitHub)" <gi...@apache.org>.
petersomogyi commented on PR #8483:
URL: https://github.com/apache/hbase/pull/8483#issuecomment-5439707241
A rerun of wave3 was successful.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup [hbase]
Posted by "Sigma-Ma (via GitHub)" <gi...@apache.org>.
Sigma-Ma commented on PR #8483:
URL: https://github.com/apache/hbase/pull/8483#issuecomment-5041537661
Hi @liuxiaocs7, sorry for the direct ping. Could you please help approve the fork workflows for this PR, or suggest an appropriate reviewer, when convenient? The original reproducer has been verified successfully. Thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup [hbase]
Posted by "Sigma-Ma (via GitHub)" <gi...@apache.org>.
Sigma-Ma commented on PR #8483:
URL: https://github.com/apache/hbase/pull/8483#issuecomment-5174072540
Hi @wchevreuil and @ndimiduk, could you please take a look at this PR when convenient?
This patch fixes the RegionServer startup race reported in HBASE-30099. During RegionServer initialization, `getBootstrapNodes()` may be called before `BootstrapNodeManager` has been created, which currently results in an NPE.
The proposed fix makes the RPC return an empty bootstrap-node list during this short initialization window. Once `BootstrapNodeManager` is initialized, the existing behavior remains unchanged. A regression test has also been added to cover the RPC call before manager initialization.
@ndimiduk, since you reported HBASE-30099, it would also be helpful if you could confirm whether returning an empty list during startup matches the expected behavior.
The PR is currently mergeable and has not received a review yet. If the forked GitHub Actions workflows still require approval, could a committer please approve them as well?
Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup [hbase]
Posted by "petersomogyi (via GitHub)" <gi...@apache.org>.
petersomogyi commented on code in PR #8483:
URL: https://github.com/apache/hbase/pull/8483#discussion_r3863473338
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java:
##########
@@ -3729,7 +3729,10 @@ public List<ServerName> getBackupMasters() {
@Override
public Iterator<ServerName> getBootstrapNodes() {
- return bootstrapNodeManager.getBootstrapNodes().iterator();
+ BootstrapNodeManager manager = bootstrapNodeManager;
+ return manager != null
+ ? manager.getBootstrapNodes().iterator()
+ : Collections.<ServerName> emptyList().iterator();
Review Comment:
```suggestion
: Collections.emptyIterator();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup [hbase]
Posted by "Sigma-Ma (via GitHub)" <gi...@apache.org>.
Sigma-Ma commented on PR #8483:
URL: https://github.com/apache/hbase/pull/8483#issuecomment-5438521345
Hi @petersomogyi. The remaining failure looks unrelated to this patch. TestSyncReplicationStandbyKillMaster failed in the large-wave-3 shard because the RegionServer still reported the peer as STANDBY after the transition, and the retries then ran into stale mini-cluster state.
The General Check, Compile Check, and the other four unit-test shards all passed. Could you please rerun the failed job when you have a chance?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup [hbase]
Posted by "petersomogyi (via GitHub)" <gi...@apache.org>.
petersomogyi commented on PR #8483:
URL: https://github.com/apache/hbase/pull/8483#issuecomment-5426237100
Hi @Sigma-Ma, apologies for the delay on this PR. I don't see an option to enable the Github Action, maybe it was idle for too long. Could you do a force push? Hopefully that will help.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup [hbase]
Posted by "Sigma-Ma (via GitHub)" <gi...@apache.org>.
Sigma-Ma commented on code in PR #8483:
URL: https://github.com/apache/hbase/pull/8483#discussion_r3869129939
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java:
##########
@@ -3729,7 +3729,10 @@ public List<ServerName> getBackupMasters() {
@Override
public Iterator<ServerName> getBootstrapNodes() {
- return bootstrapNodeManager.getBootstrapNodes().iterator();
+ BootstrapNodeManager manager = bootstrapNodeManager;
+ return manager != null
+ ? manager.getBootstrapNodes().iterator()
+ : Collections.<ServerName> emptyList().iterator();
Review Comment:
Done, thanks. Changed it to Collections.emptyIterator().
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup [hbase]
Posted by "petersomogyi (via GitHub)" <gi...@apache.org>.
petersomogyi merged PR #8483:
URL: https://github.com/apache/hbase/pull/8483
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org