1
0

[HUDI-3362] Fix restore to rollback pending clustering operations followed by other rolling back other commits (#4772)

This commit is contained in:
satishkotha
2022-02-11 11:12:45 -08:00
committed by GitHub
parent b431246710
commit 89ed6f062e
3 changed files with 30 additions and 7 deletions

View File

@@ -215,6 +215,12 @@ public class ClusteringUtils {
}
public static List<HoodieInstant> getPendingClusteringInstantTimes(HoodieTableMetaClient metaClient) {
return metaClient.getActiveTimeline().filterPendingReplaceTimeline().getInstants().collect(Collectors.toList());
return metaClient.getActiveTimeline().filterPendingReplaceTimeline().getInstants()
.filter(instant -> isPendingClusteringInstant(metaClient, instant))
.collect(Collectors.toList());
}
public static boolean isPendingClusteringInstant(HoodieTableMetaClient metaClient, HoodieInstant instant) {
return getClusteringPlan(metaClient, instant).isPresent();
}
}