You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Justinwins (Jira)" <ji...@apache.org> on 2022/06/25 10:24:00 UTC

[jira] [Created] (KAFKA-14023) MirrorCheckpointTask.syncGroupOffset does not have to check if translated offset from upstream is smaller than the current consumer offset

Justinwins created KAFKA-14023:
----------------------------------

             Summary: MirrorCheckpointTask.syncGroupOffset  does not have to check if translated offset from upstream is smaller than the current consumer offset
                 Key: KAFKA-14023
                 URL: https://issues.apache.org/jira/browse/KAFKA-14023
             Project: Kafka
          Issue Type: Improvement
          Components: KafkaConnect
    Affects Versions: 3.2.0
            Reporter: Justinwins
            Assignee: Justinwins


In  MirrorCheckpointTask.syncGroupOffset () , there  is  a dedicated check , as described :

(line 285)

 
{code:java}
// code placeholder
// if translated offset from upstream is smaller than the current consumer offset
// in the target, skip updating the offset for that partition

long latestDownstreamOffset = targetConsumerOffset.get(topicPartition).offset();
if (latestDownstreamOffset >= convertedOffset.offset()) {
log.trace("latestDownstreamOffset {} is larger than or equal to convertedUpstreamOffset {} for "
+ "TopicPartition {}", latestDownstreamOffset, convertedOffset.offset(), topicPartition);
continue;
}
offsetToSync.put(topicPartition, convertedOffset); {code}
 

I think there is no need to check 'whether translated offset from upstream is smaller than the current consumer offset' ,as downstream offsets are better to keep up with upstream 

offsets.Let's say, we reset offset for upstream , it is expected that downstream offsets are synced accordingly ,too

 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)