Skip to content

HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup - #8483

Merged
petersomogyi merged 1 commit into
apache:masterfrom
Sigma-Ma:HBASE-30099-bootstrap-nodes-startup
Aug 27, 2026
Merged

HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup#8483
petersomogyi merged 1 commit into
apache:masterfrom
Sigma-Ma:HBASE-30099-bootstrap-nodes-startup

Conversation

@Sigma-Ma

@Sigma-Ma Sigma-Ma commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

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?

mvn -pl hbase-server -am \
  -Dtest=TestBootstrapNodeManager \
  -Dsurefire.failIfNoSpecifiedTests=false \
  -DskipITs \
  test

@Sigma-Ma

Copy link
Copy Markdown
Contributor Author

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.

@Sigma-Ma

Copy link
Copy Markdown
Contributor Author

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!

@Sigma-Ma

Sigma-Ma commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

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!

@petersomogyi

Copy link
Copy Markdown
Contributor

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.

@Sigma-Ma
Sigma-Ma force-pushed the HBASE-30099-bootstrap-nodes-startup branch from 627dbaf to 8409f92 Compare August 27, 2026 05:57
@Sigma-Ma

Copy link
Copy Markdown
Contributor Author

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?

@Sigma-Ma
Sigma-Ma force-pushed the HBASE-30099-bootstrap-nodes-startup branch from 8409f92 to e1666af Compare August 27, 2026 09:03
@Sigma-Ma

Copy link
Copy Markdown
Contributor Author

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?

@petersomogyi

Copy link
Copy Markdown
Contributor

A rerun of wave3 was successful.

@petersomogyi
petersomogyi merged commit df76c46 into apache:master Aug 27, 2026
12 of 13 checks passed
petersomogyi pushed a commit that referenced this pull request Aug 27, 2026
…up (#8483)

Co-authored-by: mazhengxuan <mazhengxuan@didiglobal.com>
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
(cherry picked from commit df76c46)
petersomogyi pushed a commit that referenced this pull request Aug 27, 2026
…up (#8483)

Co-authored-by: mazhengxuan <mazhengxuan@didiglobal.com>
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
(cherry picked from commit df76c46)
petersomogyi pushed a commit that referenced this pull request Aug 27, 2026
…up (#8483)

Co-authored-by: mazhengxuan <mazhengxuan@didiglobal.com>
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
(cherry picked from commit df76c46)
petersomogyi pushed a commit that referenced this pull request Aug 27, 2026
…up (#8483)

Co-authored-by: mazhengxuan <mazhengxuan@didiglobal.com>
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
(cherry picked from commit df76c46)
@Sigma-Ma
Sigma-Ma deleted the HBASE-30099-bootstrap-nodes-startup branch August 28, 2026 14:09
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.

2 participants