Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,26 @@ public void start(Map<String, String> props) {
consumer.assign(topicPartitionOffsets.keySet());
log.info("Starting with {} previously uncommitted partitions.", topicPartitionOffsets.entrySet().stream()
.filter(x -> x.getValue() == 0L).count());
log.trace("Seeking offsets: {}", topicPartitionOffsets);
topicPartitionOffsets.forEach(consumer::seek);

maybeSeek(topicPartitionOffsets);

log.info("{} replicating {} topic-partitions {}->{}: {}.", Thread.currentThread().getName(),
taskTopicPartitions.size(), sourceClusterAlias, config.targetClusterAlias(), taskTopicPartitions);
}
// when offset to seek is 0, mm2 does not have to seek, as 'seek' action may override
// consumer.auto.offset.reset=latest
private void maybeSeek(Map<TopicPartition, Long> topicPartitionOffsets) {
for (Map.Entry<TopicPartition, Long> entry : topicPartitionOffsets.entrySet()) {
TopicPartition tp = entry.getKey();
Long offset = entry.getValue();
if (offset != 0) {
consumer.seek(tp, offset);
log.debug("Seeking TopicPartition {} to offset: {}", tp, offset);
} else {
log.debug("Skip seeking TopicPartition {} ", tp);
}
}
}

@Override
public void commit() {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ group=org.apache.kafka
# - tests/kafkatest/__init__.py
# - tests/kafkatest/version.py (variable DEV_VERSION)
# - kafka-merge-pr.py
version=3.3.2
version=3.3.2-remerge1
scalaVersion=2.13.8
task=build
org.gradle.jvmargs=-Xmx2g -Xss4m -XX:+UseParallelGC
Expand Down