[HUDI-2062] Catch FileNotFoundException in WriteProfiles #getCommitMetadata Safely (#3138)
Co-authored-by: 喻兆靖 <yuzhaojing@bilibili.com>
This commit is contained in:
@@ -150,14 +150,17 @@ public class WriteProfiles {
|
|||||||
Path basePath,
|
Path basePath,
|
||||||
HoodieInstant instant,
|
HoodieInstant instant,
|
||||||
HoodieTimeline timeline) {
|
HoodieTimeline timeline) {
|
||||||
byte[] data = timeline.getInstantDetails(instant).get();
|
|
||||||
try {
|
try {
|
||||||
|
byte[] data = timeline.getInstantDetails(instant).get();
|
||||||
return Option.of(HoodieCommitMetadata.fromBytes(data, HoodieCommitMetadata.class));
|
return Option.of(HoodieCommitMetadata.fromBytes(data, HoodieCommitMetadata.class));
|
||||||
} catch (IOException e) {
|
} catch (FileNotFoundException fe) {
|
||||||
// make this fail safe.
|
// make this fail safe.
|
||||||
|
LOG.warn("Instant {} was deleted by the cleaner, ignore", instant.getTimestamp());
|
||||||
|
return Option.empty();
|
||||||
|
} catch (IOException e) {
|
||||||
LOG.error("Get write metadata for table {} with instant {} and path: {} error",
|
LOG.error("Get write metadata for table {} with instant {} and path: {} error",
|
||||||
tableName, instant.getTimestamp(), basePath);
|
tableName, instant.getTimestamp(), basePath);
|
||||||
return Option.empty();
|
throw new HoodieException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user