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

Enhancement: reset group offsets to a specific time #141

Merged
merged 3 commits into from
Sep 9, 2023

Conversation

jvansanten
Copy link
Contributor

For partitioned topics, it's often useful to reset the group position all partitions to a specific time rather than a specific offset. This PR teaches kt group -reset to accept a time string (as parsed by https://github.com/markusmobius/go-dateparser) in addition to the special values newest and oldest. For example, kt group -group some-group -topic some topic -reset "6 hours ago" is much more convenient than trying to figure out which offsets correspond to that time and invoking kt group -reset for each of N partitions.

Also, kt group -reset ARG prints the resulting offsets and lags when ARG is "newest", "oldest" or a time string, rather than omitting them on the assumption that the lag is unknown. As far as I can tell the value of specialOffset is unrelated to whether the offset was previously stored on the broker or not.

jvansanten and others added 3 commits September 8, 2023 14:37
The previous comment appears misleading; if specialOffset is true, then the offset _was_ reset
@fgeller
Copy link
Owner

fgeller commented Sep 9, 2023

thank you! will pull this in and resolve conflicts on main. do you maybe want to follow up with updates to --help similar to the other pr?

@fgeller fgeller merged commit b5dad5b into fgeller:main Sep 9, 2023
1 check passed
jvansanten added a commit to jvansanten/kt that referenced this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants