Anderson Choi
Anderson Choi

Reputation: 373

What is the difference between --to-latest and --to-current offset values

Below is the comment in the Apache Kafka repository.

  --to-latest : Reset offsets to latest offset.
  --to-current : Resets offsets to current offset.

What is difference between two option? Aren't they both the same thing?

Upvotes: 0

Views: 508

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191710

The latest option ignores committed offsets and seeks the group to the highest offset for all partitions.

The current option resets to the committed offsets, which I believe would be a no-op for any non-active consumer group.

For a group with zero lag, both options will do the same thing.

Source: https://github.com/apache/kafka/blob/3.0/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala

The current option is explained in KIP-122

When we want to only print out and/or backup the current offset by partition.

Upvotes: 1

Related Questions