You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Rovere Lorenzo <l....@reply.it> on 2021/05/06 09:25:28 UTC

kafka-consumer-groups option

Hi,
I'm playing with the kafka-consumer-groups.sh command.
I wanted to ask the utility of the --to-current option used to reset offsets of a consumer group to current offset. The thing I don't understand is in which scenario I would want to use this option. If I'm already at the current offset, why would I need to reset to the offset I'm already at?
Thanks in advance

Lorenzo Rovere





Lorenzo Rovere

Technology Reply
Via Avogadri, 2
31057 - Silea (TV) - ITALY
phone: +39 0422 1836521
l.rovere@reply.it<ma...@reply.it>
www.reply.it<http://www.reply.it> <http://>

[Technology Reply]

R: kafka-consumer-groups option

Posted by Rovere Lorenzo <l....@reply.it>.
Ok I understard why I should reset the offset, but why would I want to reset to the current one? I mean, am I not always at the current offset by definition?
I don't know if I am missing something, but if I describe a consumer group and I see 

TOPIC           PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG    
test_topic      1          		52              	55              	3             
test_topic      0         		 59              	71              	12  

and now I want to reset --to-current, I obtain:

TOPIC                          PARTITION  NEW-OFFSET
test_topic                     1         	 52
test_topic                     0         	 59

Apparently nothing changed, are there any benefits in resetting --to-current?
I hope everything is clear.
Lorenzo




Lorenzo Rovere 

Technology Reply
Via Avogadri, 2
31057 - Silea (TV) - ITALY 
phone: +39 0422 1836521
l.rovere@reply.it
www.reply.it
-----Messaggio originale-----
Da: mangat rai <ma...@gmail.com> 
Inviato: 6 May, 2021 11:51 AM
A: users@kafka.apache.org
Oggetto: Re: kafka-consumer-groups option

Hey Lorenzo Rovere,

Consider the case where you want to reprocess all the data. Let's say your process had a bug. You fixed it and now you want to reprocess everything to produce the correct output.

Similarly, there can be other use cases for resetting the consumer offsets and reprocessing the input.

Regards,
Mangat

On Thu, May 6, 2021 at 11:25 AM Rovere Lorenzo <l....@reply.it> wrote:

> Hi,
>
> I’m playing with the kafka-consumer-groups.sh command.
>
> I wanted to ask the utility of the *--to-current* option used to 
> *reset offsets of a consumer group to current offset*. The thing I 
> don’t understand is in which scenario I would want to use this option. 
> If I’m already at the current offset, why would I need to reset to the 
> offset I’m already at?
>
> Thanks in advance
>
>
>
> Lorenzo Rovere
>
>
>
>
>
> Lorenzo Rovere
>
> Technology Reply
> Via Avogadri, 2
> 31057 - Silea (TV) - ITALY
> phone: +39 0422 1836521
> l.rovere@reply.it
> www.reply.it
>
> [image: Technology Reply]
>

Re: kafka-consumer-groups option

Posted by mangat rai <ma...@gmail.com>.
Hey Lorenzo Rovere,

Consider the case where you want to reprocess all the data. Let's say your
process had a bug. You fixed it and now you want to reprocess everything to
produce the correct output.

Similarly, there can be other use cases for resetting the consumer offsets
and reprocessing the input.

Regards,
Mangat

On Thu, May 6, 2021 at 11:25 AM Rovere Lorenzo <l....@reply.it> wrote:

> Hi,
>
> I’m playing with the kafka-consumer-groups.sh command.
>
> I wanted to ask the utility of the *--to-current* option used to *reset
> offsets of a consumer group to current offset*. The thing I don’t
> understand is in which scenario I would want to use this option. If I’m
> already at the current offset, why would I need to reset to the offset I’m
> already at?
>
> Thanks in advance
>
>
>
> Lorenzo Rovere
>
>
>
>
>
> Lorenzo Rovere
>
> Technology Reply
> Via Avogadri, 2
> 31057 - Silea (TV) - ITALY
> phone: +39 0422 1836521
> l.rovere@reply.it
> www.reply.it
>
> [image: Technology Reply]
>