nsivabalan commented on code in PR #5535:
URL: https://github.com/apache/hudi/pull/5535#discussion_r871273066


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -1558,13 +1558,15 @@ private void tryUpgrade(HoodieTableMetaClient 
metaClient, Option<String> instant
         new UpgradeDowngrade(metaClient, config, context, 
upgradeDowngradeHelper);
 
     if 
(upgradeDowngrade.needsUpgradeOrDowngrade(HoodieTableVersion.current())) {
-      // Ensure no inflight commits by setting EAGER policy and explicitly 
cleaning all failed commits
-      List<String> instantsToRollback = getInstantsToRollback(metaClient, 
HoodieFailedWritesCleaningPolicy.EAGER, instantTime);
+      if 
(config.getWriteConcurrencyMode().supportsOptimisticConcurrencyControl()) {
+        // Ensure no inflight commits by setting EAGER policy and explicitly 
cleaning all failed commits
+        List<String> instantsToRollback = getInstantsToRollback(metaClient, 
HoodieFailedWritesCleaningPolicy.EAGER, instantTime);
 
-      Map<String, Option<HoodiePendingRollbackInfo>> pendingRollbacks = 
getPendingRollbackInfos(metaClient);
-      instantsToRollback.forEach(entry -> pendingRollbacks.putIfAbsent(entry, 
Option.empty()));
+        Map<String, Option<HoodiePendingRollbackInfo>> pendingRollbacks = 
getPendingRollbackInfos(metaClient);
+        instantsToRollback.forEach(entry -> 
pendingRollbacks.putIfAbsent(entry, Option.empty()));

Review Comment:
   hey @danny0405 : I am confused as to whats the regression here. I thought 
this is more of an optimization. From your first comment "While in 
https://github.com/apache/hudi/pull/4114, the pre-condition was removed, which 
i think is a regression because we already do the rollback when starting new 
instant/commit before write. In single writer mode, there is no need to do 
redundant rollback again before upgrade."
   
   can you help me understand why would be do redundant rollback. once we 
rolledback a given commit, next time if we check if something needs to be 
rolled back, the same partially failed commit should not appear right. I mean, 
if the rollback was complete the first time, it should be be part of the list 
of commits to rollback the 2nd time right. or am I missing something here. 
   



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