bvaradar commented on code in PR #7865: URL: https://github.com/apache/hudi/pull/7865#discussion_r1109280858
########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/clean/CleanPlanner.java: ########## @@ -101,6 +102,16 @@ public CleanPlanner(HoodieEngineContext context, HoodieTable<T, I, K, O> hoodieT this.fgIdToPendingLogCompactionOperations = fileSystemView.getPendingLogCompactionOperations() .map(entry -> Pair.of(new HoodieFileGroupId(entry.getValue().getPartitionPath(), entry.getValue().getFileId()), entry.getValue())) .collect(Collectors.toMap(Pair::getKey, Pair::getValue)); + + // load all partitions in advance if necessary. + if (config.isMetadataTableEnabled() + && config.getCleanerPolicy().equals(HoodieCleaningPolicy.KEEP_LATEST_FILE_VERSIONS) + && (config.getViewStorageConfig().getStorageType().equals(FileSystemViewStorageType.MEMORY) + || (config.getViewStorageConfig().getStorageType().equals(FileSystemViewStorageType.REMOTE_FIRST) + && config.getViewStorageConfig().getSecondaryStorageType().equals(FileSystemViewStorageType.MEMORY)))) { + LOG.info("Load all partitions and files into file system view in advance when using KEEP_LATEST_FILE_VERSIONS."); + fileSystemView.loadAllPartitions(); Review Comment: +1 to @Zouxxyy comment. For cleaner, we would need to load old file slices too (not just latest file-slices). -- 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