hudi-agent commented on code in PR #20323:
URL: https://github.com/apache/hudi/pull/20323#discussion_r4270237335
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -587,11 +592,17 @@ private void handleBootstrapEvent(WriteMetadataEvent
event) {
this.eventBuffers.cleanLegacyEvents(event);
return;
}
- EventBuffer eventBuffer =
this.eventBuffers.getOrCreateBootstrapBuffer(event);
- eventBuffer.addBootstrapEvent(event);
- if (eventBuffer.allBootstrapEventsReceived()) {
+ // The writer may have observed a pending instant before its normal commit
finished.
+ // Do not recreate the committed buffer when that bootstrap event arrives
later.
+ if (this.eventBuffers.getEventBuffer(event.getCheckpointId()) == null
Review Comment:
🤖 nit: would it make sense to pull this two-line condition into a small
helper such as `isLateBootstrapForCommittedInstant(event)`, so the early return
reads as intent?
<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]