From 0fc6852f6a84397fbb6251c96f6847d7deba00bd Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Tue, 4 May 2021 10:05:29 -0700 Subject: [PATCH] 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 Signed-off-by: Viraj Jasani Signed-off-by: Pankaj --- .../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 107330d90b4..daa1457b9cd 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) {