rahil-c commented on code in PR #13735:
URL: https://github.com/apache/hudi/pull/13735#discussion_r2366286833


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/UpgradeDowngrade.java:
##########
@@ -99,43 +96,49 @@ public static boolean needsDowngrade(HoodieTableVersion 
fromTableVersion, Hoodie
     return toWriteVersion.lesserThan(fromTableVersion);
   }
 
-  public static boolean needsUpgrade(HoodieTableMetaClient metaClient, 
HoodieWriteConfig config, HoodieTableVersion toWriteVersion) {
+  public static boolean needsUpgrade(HoodieTableMetaClient metaClient,
+                                     HoodieWriteConfig config,
+                                     HoodieTableVersion toVersion) {
     HoodieTableVersion fromTableVersion = 
metaClient.getTableConfig().getTableVersion();
-    if (fromTableVersion.greaterThan(toWriteVersion)) {
-      LOG.warn("Table version {} is greater than write version {}. No upgrade 
needed", fromTableVersion, toWriteVersion);
-      return false;
-    }
-    if (fromTableVersion.equals(toWriteVersion)) {
-      // table version is same as write version, no upgrade needed
-      return false;
-    }
-    if (fromTableVersion.lesserThan(HoodieTableVersion.SIX)) {
-      throw new HoodieUpgradeDowngradeException(
-          String.format("Hudi 1.x release only supports table version greater 
than "
-                  + "version 6 or above. Please upgrade table from version %s 
to %s "
-                  + "using a Hudi release prior to 1.0.0",
-              fromTableVersion.versionCode(), 
HoodieTableVersion.SIX.versionCode()));
+    boolean shouldUpgrade = true;
+    if (fromTableVersion.greaterThanOrEquals(toVersion)) {
+      LOG.warn("Table version {} is greater than write version {}. No upgrade 
needed",

Review Comment:
   Two things on this. 
   
   1. I think the log statement in this message only encapsulates if its 
greater than, even though condition is >=.
   
   2. I think originally we had this as >= condition but the issue we noticed 
was that alot of noisy logs were printed when tables were on same version, as 
reported by @the-other-tim-brown.
   
   Hence we decided to separate the conditions out 
https://github.com/apache/hudi/commit/697155863ebb82ab04032cef8e8fefb7eee4ba4d#diff-85f236185ab1232dc315e0bcf515b72068d801a78d297cc70aef93e75eeea800R104-R105,
 so that we only log when its greater than.
   
   So thinking we should keep them as two separate conditions



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