linliu-code commented on code in PR #13642:
URL: https://github.com/apache/hudi/pull/13642#discussion_r2254727997


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/UpgradeDowngrade.java:
##########
@@ -130,6 +145,25 @@ public boolean needsUpgrade(HoodieTableVersion 
toWriteVersion) {
    * @param instantTime current instant time that should not be touched.
    */
   public void run(HoodieTableVersion toVersion, String instantTime) {
+    // Fetch version from property file and current version
+    HoodieTableVersion fromVersion = 
metaClient.getTableConfig().getTableVersion();
+    // Determine if we are upgrading or downgrading
+    boolean isUpgrade = fromVersion.versionCode() < toVersion.versionCode();
+    if (isUpgrade && !config.autoUpgrade()) {
+      // if we are attempting to upgrade and auto-upgrade is disabled
+      // we set the write config table version to bounded by the current hudi 
table version
+      // and then exit out the upgrade process
+      LOG.warn("AUTO_UPGRADE_VERSION was explicitly disabled, skipping table 
version upgrade process");

Review Comment:
   Based on the this behavior, should we rename `autoUpgrade` to 
`upgradeAllowed` or `upgradeEnabled`? I am confused by `auto` here. do we have 
`manual` upgrade?



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