You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Shekharrajak (via GitHub)" <gi...@apache.org> on 2026/10/26 15:34:37 UTC

[PR] KAFKA-20803: Index batched read state responses once [kafka]

Shekharrajak opened a new pull request, #23963:
URL: https://github.com/apache/kafka/pull/23963

   Follow-up to #22835 for [KAFKA-20803](https://issues.apache.org/jira/browse/KAFKA-20803).
   
   When many partitions share a `READ_SHARE_GROUP_STATE` batch, `ReadStateHandler` scans the combined response for every handler. Reuse `PartitionResultIndex` to index the response once and look up each handler's result, reducing worst-case demultiplexing from O(N²) to average O(N) per batch while preserving response payloads and error/retry handling.
   
   This RPC was deferred in #22835 because it is less frequent than WRITE. This change targets large batches and trades O(N) temporary map entries for bounded response traversal; it makes no cluster latency or heap benchmark claim. The PR is independent of the other RPC follow-ups.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20803: Index batched read state responses once [kafka]

Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak closed pull request #23963: KAFKA-20803: Index batched read state responses once
URL: https://github.com/apache/kafka/pull/23963


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20803: Index batched read state responses once [kafka]

Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on PR #23963:
URL: https://github.com/apache/kafka/pull/23963#issuecomment-6420098063

   Validation:
   
   - Added `ReadStateHandlerDemultiplexingTest`: mixed topics with overlapping partition numbers, payload/error-message preservation, missing topics/partitions, null/bodyless responses, fresh responses after a retry, and direct completion without a shared index.
   - The work-count regression runs with 1, 16, and 256 partitions. On unchanged trunk, the 16/256 cases fail because `results()` is accessed per handler. With this change, `results()` and the topic's partition list are each accessed once, and every response partition key is read exactly once.
   - Passed `./gradlew :server-common:spotlessApply :server-common:test --tests '*PersisterStateManagerTest' --tests '*ReadStateHandlerDemultiplexingTest' :server-common:spotlessCheck`, including module Checkstyle and SpotBugs main checks.
   - Passed `git diff --check`.
   
   Prepared with Codex assistance.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org