Skip to content

KAFKA-20524: CSV reset offset plan for kafka-share-groups.sh#22197

Open
AndrewJSchofield wants to merge 1 commit intoapache:trunkfrom
AndrewJSchofield:KAFKA-20524
Open

KAFKA-20524: CSV reset offset plan for kafka-share-groups.sh#22197
AndrewJSchofield wants to merge 1 commit intoapache:trunkfrom
AndrewJSchofield:KAFKA-20524

Conversation

@AndrewJSchofield
Copy link
Copy Markdown
Member

@AndrewJSchofield AndrewJSchofield commented May 2, 2026

@github-actions github-actions Bot added the tools label May 2, 2026
@AndrewJSchofield AndrewJSchofield added the KIP-932 Queues for Kafka label May 3, 2026
return offsetsUtils.resetToLatest(partitionsToReset);
} else if (opts.options.has(opts.resetToDatetimeOpt)) {
return offsetsUtils.resetToDateTime(partitionsToReset);
} else if (offsetsUtils.resetPlanFromFile().isPresent()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call resetPlanFromFile and next call resetFromFile seem to do same reading and parsing the entire csv. May be use opts to check for presence?

withTimeoutMs(new ListShareGroupOffsetsOptions())
).partitionsToOffsetInfo(groupId).get();
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better to interrupt the currentThread for RunTimeException?
For ExecutionException, getting the instance type for ex if it's of KafkaException(GroupAuthorizationException etc), it could be more visible to the caller ?

offsetsUtils.checkAllTopicPartitionsValid(partitionsToReset);
if (opts.options.has(opts.resetToEarliestOpt)) {
if (opts.options.has(opts.resetToOffsetOpt)) {
return offsetsUtils.resetToOffset(partitionsToReset);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this pr, but this call sets offset to 0L, if opts.resetToOffsetOpt is empty or null. Is that ok instead of throwing an exception?
This is also the same in CosnumerGroupCommand too I think.

Copy link
Copy Markdown
Contributor

@muralibasani muralibasani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndrewJSchofield thanks for the pr. I have some minor comments.

@AndrewJSchofield
Copy link
Copy Markdown
Member Author

@AndrewJSchofield thanks for the pr. I have some minor comments.

Thanks for the review. I basically mapped the consumer group tool options across to the share group tool, and you're quite right that there are a few things to improve. I'll sort it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

KIP-932 Queues for Kafka tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants