-
Notifications
You must be signed in to change notification settings - Fork 13
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
Consumer group reset offset #960
Conversation
8d8a751
to
1c9dfbb
Compare
f79e505
to
eebece8
Compare
1646f72
to
68d4b54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemahg , I noticed that the topics were not appearing for empty consumer groups. This is because the members
will also be empty. However, the offsets
can also be used to obtain the topic information as long as offsets have been committed for a topic/partition. This might improve the experience in those cases. I suggest defining allTopics
[1] like this:
const allTopics: { topicId: string; topicName: string; }[] = [];
row.attributes.members?.
flatMap((m) => m.assignments ?? []).
forEach(a => allTopics.push({ topicId: a.topicId, topicName: a.topicName }));
row.attributes.offsets?.
forEach(a => allTopics.push({ topicId: a.topicId, topicName: a.topicName }));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemahg the API doesn't currently support dry-run operations for the consumer group reset. We can add it in this PR or a separate one, what do you think?
ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/ConsumerGroupsTable.tsx
Outdated
Show resolved
Hide resolved
5dff846
to
4879517
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. Please do a round of prettify on the changed files, rebase, update the test that’s failing (I didn’t check which one it is), and we can move this to the dev end and test it on the field
519c637
to
0c99bd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few additional comments.
Another problem that I am having is that the members table does not update after resetting the offsets. I suspect this is a similar problem to the consumer group list page where the initial value when navigating to the page are always out of date and do not update until the refresh function runs. My guess is that this is somehow due to server-side rendering never being updated, but maybe we can figure it out and fix it with this PR? Something for sure will need to be done about the members page because it never updates currently.
typeof UpdateConsumerGroupErrorSchema | ||
>; | ||
|
||
export const ConsumerGroupDryrunResponseSchema = z.object({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the same schema as ConsumerGroupResponse
. It looks like all the optional fields are already correctly set in ConsumerGroupResponse
. Can we use a single schema definition instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the ConsumerGroupSchema
before implementing it and noticed it contains several fields that are not required for the dry run. For example:
typescript
Copy code
offsets: z.array(OffsetAndMetadataSchema).optional()
const OffsetAndMetadataSchema = z.object({
topicId: z.string(),
topicName: z.string(),
partition: z.number(),
offset: z.number(),
logEndOffset: z.number().optional(),
lag: z.number().optional(),
metadata: z.string(),
leaderEpoch: z.number().optional()
});
Fields like offset, logEndOffset, and lag are not needed for the dry run, so I created a new response schema for dryrun
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, the dry run will return a subset of the data that you would get from the describe/fetch operator. The back-end API uses the same data model for both. Just mentioning it because it might help reduce maintenance in the future and make it clear that they are the same response schema from the API.
@MikeEdgar, can we merge this PR? If there are more updates I will do them in another PR |
@hemahg I'm doing another round of testing and I'll merge before EOD. |
Signed-off-by: hemahg <[email protected]>
Signed-off-by: hemahg <[email protected]>
Signed-off-by: hemahg <[email protected]>
Signed-off-by: hemahg <[email protected]>
Signed-off-by: hemahg <[email protected]>
Signed-off-by: hemahg <[email protected]>
c740c8a
to
69798cb
Compare
Quality Gate passedIssues Measures |
Consumer group reset offset
consumer group reset offset page
Dryrun page