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



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/region/MasterRegion.java
##########
@@ -287,6 +303,39 @@ private static void replayWALs(Configuration conf, 
FileSystem walFs, Path walRoo
     }
   }
 
+  private static void tryMigrate(Configuration conf, FileSystem fs, Path 
tableDir,
+    RegionInfo regionInfo, TableDescriptor oldTd, TableDescriptor newTd) 
throws IOException {
+    Class<? extends StoreFileTracker> oldSft =
+      
StoreFileTrackerFactory.getTrackerClass(oldTd.getValue(StoreFileTrackerFactory.TRACKER_IMPL));
+    Class<? extends StoreFileTracker> newSft =
+      
StoreFileTrackerFactory.getTrackerClass(newTd.getValue(StoreFileTrackerFactory.TRACKER_IMPL));
+    if (oldSft.equals(newSft)) {
+      LOG.debug("old store file tracker {} is the same with new store file 
tracker, skip migration",
+        StoreFileTrackerFactory.getStoreFileTrackerName(oldSft));
+      if (!oldSft.equals(newSft)) {
+        // we may change other things such as adding a new family, so here we 
still need to persist
+        // the new table descriptor
+        LOG.info("Update table descriptor from {} to {}", oldTd, newTd);
+        FSTableDescriptors.createTableDescriptorForTableDirectory(fs, 
tableDir, newTd, true);
+      }

Review comment:
       Ah, typo, it should be `!oldTd.equals(newTd)`
   
   Thanks for the careful review!




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