guanziyue commented on code in PR #9523:
URL: https://github.com/apache/hudi/pull/9523#discussion_r1305098875


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/MarkerBasedRollbackStrategy.java:
##########
@@ -103,35 +120,47 @@ public List<HoodieRollbackRequest> 
getRollbackRequests(HoodieInstant instantToRo
     }
   }
 
-  protected HoodieRollbackRequest getRollbackRequestForAppend(HoodieInstant 
instantToRollback, String markerFilePath) throws IOException {
-    Path baseFilePathForAppend = new Path(basePath, markerFilePath);
-    String fileId = FSUtils.getFileIdFromFilePath(baseFilePathForAppend);
-    String baseCommitTime = 
FSUtils.getCommitTime(baseFilePathForAppend.getName());
-    String relativePartitionPath = FSUtils.getRelativePartitionPath(new 
Path(basePath), baseFilePathForAppend.getParent());
-    Path partitionPath = FSUtils.getPartitionPath(config.getBasePath(), 
relativePartitionPath);
-
-    // NOTE: Since we're rolling back incomplete Delta Commit, it only could 
have appended its
-    //       block to the latest log-file
-    // TODO(HUDI-1517) use provided marker-file's path instead
-    Option<HoodieLogFile> latestLogFileOption = 
FSUtils.getLatestLogFile(table.getMetaClient().getFs(), partitionPath, fileId,
-        HoodieFileFormat.HOODIE_LOG.getFileExtension(), baseCommitTime);
-
-    // Log file can be deleted if the commit to rollback is also the commit 
that created the fileGroup
-    if (latestLogFileOption.isPresent() && 
baseCommitTime.equals(instantToRollback.getTimestamp())) {
-      Path fullDeletePath = new Path(partitionPath, 
latestLogFileOption.get().getFileName());
-      return new HoodieRollbackRequest(relativePartitionPath, EMPTY_STRING, 
EMPTY_STRING,
-          Collections.singletonList(fullDeletePath.toString()),
-          Collections.emptyMap());
+  protected HoodieRollbackRequest getRollbackRequestForAppend(String 
markerFilePath) throws IOException {
+    Path filePath = new Path(basePath, markerFilePath);
+    String fileId;
+    String baseCommitTime;
+    String relativePartitionPath;
+    Option<HoodieLogFile> latestLogFileOption;
+
+    // Old marker files may be generated from base file name before HUDI-1517. 
keep compatible with them.
+    // TODO: deprecated in HUDI-1517, may be removed in the future. 
@guanziyue.gzy
+    if (FSUtils.isBaseFile(filePath)) {

Review Comment:
   Yes. But it is also a good idea to do this in upgrade and downgrade. I do 
this because I have no chance to test upgrade or downgrade with real data at 
that time. If you prefer that way, I can change it.



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to