Skip to content

Commit

Permalink
kadm: improve Lag calculation to account for log-start-offset being n…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
twmb committed May 26, 2024
1 parent c232f84 commit c46b0f8
Showing 1 changed file with 191 additions and 83 deletions.
Loading

0 comments on commit c46b0f8

Please sign in to comment.