Apache9 commented on PR #8700:
URL: https://github.com/apache/hbase/pull/8700#issuecomment-5882705340

   > > I think we have the same problem for mergeRegions method? We should also 
record the MERGED state for the merge parent regions I suppose.
   > 
   > for MERGED, we should be safe.
   > 
   > when merging, we write a tombstone to the regionInfo 
([code](https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateStore.java#L425)),
 so if the hmaster rolls and we need to construct the state from meta, the 
region gets ignored.
   > 
   > we also set the state to `CLOSED` to explicitly avoid this issue. 
[code](https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateStore.java#L435C4-L441C33)
   > 
   > ```
   >  // Set initial state to CLOSED.
   >     // NOTE: If initial state is not set to CLOSED then merged region gets 
added with the
   >     // default OFFLINE state. If Master gets restarted after this step, 
start up sequence of
   >     // master tries to assign this offline region. This is followed by 
re-assignments of the
   >     // merged region from resumed {@link MergeTableRegionsProcedure}
   >     MetaTableAccessor.addRegionStateToPut(putOfMerged, 
RegionInfo.DEFAULT_REPLICA_ID,
   >       RegionState.State.CLOSED);
   > ```
   > 
   > in the split case, the meta state was CLOSED but because the regionInfo 
had the `offline=true` flag set, it still got assigned as an offline region. 
that won't happen in the MERGED case.
   > 
   > we could persist the state as MERGED to the meta for consistency in 
"terminal states are saved to the meta" but as far as i can tell, it shouldn't 
change the existing logic. i don't have strong opinions either way, so defer to 
your preference here!
   
   The code you list in mergeRegions is for setting state to CLOSED for the 
merged child region, not the parents. In split we did the same thing for the 
split children.
   But for merging, we just delete the parent regions from meta, but for split 
the region is still there, this is the difference I believe.


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