hudi-agent commented on code in PR #18757:
URL: https://github.com/apache/hudi/pull/18757#discussion_r3253297896
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -435,6 +431,18 @@ private void handleBootstrapEvent(WriteMetadataEvent
event) {
.filter(evt -> evt.getWriteStatuses().size() > 0)
.findFirst().map(WriteMetadataEvent::getInstantTime)
.orElse(WriteMetadataEvent.BOOTSTRAP_INSTANT);
+
+ // if currentInstant is pending && bootstrap event instant is empty
+ // reuse currentInstant, reject bootstrap
+ if
(this.metaClient.reloadActiveTimeline().filterInflightsAndRequested().containsInstant(this.instant)
+ && instant.equals(WriteMetadataEvent.BOOTSTRAP_INSTANT)
+ && this.tableState.operationType == WriteOperationType.INSERT) {
+ LOG.warn("Reuse current pending Instant {} with {} operationType, "
Review Comment:
🤖 nit: the `{}` placeholder is always filled with
`WriteOperationType.INSERT.value()` since we just checked `operationType ==
INSERT` — it could be confusing to a reader who wonders why it's a placeholder
if it never varies. Could you either inline `"INSERT"` in the string, or use
`this.tableState.operationType.value()` so it reads as a runtime value like the
first `{}`?
<sub><i>- AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/sink/utils/TestFunctionWrapper.java:
##########
@@ -82,6 +82,14 @@ default void coordinatorFails() throws Exception {
throw new UnsupportedOperationException();
}
+ /**
+ * Triggers Job level fail, so the coordinator need re-create a new instance.
Review Comment:
🤖 nit: "Triggers Job level fail" describes the scenario rather than what the
method does, and it blurs the distinction with `coordinatorFails()` which
already exists. Something like "Simulates a coordinator restart by closing and
re-creating the coordinator instance" would be clearer — and "need re-create"
should be "needs to re-create".
<sub><i>- AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]