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

kadm: improve Lag calculation to account for log-start-offset being non-zero #744

Merged
merged 2 commits into from
May 26, 2024

Conversation

twmb
Copy link
Owner

@twmb twmb commented May 26, 2024

This adds one more round trip in the Lag function to request start offsets, but this improves the case when topics have segments deleted over time. We could go through some detailed way of avoiding requests for partitions that have commits, but having the start offset is pretty valuable a lot of time time anyway -- and we keep the logic simpler.

Now,

  • if a topic is assigned to a group,
  • and a partition in that topic has no commits,
  • and the log-start-offset for the partition is non-zero Lag will no longer show the entire partition as lagging from zero, but instead will show more accurately the log-end-offset - log-start-offset. If LEO == LSO, the lag is now zero, rather than LEO itself.

This also no longer says lag is negative if a commit is past the end of a partition; instead the lag is zero.

Closes #718.

@twmb twmb added the kadm Anything related to kadm specifically label May 26, 2024
…on-zero

This adds one more round trip in the `Lag` function to request start
offsets, but this improves the case when topics have segments deleted
over time. We _could_ go through some detailed way of avoiding requests
for partitions that have commits, but having the start offset is pretty
valuable a lot of time time anyway -- and we keep the logic simpler.

Now,
* if a topic is assigned to a group,
* and a partition in that topic has no commits,
* and the log-start-offset for the partition is non-zero
Lag will no longer show the entire partition as lagging from zero, but
instead will show more accurately the log-end-offset - log-start-offset.
If LEO == LSO, the lag is now zero, rather than LEO itself.

This also no longer says lag is negative if a commit is past the end of
a partition; instead the lag is zero.

Closes #718.
@twmb twmb merged commit f71ee63 into master May 26, 2024
10 checks passed
@twmb twmb deleted the 718 branch May 26, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kadm Anything related to kadm specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant