danny0405 commented on code in PR #9085:
URL: https://github.com/apache/hudi/pull/9085#discussion_r1246021776
##########
hudi-common/src/main/java/org/apache/hudi/common/util/CompactionUtils.java:
##########
@@ -159,9 +160,30 @@ private static List<Pair<HoodieInstant,
HoodieCompactionPlan>> getCompactionPlan
HoodieTableMetaClient metaClient, Function<HoodieTableMetaClient,
HoodieTimeline> filteredTimelineSupplier,
Function<String, HoodieInstant> requestedInstantWrapper) {
List<HoodieInstant> filteredInstants =
filteredTimelineSupplier.apply(metaClient).getInstants();
+
return filteredInstants.stream()
- .map(instant -> Pair.of(instant, getCompactionPlan(metaClient,
requestedInstantWrapper.apply(instant.getTimestamp()))))
- .collect(Collectors.toList());
+ .map(instant -> {
+ HoodieCompactionPlan compactionPlan = null;
+ try {
+ compactionPlan = getCompactionPlan(metaClient,
requestedInstantWrapper.apply(instant.getTimestamp()));
+ } catch (HoodieException e) {
+ if (e.getCause() instanceof IOException &&
e.getCause().getMessage().contains("Not an Avro data file")) {
+ // try reloading metaclient so that compaction plan could have
been fully serialized.
+ try {
+ Thread.sleep(5);
Review Comment:
We should never expect to sleep in catch block. And the problem may exist
for all the plan files, not just compaction.
--
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]