This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.4 by this push:
new 736595fe99a HBASE-28109 NPE for the region state: Failed to become
active master (HMaster) (#5432)
736595fe99a is described below
commit 736595fe99a58f8c94c67d696a6ba79c94b8d7e5
Author: Ke Han <[email protected]>
AuthorDate: Sat Oct 7 02:50:24 2023 -0400
HBASE-28109 NPE for the region state: Failed to become active master
(HMaster) (#5432)
The RegionState for meta region could be null for a fresh new cluster, we
should also wait a bit to let it finish the initialization.
Signed-off-by: Duo Zhang <[email protected]>
(cherry picked from commit 865a59547b3058100c834a28b29ea3e10839f8e3)
---
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index 3e03cbfda09..ddd9761f772 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -1226,7 +1226,7 @@ public class HMaster extends HRegionServer implements
MasterServices {
RetryCounter rc = null;
while (!isStopped()) {
RegionState rs =
this.assignmentManager.getRegionStates().getRegionState(ri);
- if (rs.isOpened()) {
+ if (rs != null && rs.isOpened()) {
if (this.getServerManager().isServerOnline(rs.getServerName())) {
return true;
}