[
https://issues.apache.org/jira/browse/KAFKA-19485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Shivsundar R resolved KAFKA-19485.
----------------------------------
Fix Version/s: 4.2.0
Resolution: Fixed
> Acknowledgements should not be sent on initial epoch of ShareFetch
> ------------------------------------------------------------------
>
> Key: KAFKA-19485
> URL: https://issues.apache.org/jira/browse/KAFKA-19485
> Project: Kafka
> Issue Type: Sub-task
> Reporter: Shivsundar R
> Assignee: Shivsundar R
> Priority: Major
> Fix For: 4.2.0
>
>
> There are some race scenarios in multi-broker environments where
> acknowledgements are sent on an initial epoch in a ShareSession.
> This could arise if
> # Consumer subscribed to a partition whose leader was node-0.
> # Broker restart happens and node-0 is elected leader again. Broker starts a
> new ShareSession.
> # Background thread sends a fetch request with non-zero epoch.
> # Broker responds with SHARE_SESSION_NOT_FOUND.
> # Client updates session epoch to 0 once it receives this error.
> # Application thread processing the previous fetch, completes and sends acks
> to piggyback on next fetch.
> # Consumer is no longer *subscribed* to this partition (from heartbeat
> response) due to rebalance/change in assignment.
> # Next fetch will send the piggyback acknowledgements on the fetch for
> previously subscribed partitions resulting in error from broker
> ("Acknowledgments sent on initial epoch").
> *Fix :* Add a check before sending out acknowledgments if we are on an
> initial epoch and add necessary tests.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)