danny0405 commented on code in PR #18765:
URL: https://github.com/apache/hudi/pull/18765#discussion_r3271118740
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/streamer/StreamSync.java:
##########
@@ -924,9 +924,18 @@ private Pair<Option<String>, JavaRDD<WriteStatus>>
writeToSinkAndDoMetaSync(Hood
// Step 2: Run user-configured pre-commit validators (offset, custom,
and the opt-in
// SparkWriteErrorValidator). Validators are intentionally stronger
than commitOnErrors
// — a failure here aborts the data-table commit regardless of the
gate in Step 4.
+ // Roll back the inflight data-table instant on validation failure so
it doesn't leak
+ // under LAZY failed-writes cleanup policy (consistent with Step 1
ROLLBACK_COMMIT and
+ // the Step 4 gate below). Error-table records already committed in
Step 1 are preserved
+ // by design — see Step 1's latent-quirk note.
if (validatorsConfigured) {
- SparkStreamerValidatorUtils.runValidators(props, instantTime,
writeStatuses,
- checkpointCommitMetadata, metaClient);
+ try {
+ SparkStreamerValidatorUtils.runValidators(props, instantTime,
writeStatuses,
+ checkpointCommitMetadata, metaClient);
+ } catch (HoodieValidationException e) {
+ writeClient.rollback(instantTime);
Review Comment:
can we log some msgs here and wrap the exception with similar way:
```java
writeClient.rollback(instantTime);
throw new HoodieStreamerWriteException("Error table commit failed for
instant " + instantTime);
```
--
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]