You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2021/05/04 18:27:41 UTC

[hbase] branch branch-2 updated: HBASE-25835 Ignore duplicate split requests from regionserver reports (#3218)

This is an automated email from the ASF dual-hosted git repository.

apurtell pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new 36994a2  HBASE-25835 Ignore duplicate split requests from regionserver reports (#3218)
36994a2 is described below

commit 36994a2c5ecc56c80f512e8b7aaa00a209161627
Author: Andrew Purtell <ap...@apache.org>
AuthorDate: Tue May 4 10:05:29 2021 -0700

    HBASE-25835 Ignore duplicate split requests from regionserver reports (#3218)
    
    Processing of the RS report happens asynchronously from other activities
    which can mutate region state. For example, a split procedure may already
    be running. A split procedure cannot succeed if the parent region is no
    longer open, so we can ignore it in that case.
    
    Note that submitting more than one split procedure for a given region is
    harmless -- the split is fenced in the procedure handling -- but it would
    be noisy in the logs. Only one procedure can succeed. The other
    procedure(s) would abort during initialization and report failure with
    WARN level logging.
    
    Signed-off-by: Bharath Vissapragada <bh...@apache.org>
    Signed-off-by: Viraj Jasani <vj...@apache.org>
    Signed-off-by: Pankaj <pa...@apache.org>
---
 .../hbase/master/assignment/AssignmentManager.java     | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
index 107330d..daa1457 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
@@ -1119,7 +1119,23 @@ public class AssignmentManager {
       LOG.debug("Split request from " + serverName +
           ", parent=" + parent + " splitKey=" + Bytes.toStringBinary(splitKey));
     }
-    master.getMasterProcedureExecutor().submitProcedure(createSplitProcedure(parent, splitKey));
+    // Processing this report happens asynchronously from other activities which can mutate
+    // the region state. For example, a split procedure may already be running for this parent.
+    // A split procedure cannot succeed if the parent region is no longer open, so we can
+    // ignore it in that case.
+    // Note that submitting more than one split procedure for a given region is
+    // harmless -- the split is fenced in the procedure handling -- but it would be noisy in
+    // the logs. Only one procedure can succeed. The other procedure(s) would abort during
+    // initialization and report failure with WARN level logging.
+    RegionState parentState = regionStates.getRegionState(parent);
+    if (parentState != null && parentState.isOpened()) {
+      master.getMasterProcedureExecutor().submitProcedure(createSplitProcedure(parent,
+        splitKey));
+    } else {
+      LOG.info("Ignoring split request from " + serverName +
+        ", parent=" + parent + " because parent is unknown or not open");
+      return;
+    }
 
     // If the RS is < 2.0 throw an exception to abort the operation, we are handling the split
     if (master.getServerManager().getVersionNumber(serverName) < 0x0200000) {