apurtell commented on code in PR #8264:
URL: https://github.com/apache/hbase/pull/8264#discussion_r3326557715
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManagerUtil.java:
##########
@@ -298,4 +299,16 @@ static void checkClosedRegion(MasterProcedureEnv env,
RegionInfo regionInfo) thr
+ ", abort split/merge to prevent data loss");
}
}
+
+ /**
+ * For splitting, need to test both region info and state, and will return
true if either of the
+ * test returns true. Please see the comments in
+ * {@link AssignmentManager#markRegionAsSplit(RegionInfo, ServerName,
RegionInfo, RegionInfo)} for
+ * more details on why we need to test two conditions.
+ */
+ static boolean isSplitOrMerged(RegionStateNode regionStateNode) {
Review Comment:
An AI assisted review finds:
This check `isSplitOrMerged` has been moved out of `regionCrashed` , where
it formerly guarded calls to both `visitRegionState` and
`markRegionsAsCrashed`. After this refactor, now only `visitRegionState` is
guarded. A split parent in `SPLIT` state whose location is still equal to the
crashed server (the parent stays in `regionStates` in this state until the
catalog janitor cleans it) will now be processed in `regionCrashed` when this
didn't used to be possible.
Recommendation:
Add `& !AssignmentManagerUtil.isSplitOrMerged(node)` to the `if
(crashedServerName.equals(node.getRegionLocation()))` branch in
`markRegionsAsCrashed`, just like the same check guard `visitRegionState`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]