mirror of https://github.com/apache/kafka.git
CI / build (push) Waiting to run
Details
### Background As part of KIP-932 implementation, ShareFetch requests need to properly integrate with Kafka's quota system. This requires that ShareFetch requests extract and pass the correct session information (Principal, client address, client ID) to quota managers, ensuring consistent quota enforcement between ShareFetch and traditional Fetch requests. ### Changes This PR adds `testHandleShareFetchRequestQuotaTagsVerification()`, `testHandleShareAcknowledgeRequestQuotaTagsVerification` and `testHandleShareFetchWithAcknowledgementQuotaTagsVerification` to `KafkaApisTest`, which provides verification of quota tag extraction and session handling for ShareFetch and ShareAcknowledge requests. - Ensures ShareFetch/ShareAck requests are properly constructed with the correct client ID, principal, client address, and API key - Verifies the request context contains the expected session information - Uses `ArgumentCaptor` to capture the exact `Session` and `RequestChannel.Request` objects passed to quota managers - Verifies both `quotas.fetch.maybeRecordAndGetThrottleTimeMs()` and `quotas.request.maybeRecordAndGetThrottleTimeMs()` are called with correct parameters as and when needed. - Validates that the captured `RequestChannel.Request` object maintains the correct request context information - Ensures the client ID passed to quota managers matches the test-defined value - Verifies that in case of Acks being piggybacked on the fetch requests, the quotas are applied only once and not twice. Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com> |
||
---|---|---|
.. | ||
src | ||
.gitignore |