[
https://issues.apache.org/jira/browse/HUDI-2270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17392003#comment-17392003
]
ASF GitHub Bot commented on HUDI-2270:
--------------------------------------
danny0405 commented on a change in pull request #3386:
URL: https://github.com/apache/hudi/pull/3386#discussion_r681461078
##########
File path:
hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java
##########
@@ -329,6 +337,30 @@ private void initInstant(String instant) {
}, "initialize instant %s", instant);
}
+ public void removeCorruptedCleanAction() {
+ HoodieTableMetaClient client =
writeClient.getHoodieTable().getMetaClient();
+ HoodieTimeline cleanerTimeline =
client.getActiveTimeline().getCleanerTimeline();
+
+ executor.execute(() -> {
+ LOG.info("Inspecting clean metadata in timeline for corrupted files");
+ cleanerTimeline.getInstants().forEach(instant -> {
+ try {
+ CleanerUtils.getCleanerPlan(client, instant);
+ } catch (AvroRuntimeException e) {
+ LOG.warn("Corruption found. Trying to remove corrupted clean instant
file: " + instant);
+ FSUtils.deleteInstantFile(client.getFs(), client.getMetaPath(),
instant);
+ } catch (IOException ioe) {
+ if (ioe.getMessage().contains("Not an Avro data file")) {
+ LOG.warn("Corruption found. Trying to remove corrupted clean
instant file: " + instant);
Review comment:
Move this work to `CleanFunction`.
--
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]
> Remove corrupted clean action
> -----------------------------
>
> Key: HUDI-2270
> URL: https://issues.apache.org/jira/browse/HUDI-2270
> Project: Apache Hudi
> Issue Type: Improvement
> Components: Flink Integration
> Reporter: yuzhaojing
> Assignee: yuzhaojing
> Priority: Major
> Labels: pull-request-available
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)