kafka/core
Chirag Wadhwa 43a25043dd
KAFKA-19567: Added the check for underlying partition being the leader in delayedShareFetch tryComplete method (#20280)
In the current implementation, some delayed share fetch operations get
trapped in the delayed share fetch purgatory when the partition
leaderships change during share consumption. This is because there is no
check in code to make sure the current broker is still the partition
leader corresponding to the share partitions. So, when leadership
changes, the share partitions cannot be acquired, because they have
already been fenced, and tryComplete returns false. Although the
operatio does get completed when the timer expires for it, but it is too
late by then, and the operation get stuck in the watchers list waiting
for it to get purged when estimated operations increase to more than
1000. This Pr resolves this by adding the required check so that if
partition leadership changes, then the delayed share fetches waiting on
it gets completed instantaneously.

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Andrew Schofield
 <aschofield@confluent.io>
2025-08-10 10:14:58 +01:00
..
src KAFKA-19567: Added the check for underlying partition being the leader in delayedShareFetch tryComplete method (#20280) 2025-08-10 10:14:58 +01:00
.gitignore KAFKA-4848: Fix retryWithBackoff deadlock issue 2017-03-20 21:56:15 -07:00