Skip to content

MINOR: Update getOrMaybeCreateClassicGroup to only throw GroupIdNotFoundException #16919

Merged
dajac merged 1 commit into
apache:trunkfrom
confluentinc:djacot/KAFKA-16503
Aug 20, 2024
Merged

MINOR: Update getOrMaybeCreateClassicGroup to only throw GroupIdNotFoundException #16919
dajac merged 1 commit into
apache:trunkfrom
confluentinc:djacot/KAFKA-16503

Conversation

@dajac

@dajac dajac commented Aug 19, 2024

Copy link
Copy Markdown
Member

This patch updates getOrMaybeCreateClassicGroup to only throw GroupIdNotFoundException as we did for other internal methods. The callers are responsible for translating the error to the appropriate one depending on the context. There is only one case.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@dajac dajac added the KIP-848 The Next Generation of the Consumer Rebalance Protocol label Aug 19, 2024

@AndrewJSchofield AndrewJSchofield left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm. Looks like a better choice of exception.

@chia7712

Copy link
Copy Markdown
Member

This patch updates getOrMaybeCreateClassicGroup to only throw GroupIdNotFoundException as we did for other internal methods.

Pardon me, I fail to get the context. why getOrMaybeCreatePersistedShareGroup and getOrMaybeCreatePersistedConsumerGroup throw IllegalStateException rather than GroupIdNotFoundException?

@dajac

dajac commented Aug 20, 2024

Copy link
Copy Markdown
Member Author

This patch updates getOrMaybeCreateClassicGroup to only throw GroupIdNotFoundException as we did for other internal methods.

Pardon me, I fail to get the context. why getOrMaybeCreatePersistedShareGroup and getOrMaybeCreatePersistedConsumerGroup throw IllegalStateException rather than GroupIdNotFoundException?

getOrMaybeCreatePersistedShareGroup and getOrMaybeCreatePersistedConsumerGroup are only used in the replay methods. In this context, using an IllegalStateException makes sense because the state is indeed illegal if we replay a record and we don't have the required state in place. We could also use GroupIdNotFoundException in those two. It does not make a big difference in the end.

getOrMaybeCreateShareGroup and getOrMaybeCreateConsumerGroup are used in other paths and they both use GroupIdNotFoundException like getOrMaybeCreateClassicGroup.

@chia7712 chia7712 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@dajac dajac merged commit de67ac6 into apache:trunk Aug 20, 2024
@dajac dajac deleted the djacot/KAFKA-16503 branch August 20, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

KIP-848 The Next Generation of the Consumer Rebalance Protocol

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants