danny0405 commented on code in PR #12666:
URL: https://github.com/apache/hudi/pull/12666#discussion_r2151413078
##########
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:
move this into write function, and add a new option `write.fail.fast`
--
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]