huaxiangsun commented on a change in pull request #1584:
URL: https://github.com/apache/hbase/pull/1584#discussion_r414916643
##########
File path:
hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
##########
@@ -1846,6 +1846,16 @@ public static void deleteMergeQualifiers(Connection
connection, final RegionInfo
qualifiers.add(qualifier);
delete.addColumns(getCatalogFamily(), qualifier,
HConstants.LATEST_TIMESTAMP);
}
+
+ // There will be race condition that a GCMultipleMergedRegionsProcedure is
scheduled while
+ // the previous GCMultipleMergedRegionsProcedure is still going on, in
this case, the second
+ // GCMultipleMergedRegionsProcedure could delete the merged region by
accident!
+ if (qualifiers.isEmpty()) {
Review comment:
Thanks Stack, where to add the lock? More context here, this issue was
found with the extra frequent calling of CatalogJanitor.scan() in
TestMetaFixer#testOverlap(). It finds merged regions in meta table and fires
GCMultipleMergedRegionsProcedure to gc these regions. The second scan() could
find the same set of merged regions in meta and keep firing
GCMultipleMergedRegionsProcedures. So the first
GCMultipleMergedRegionsProcedure cleans up merge qualifiers and the following
one will delete the new merged region from meta table, this will result in a
hole.
If we maintain a locks in Catalog Janitor, then it needs to wait for
GCMultipleMergedRegionsProcedures and unlocks the region, this will make scan()
very slow. What do you think?
----------------------------------------------------------------
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]