nbalajee commented on code in PR #18279:
URL: https://github.com/apache/hudi/pull/18279#discussion_r2940355561


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/RollbackHelper.java:
##########
@@ -169,13 +185,17 @@ List<Pair<String, HoodieRollbackStat>> 
maybeDeleteAndCollectStats(HoodieEngineCo
           }
         }
 
-        // This step is intentionally done after writer is closed. Guarantees 
that
-        // getFileStatus would reflect correct stats and FileNotFoundException 
is not thrown in
-        // cloud-storage : HUDI-168
-        Map<StoragePathInfo, Long> filesToNumBlocksRollback = 
Collections.singletonMap(
-            
metaClient.getStorage().getPathInfo(Objects.requireNonNull(filePath)),
-            1L
-        );
+        Map<StoragePathInfo, Long> filesToNumBlocksRollback;
+        if (fileSizeCaptured) {
+          filesToNumBlocksRollback = Collections.singletonMap(
+              new StoragePathInfo(Objects.requireNonNull(filePath), fileSize, 
false, (short) 0, 0, 0), 1L);
+        } else {
+          // This step is intentionally done after writer is closed. 
Guarantees that
+          // getFileStatus would reflect correct stats and 
FileNotFoundException is not thrown in

Review Comment:
   I will update the comment here.   Depending on whether doDelete flag is true 
or false the storage size is set in memory.  (doDelete = true : rollback block 
appended and size updated;  doDelete = false: no rollback block was appended 
and in memory size not updated). 
   
   This is  required with updated comment.



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