1
0

[HUDI-3848] Fixing restore with cleaned up commits (#5288)

This commit is contained in:
Sivabalan Narayanan
2022-04-15 14:47:53 -04:00
committed by GitHub
parent 9e8664f4d2
commit 57612c5c32
2 changed files with 97 additions and 1 deletions

View File

@@ -239,7 +239,15 @@ public class ListingBasedRollbackStrategy implements BaseRollbackPlanActionExecu
SerializablePathFilter pathFilter = getSerializablePathFilter(baseFileExtension, instantToRollback.getTimestamp());
Path[] filePaths = getFilesFromCommitMetadata(basePath, commitMetadata, partitionPath);
return fs.listStatus(filePaths, pathFilter);
return fs.listStatus(Arrays.stream(filePaths).filter(entry -> {
try {
return fs.exists(entry);
} catch (IOException e) {
LOG.error("Exists check failed for " + entry.toString(), e);
}
// if IOException is thrown, do not ignore. lets try to add the file of interest to be deleted. we can't miss any files to be rolled back.
return false;
}).toArray(Path[]::new), pathFilter);
}
private FileStatus[] fetchFilesFromListFiles(HoodieInstant instantToRollback, String partitionPath, String basePath,