wombatu-kun commented on code in PR #19117:
URL: https://github.com/apache/hudi/pull/19117#discussion_r3497887193


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/utils/EventBuffers.java:
##########
@@ -171,7 +171,7 @@ public String getPendingInstants() {
    */
   public Map<Long, Pair<String, EventBuffer>> getAllCompletedEvents() {
     return this.eventBuffers.entrySet().stream()
-        .filter(entry -> entry.getValue().getRight().allEventsCompleted())
+        .filter(entry -> entry.getValue().getRight().allEventsCompleted() && 
!entry.getValue().getRight().isEmptyDataWriteBuffer())

Review Comment:
   No test exercises this new `!isEmptyDataWriteBuffer()` clause. Both 
`testPendingCommitInstantCountGauge` and 
`TestStreamWriteOperatorCoordinator#testPendingCommitInstantCount` only add 
non-null data-write events, so `isEmptyDataWriteBuffer()` is always false and 
deleting this clause would not fail either test. Add a case that builds a 
completed buffer whose data-write buffer is all null (for example only 
metadata/index events, or a failover-reset buffer) and asserts it is excluded 
from the count.



-- 
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]

Reply via email to