yihua commented on code in PR #13007:
URL: https://github.com/apache/hudi/pull/13007#discussion_r2017336839


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/BaseRollbackActionExecutor.java:
##########
@@ -241,7 +247,9 @@ public List<HoodieRollbackStat> 
doRollbackAndGetStats(HoodieRollbackPlan hoodieR
    * @return list of {@link HoodieRollbackStat}s.
    */
   protected List<HoodieRollbackStat> executeRollback(HoodieInstant 
instantToRollback, HoodieRollbackPlan rollbackPlan) {
-    return new BaseRollbackHelper(table.getMetaClient(), 
config).performRollback(context, instantToRollback, 
rollbackPlan.getRollbackRequests());
+    return table.version().lesserThan(HoodieTableVersion.EIGHT)
+        ? new BaseRollbackHelperTableVersionSix(table, 
config).performRollback(context, instantTime, instantToRollback, 
rollbackPlan.getRollbackRequests())
+        : new BaseRollbackHelper(table.getMetaClient(), 
config).performRollback(context, instantToRollback, 
rollbackPlan.getRollbackRequests());

Review Comment:
   Could we fold the table version check into `BaseRollbackHelper` instead of 
here?



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/BaseRollbackActionExecutor.java:
##########
@@ -123,6 +124,11 @@ private HoodieRollbackMetadata runRollback(HoodieTable<T, 
I, K, O> table, Hoodie
     // Finally, remove the markers post rollback.
     WriteMarkersFactory.get(config.getMarkersType(), table, 
instantToRollback.requestedTime())
         .quietDeleteMarkerDir(context, config.getMarkersDeleteParallelism());
+    if 
(table.getMetaClient().getTableConfig().getTableVersion().lesserThan(HoodieTableVersion.EIGHT))
 {
+      // For MOR table rollbacks, rollback command blocks might generate 
markers under rollback instant. So, lets clean up the markers if any.
+      WriteMarkersFactory.get(config.getMarkersType(), table, 
rollbackInstant.requestedTime())
+          .quietDeleteMarkerDir(context, config.getMarkersDeleteParallelism());

Review Comment:
   This is already done as part of L125 in this class.  What's the reason of 
adding this?



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