wchevreuil commented on code in PR #5939:
URL: https://github.com/apache/hbase/pull/5939#discussion_r1775058358


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/janitor/CatalogJanitor.java:
##########
@@ -422,7 +426,16 @@ private static Pair<Boolean, Boolean> 
checkRegionReferences(MasterServices servi
     try {
       HRegionFileSystem regionFs = HRegionFileSystem
         .openRegionFromFileSystem(services.getConfiguration(), fs, tabledir, 
region, true);
-      boolean references = regionFs.hasReferences(tableDescriptor);
+      ColumnFamilyDescriptor[] families = tableDescriptor.getColumnFamilies();
+      boolean references = false;
+      for (ColumnFamilyDescriptor cfd : families) {
+        StoreFileTracker sft = 
StoreFileTrackerFactory.create(services.getConfiguration(),
+          tableDescriptor, 
ColumnFamilyDescriptorBuilder.of(cfd.getNameAsString()), regionFs);
+        references = references || sft.hasReferences();
+        if (references) {
+          break;
+        }
+      }

Review Comment:
   I was looking at the `FileBasedStoreFileTracker` code. Whenever compaction 
or flush happens, we rotate the meta file as we call 
`FileBasedStoreFileTracker.update`, and then we also update the map of store 
files within this `FileBasedStoreFileTracker` instance. At this point, any 
other existing `FileBasedStoreFileTracker` instance for this same store should 
reload the store files, otherwise the store files map on those instances would 
be outdated. For SFT instances on read replicas, that's not a problem because 
we signal these events in the wal, so the read replicas would know they need to 
do a reload in their SFT instances.



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