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

apurtell 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 0fc6852  HBASE-25835 Ignore duplicate split requests from regionserver 
reports (#3218)
0fc6852 is described below

commit 0fc6852f6a84397fbb6251c96f6847d7deba00bd
Author: Andrew Purtell <apurt...@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 <bhara...@apache.org>
    Signed-off-by: Viraj Jasani <vjas...@apache.org>
    Signed-off-by: Pankaj <pankajku...@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) {

Reply via email to