HHoflittlefish777 commented on code in PR #33846:
URL: https://github.com/apache/doris/pull/33846#discussion_r1575582527


##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/KafkaRoutineLoadJob.java:
##########
@@ -319,16 +319,27 @@ protected boolean 
checkCommitInfo(RLTaskTxnCommitAttachment rlTaskTxnCommitAttac
         return false;
     }
 
+    private void updateProgressAndOffsetsCache(RLTaskTxnCommitAttachment 
attachment) {
+        ((KafkaProgress) 
attachment.getProgress()).getOffsetByPartition().entrySet().stream()
+                .forEach(entity -> {
+                    if 
(cachedPartitionWithLatestOffsets.containsKey(entity.getKey())
+                            && 
cachedPartitionWithLatestOffsets.get(entity.getKey()) < entity.getValue() + 1) {
+                        cachedPartitionWithLatestOffsets.put(entity.getKey(), 
entity.getValue() + 1);

Review Comment:
   cachedPartitionWithLatestOffsets will be one more than the actual 
consumption.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to