You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2026/06/29 07:42:27 UTC
(hbase) branch branch-3 updated: HBASE-24923 Fixing missed InitMetaProcedures if Hmaster startup happens after meta assign (#8428)
This is an automated email from the ASF dual-hosted git repository.
Apache9 pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-3 by this push:
new d327dec726b HBASE-24923 Fixing missed InitMetaProcedures if Hmaster startup happens after meta assign (#8428)
d327dec726b is described below
commit d327dec726ba3854476c82c2eb84e91f94d02306
Author: Swara <40...@users.noreply.github.com>
AuthorDate: Mon Jun 29 13:07:34 2026 +0530
HBASE-24923 Fixing missed InitMetaProcedures if Hmaster startup happens after meta assign (#8428)
Signed-off-by: Duo Zhang <zh...@apache.org>
(cherry picked from commit e1af5a8783a80f364aa0fff6165c1425e044d520)
---
.../org/apache/hadoop/hbase/master/HMaster.java | 28 ++++++++++++++--------
1 file changed, 18 insertions(+), 10 deletions(-)
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 4128b48f791..c8e70db5b94 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
@@ -1097,16 +1097,24 @@ public class HMaster extends HBaseServerBase<MasterRpcServices> implements Maste
// Checking if meta needs initializing.
startupTaskGroup.addTask("Initializing meta table if this is a new deploy");
InitMetaProcedure initMetaProc = null;
- // Print out state of hbase:meta on startup; helps debugging.
- if (!this.assignmentManager.getRegionStates().hasTableRegionStates(TableName.META_TABLE_NAME)) {
- Optional<InitMetaProcedure> optProc = procedureExecutor.getProcedures().stream()
- .filter(p -> p instanceof InitMetaProcedure).map(o -> (InitMetaProcedure) o).findAny();
- initMetaProc = optProc.orElseGet(() -> {
- // schedule an init meta procedure if meta has not been deployed yet
- InitMetaProcedure temp = new InitMetaProcedure();
- procedureExecutor.submitProcedure(temp);
- return temp;
- });
+
+ // Always look for an already-running InitMetaProcedure first. Once such a procedure has passed
+ // the INIT_META_ASSIGN_META state, a RegionState for meta exists, so guarding this lookup with
+ // hasTableRegionStates would hide a still-running procedure, and we would skip awaiting it.
+ // Filter out finished procedures: getProcedures() also returns completed procedures reloaded
+ // from the procedure store, and awaiting such a procedure would block forever because its
+ // completion latch is reset to 1 on deserialization and never counted down again.
+ Optional<InitMetaProcedure> optProc = procedureExecutor.getProcedures().stream()
+ .filter(p -> p instanceof InitMetaProcedure && !p.isFinished())
+ .map(o -> (InitMetaProcedure) o).findAny();
+ if (optProc.isPresent()) {
+ initMetaProc = optProc.get();
+ } else if (
+ !this.assignmentManager.getRegionStates().hasTableRegionStates(TableName.META_TABLE_NAME)
+ ) {
+ // schedule an init meta procedure if meta has not been deployed yet
+ initMetaProc = new InitMetaProcedure();
+ procedureExecutor.submitProcedure(initMetaProc);
}
// initialize load balancer