taklwu commented on code in PR #7474:
URL: https://github.com/apache/hbase/pull/7474#discussion_r2612097480


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java:
##########
@@ -3116,16 +3116,9 @@ public ClusterMetrics 
getClusterMetricsWithoutCoprocessor(EnumSet<Option> option
           if (isActiveMaster() && isInitialized() && assignmentManager != 
null) {
             try {
               Map<TableName, RegionStatesCount> tableRegionStatesCountMap = 
new HashMap<>();
-              Map<String, TableDescriptor> tableDescriptorMap = 
getTableDescriptors().getAll();
-              for (TableDescriptor tableDescriptor : 
tableDescriptorMap.values()) {
+              List<TableDescriptor> tableDescriptors = 
listTableDescriptors(null, null, null, true);
+              for (TableDescriptor tableDescriptor : tableDescriptors) {

Review Comment:
   you probably clean my concern that we're comparing the meta state in 
`tableStateManager` vs the table descriptor found on the filesystem. 
   
   just again the unit test is doing slightly different, it called 
`master.getTableDescriptors().update(foreignTableDescriptor, true)` to update 
the `cache` of the `tableDescriptors`/`FSTableDescriptors` (not the 
TableDescriptors on actual file system) with the additional tables, and then 
compare with the `tableStateManager` when `TABLE_TO_REGIONS_COUNT` hook is 
being called. I should have used debug mode to clear the confusion that the  
`FSTableDescriptors.getAll()` in the unit test are reading from cache or 
filesystem.



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