HuangZhenQiu commented on code in PR #12666:
URL: https://github.com/apache/hudi/pull/12666#discussion_r2152721729
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -405,6 +407,17 @@ public void doSyncHive() {
}
}
+ private void detectWriteFailure(WriteMetadataEvent event) throws
HoodieException {
+ // It will early detect any write failures in each of task and rollback
the instant
+ // to prevent data loss caused by commit failure after a checkpoint is
finished successfully.
+ long totalErrorRecords =
event.getWriteStatuses().stream().map(WriteStatus::getTotalErrorRecords).reduce(Long::sum).orElse(0L);
+ if (totalErrorRecords > 0 && !
this.conf.getBoolean(FlinkOptions.IGNORE_FAILED)) {
Review Comment:
Thanks. It is a good suggestion. Will update accordingly.
--
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]