Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resetting consumer offsets to latest causes lag to show as -2 #12

Open
yolken-segment opened this issue Aug 25, 2020 · 0 comments
Open
Labels
bug Something isn't working

Comments

@yolken-segment
Copy link
Contributor

If you run reset-offsets with --offset=-1, i.e. to reset the consumer group to the latest offset, the offsets show up as -2 in the lag output, e.g.:

Benjamins-MacBook-Pro:topicctl benjamin.yolken$ topicctl get lags --zk-addr=localhost:2181 topic-default test-consumer
[2020-08-25 16:02:20]  INFO Group member lags:
------------+--------------------------------+---------------+-------------+---------------+---------------------------+------------+-----------
  PARTITION |           MEMBER ID            | MEMBER OFFSET | MEMBER TIME | LATEST OFFSET |        LATEST TIME        | OFFSET LAG | TIME LAG  
------------+--------------------------------+---------------+-------------+---------------+---------------------------+------------+-----------
  0         | [email protected] | -2            |             | 5293          | 2020-08-25T16:02:20-07:00 | 5295       |           
  1         | [email protected] | -2            |             | 5293          | 2020-08-25T16:02:20-07:00 | 5295       |           
  2         | [email protected] | -2            |             | 5292          | 2020-08-25T16:02:20-07:00 | 5294       |           
------------+--------------------------------+---------------+-------------+---------------+---------------------------+------------+-----------

They're not actually -2 (i.e., earliest offset) in Kafka; this is just an artifact of this logic in kafka-go: https://github.com/segmentio/kafka-go/blob/bd93f32228e23a60cc087dea40d5f81a41ed34d0/client.go#L113. We should probably remove that logic from the previous function.

@yolken-segment yolken-segment added the bug Something isn't working label Aug 25, 2020
@yolken-segment yolken-segment changed the title Resetting consumer offsets to latest causes lag to show as -2 Resetting consumer offsets to latest causes lag to show as -2 Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant