liuxiaocs7 commented on code in PR #7830:
URL: https://github.com/apache/hbase/pull/7830#discussion_r3139827782


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionInTransitionTracker.java:
##########
@@ -131,15 +137,29 @@ public void handleRegionDelete(RegionInfo regionInfo) {
   }
 
   private boolean addRegionInTransition(final RegionStateNode regionStateNode) 
{
-    return regionInTransition.putIfAbsent(regionStateNode.getRegionInfo(), 
regionStateNode) == null;
+    boolean added =
+      regionInTransition.putIfAbsent(regionStateNode.getRegionInfo(), 
regionStateNode) == null;
+    if (added) {
+      regionEnterTimestamp.putIfAbsent(regionStateNode.getRegionInfo(),
+        EnvironmentEdgeManager.currentTime());
+    }
+    return added;
   }
 
   private boolean removeRegionInTransition(final RegionInfo regionInfo) {
-    return regionInTransition.remove(regionInfo) != null;
+    boolean removed = regionInTransition.remove(regionInfo) != null;
+    if (removed) {
+      Long enter = regionEnterTimestamp.remove(regionInfo);

Review Comment:
   Now we use `ConcurrentHashMap<RegionInfo, Pair<RegionStateNode, Long>> 
regionInTransition` instead, both the state node and enter timestamp
     are stored in the same map entry, so a single remove clears both together



-- 
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]

Reply via email to