fluss
fluss copied to clipboard
[client] Add consumer group owner discovery
Search before asking
- [x] I searched in the issues and found nothing similar.
Description
Description
Motivation
This is a subtask of #4608.
Add the client-side owner-discovery component for FIP-53 after the consumer-offset table foundation, RPC contract, and server-side owner discovery have been merged. Scanner offset commit and fetch need a reusable component that finds and caches the tablet server owning a consumer group before those operations can be implemented.
Scope
- Add an internal
ConsumerGroupManagerthat discovers the owner tablet server of a consumer group throughFindConsumerGroupOwnervia any known tablet server. - Cache the discovered owner and share a single in-flight discovery request among concurrent callers.
- Invalidate the cached owner on demand so later operations rediscover after owner changes or gateway loss.
- Surface discovery failures as
ConsumerGroupOwnerNotAvailableException(aRetriableException) withoutCompletionExceptionwrapping, so callers can implement retries based on the failure type. - Coordinate scanner-thread discovery and RPC-callback state updates
through the same monitor pattern used by
LogFetcher. - Add tests for caching and invalidation, concurrent single-request sharing, decode failures, and the no-known-server failure.
Out of scope
- Client-side offset commit, fetch, and auto-commit implementations
- Scanner integration and committed-offset initialization
- Client-side retry loops and backoff policy
- Owner migration detection from operation errors
Willingness to contribute
- [x] I'm willing to submit a PR!
Implemented by https://github.com/apache/fluss/pull/5287