Apache9 commented on a change in pull request #2889:
URL: https://github.com/apache/hbase/pull/2889#discussion_r562404279



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
##########
@@ -921,8 +921,10 @@ public boolean isClusterShutdown() {
   public void startChore() {
     Configuration c = master.getConfiguration();
     if (persistFlushedSequenceId) {
-      // when reach here, RegionStates should loaded, firstly, we call remove 
deleted regions
-      removeDeletedRegionFromLoadedFlushedSequenceIds();
+      new Thread(() -> {

Review comment:
       I think the problem here is that, we are in an initialization process 
when calling removeDeletedRegionFromLoadedFlushedSequenceIds, so it is safe to 
check regionStates, and then delete regions in flushedSequenceIdByRegion and 
storeFlushedSequenceIdsByRegion. If we do this in a background thread, after 
initializing, HMaster could change regionStates at the same time, is it 
possible that we think the region is not exists when checking regionState but 
then it is added back?
   Maybe it is impossible as a new region should never be flushed before adding 
into the regionState? Anyway, let's add more comments here to tell later 
developers that executing it in background is safe.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to