wn1331 opened a new pull request, #24197: URL: https://github.com/apache/kafka/pull/24197
After a broker loses leadership for a `__transaction_state` partition, its transaction metadata cache may remain populated until the resignation callback removes it. `listTransactionStates` currently iterates every cache entry without verifying that the broker still leads the corresponding partition, so `ListTransactions` can return stale transactions with `Errors.NONE`. This change validates each cached partition against its coordinator epoch before collecting transaction states. Entries for partitions that the broker no longer owns are skipped, while transactions from still-owned partitions remain in the response. A stale partition does not fail the entire request because the Admin client queries all potential coordinators and aggregates their results. The regression coverage includes a mixed cache with owned and unowned partitions, follower transition before cache removal, and a stale coordinator epoch after the broker becomes leader again. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
