AndrewJSchofield opened a new pull request, #21824: URL: https://github.com/apache/kafka/pull/21824
A share consumer uses a share session to keep track of its acquired records with each share-partition leader it is talking to. When the connection breaks, the share session is lost and acknowledgements fail. When the connection to a share-partition leader occurred while there was an outstanding request, the share consumer noticed the disconnection and failed the acknowledgements as expected. Also, if the leader changed to a different broker, again the share consumer noticed the leadership change and failed the acknowledgements as expected. There were also a few situations in which acknowledgements could be lost and not notified to the acknowledgement commit callback to do with this kind of leadership non-transition. In the situation where the share-partition leadership did not change when the broker restarted AND there was no in-flight request, the share consumer did not notice the disconnection and would try to continue the share session. This PR improves the situation by using a consistent exception `NotLeaderOrFollowerException` regardless of when the disconnection was noticed. It also makes sure that acknowledgements which cannot be sent are completed properly in all cases. It is possible that a tweak to the protocol will be needed to eliminate `ShareSessionNotFoundException` in all edge cases, but that would take a KIP. -- 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]
